honeynet / beeswarm

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

Decoding exception when persisting sessions, #200

Closed johnnykv closed 10 years ago

johnnykv commented 10 years ago

Seems related to SSH sessions

2014-09-09 18:02:06,971 (beeswarm.server.db.session_persister) Received message from publisher
2014-09-09 18:02:06,971 (beeswarm.server.db.session_persister) Persisting SESSION_CLIENT session: {u'destination_ip': u'192.168.1.147', u'did_connect': True, u'protocol': u'smtp', u'protocol_data': {}, u'did_complete': True, u'timestamp': u'2014-09-09T16:02:01.839304', u'source_ip': u'192.168.1.147', u'alldone': True, u'login_attempts': [{u'username': u'1234', u'successful': True, u'timestamp': u'2014-09-09T16:02:01.886251', u'auth': u'plaintext', u'password': u'', u'id': u'9cc1a1b3-8396-4256-8ac7-4c3d00e9e883'}], u'transcript': [], u'client_id': u'427c9119-b1b4-4a5a-be97-ffb519d4288c', u'source_port': 49769, u'honeypot_id': u'5975569b-ca64-4394-abdb-d5784493a63c', u'destination_port': 2525, u'did_login': True, u'id': u'1dbd731d-d1fc-4fbe-a2bb-8ebc90276a65'}
2014-09-09 18:02:06,975 (beeswarm.server.misc.config_actor) Received command: GET
2014-09-09 18:02:07,073 (beeswarm.server.server) Received SESSION_HONEYPOT message from 5975569b-ca64-4394-abdb-d5784493a63c.
2014-09-09 18:02:07,079 (beeswarm.server.db.session_persister) Received message from publisher
Traceback (most recent call last):
  File "/Users/jkv/virtualenv/beeswarm/lib/python2.7/site-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/jkv/repos/beeswarm/beeswarm/server/db/session_persister.py", line 68, in _run
    self.persist_session(session_json, topic)
  File "/Users/jkv/repos/beeswarm/beeswarm/server/db/session_persister.py", line 71, in persist_session
    data = json.loads(session_json)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 24: invalid continuation byte
<SessionPersister at 0x10a4ea690> failed with UnicodeDecodeError
johnnykv commented 10 years ago

fixed with ad4ca18817ed5e15f00fa1c4417400a71eeb84cf