honeynet / beeswarm

Honeypot deployment made easy
GNU General Public License v3.0
237 stars 64 forks source link

Error 500, JSON type error when attempting to configure drone as honeypot w/ HTTP service #191

Closed andrew-morris closed 9 years ago

andrew-morris commented 9 years ago

First of all, thank you for creating this, and second of all, this might be a shitty bug report- it's literally the first bug report I've ever filled out.

The server seems to be hitting an exception when I attempt to configure my drone into a honeypot. The exception is raised the second I hit "generate" and the server raises a 500 error in my browser.

Here is the exception information-

XX.XX.XX.XX - - [2014-08-29 10:09:04] "GET /ws/drone/honeypot/configure/c0bf11b5-9648-4869-bd7a-c16a6a2aa547 HTTP/1.1" 200 20750 0.023269
2014-08-29 10:11:21,101 (beeswarm.server.webapp.app) Exception on /ws/drone/honeypot/configure/c0bf11b5-9648-4869-bd7a-c16a6a2aa547 [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 758, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/beeswarm/server/webapp/app.py", line 294, in configure_honeypot
    'banner': form.capabilities__http__protocol_specific_data__banner,
  File "/usr/local/lib/python2.7/dist-packages/beeswarm/server/db/entities.py", line 164, in add_capability
    capability = Capability(protocol=protocol, port=port, protocol_specific_data=json.dumps(protocol_specific_data))
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError:  is not JSON serializable
XX.XX.XX.XX - - [2014-08-29 10:11:21] "POST /ws/drone/honeypot/configure/c0bf11b5-9648-4869-bd7a-c16a6a2aa547 HTTP/1.1" 500 412 0.027596

I've figured out that this only happens when I try to enable the HTTP service with default settings

Both the server and the drone are running Ubuntu 12.04 and were built with no errors. Please let me know if there's any additional information I can provide.

andrew-morris commented 9 years ago

I noticed it also happens when attempting to enable SMTP. Confirmed that Telnet and FTP are functional though

johnnykv commented 9 years ago

Hi Andrew, good catch! Has just been fixed in 4.0.12 which can be upgraded from PYPI in 20 mins. Please reopen if not fixed.

andrew-morris commented 9 years ago

Fixed. Thanks!