Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routes Configuration #2

Closed
cmllr opened this issue Jan 30, 2018 · 0 comments
Closed

Routes Configuration #2

cmllr opened this issue Jan 30, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@cmllr
Copy link
Member

cmllr commented Jan 30, 2018

Implement configuration of routes that the honeypot can fake several manufacturers to simulate a vulnerable environment.

The routing has three parts: The route itself, it's headers and requests fields (POST, GET etc.), possibly returned variables (like session tokens) and actions. Actions define what the route should to.

The actions are predefined Python based methods which can be enhanced. If the honeypot maintainer needs more complex actions, it can be accomplished.

Variables

  • $session a simulated session token e. g. returned by an authorization route, created by the authorize Action. Will be valid until a route calls the deauthorize action.
  • $hostname the configured hostname
  • $serialnumber a fake serial number

You can also use variables from the honeypot configuration file. E. g. you configured MY_VARIABLE, you can use that value by prefixing it wiith a "$": $MY_VARIABLE.

Actions

Actions are predefined operations a route should do.

  • authorize: Tries to login a user with the given credentials (will be searched in POST or GET or also out of an Authorization-Header). Will set '$session' to a new token
  • deauthorize: Revokes a token. The token will be searched in any text containing header field, so it can be used from POST or GET or also out of an Authorization-Header.
  • tokencheck: Tries to find an token in POST, GET or in a header field. If nothing was found, the route causes an 403 Forbidden response
  • catchfile: Will store any file uploaded in HTTP file-Fields
  • servefile: Will use a given file as response source. It will take the arguments file. If the file is application/json, text/plain or text/xml, the variables can be used. You can also use the property mime to control the mimetype-header.
  • log: Causes an log entry for the request data. The log will be choosed from the honeypot's main settings (e. g. into JSON)
  • camera returns an image as a response. Which image you want to use can be mappend in the config. Attention This will overwrite settings of response. If you name the folder like the route name, you can control which image will be served.

Action arguments

If an action needs one or more arguments, the route object itself will be extended by an sub object named by the action name. That means, you can use only one element of an action type per route.

Responses

The response field will only be used if the actions were successfully. If not, one or more actions may cause an 403 forbidden, for example.

Example

{
  '/authorize/': {
      'header': {
         'Server': 'lighthttpd 0.1'
      },
     'response: {
       status: 200,
       statusText: 'Ok',
       response: '$session'
     },
     'action: [
       'authorize',
       'log'
     ]
  },
  '/cam01/': {
     action: [
       'log',
       'camera'
     ]
  },
 '/file/': {
    'action': [
       'log',
       'servefile'
    ],
    servefile: {
       file: '/srv/foo.txt',
       mime: 'text/plain'
    }
 }
 '/update/': {
      'file': [
         'firmware'
      ],
      'header': {
         'Server': 'Apache2'
      },
     'response: {
       status: 200,
       statusText: 'Ok',
      response: 'Firmware upgraded successfully'
     },
     'action: [
       'authorize',
       'catchfile',
       'log'
     ]
  }
}
@cmllr cmllr added the enhancement New feature or request label Jan 30, 2018
@cmllr cmllr mentioned this issue Jan 30, 2018
@cmllr cmllr closed this as completed Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant