HTTP

Dionaea supports http on port 80 as well as https, but there is no code making use of the data gathered on these ports. For https, the self-signed ssl certificate is created at startup.

Configure

Example configuration:

- name: http
  config:
    root = "var/dionaea/wwwroot"

default_headers

Default header fields are send if none of the other header patterns match.

global_headers

Global header fields are added to all response headers.

headers

List of header fields to be used in the response header. Only applied if filename_pattern, status_code and methods match. The first match in the list is used.

max_request_size

Maximum size in kbytes of the request. 32768 = 32MB

root

The root directory so serve files from.

Example config

services/http.yaml
- name: http
  config:
    root: "@DIONAEA_STATEDIR@/http/root"
    ports:
      - 80
    ssl_ports:
      - 443
    max_request_size: 32768 # maximum size in kbytes of the request (32MB)
    global_headers:
      - ["Server", "nginx"]
    headers:
      - filename_pattern: ".*\\.php"
        headers:
          - ["Content-Type", "text/html; charset=utf-8"]
          - ["Content-Length", "{content_length}"]
          - ["Connection", "{connection}"]
          - ["X-Powered-By", "PHP/5.5.9-1ubuntu4.5"]
    # soap_enabled: false
    template:
      # set to true to enable template processing
      # this feature requires jinja2 template engine http://jinja.pocoo.org/
      enabled: false
      file_extension: .j2
      path: "@DIONAEA_STATEDIR@/http/template/nginx"
      templates:
        autoindex:
          filename: autoindex.html.j2
        error_pages:
          - filename: error.html.j2
          # - filename: error/{code}.html.j2
      # used to specify additional template values
      values:
        # full_name: nginx/1.1

Additional examples

Set the Server response field.

- name: http
  config:
    global_headers:
      - ["Server", "nginx"]

Define headers to use if the filename matches a pattern.

- name: http
  config:
    headers:
      - filename_pattern: ".*\\.php"
        headers:
          - ["Content-Type", "text/html; charset=utf-8"]
          - ["Content-Length", "{content_length}"]
          - ["Connection", "{connection}"]
          - ["X-Powered-By", "PHP/5.5.9-1ubuntu4.5"]