mirror of https://github.com/cowrie/cowrie.git
Hpfeeds3 hex2 (#1350)
* use hex() rather than encode('hex') to avoid UTF parsing failures
This commit is contained in:
parent
53ddb8d7d7
commit
02e8e24493
|
@ -321,7 +321,7 @@ class Output(cowrie.core.output.Output):
|
|||
elif entry["eventid"] == 'cowrie.log.closed':
|
||||
# entry["ttylog"]
|
||||
with open(entry["ttylog"]) as ttylog:
|
||||
self.meta[session]['ttylog'] = ttylog.read().encode('hex')
|
||||
self.meta[session]['ttylog'] = ttylog.read().hex()
|
||||
|
||||
elif entry["eventid"] == 'cowrie.session.closed':
|
||||
log.msg('publishing metadata to hpfeeds')
|
||||
|
|
|
@ -107,7 +107,7 @@ class Output(cowrie.core.output.Output):
|
|||
elif entry["eventid"] == 'cowrie.log.closed':
|
||||
# entry["ttylog"]
|
||||
with open(entry["ttylog"]) as ttylog:
|
||||
self.meta[session]['ttylog'] = ttylog.read().encode('hex')
|
||||
self.meta[session]['ttylog'] = ttylog.read().hex()
|
||||
|
||||
elif entry["eventid"] == 'cowrie.session.closed':
|
||||
meta = self.meta.pop(session, None)
|
||||
|
|
|
@ -116,7 +116,7 @@ class Output(cowrie.core.output.Output):
|
|||
# ToDo Compress to opimise the space and if your sending to remote db
|
||||
with open(entry["ttylog"]) as ttylog:
|
||||
entry['ttylogpath'] = entry['ttylog']
|
||||
entry['ttylog'] = ttylog.read().encode('hex')
|
||||
entry['ttylog'] = ttylog.read().hex()
|
||||
self.insert_one(self.col_ttylog, entry)
|
||||
|
||||
elif eventid == 'cowrie.client.fingerprint':
|
||||
|
|
Loading…
Reference in New Issue