@bontchev changes to MySQL logging

This commit is contained in:
Michel Oosterhof 2017-07-13 12:31:06 +00:00
parent 7277c75daf
commit 7659bcde8e
1 changed files with 8 additions and 1 deletions

View File

@ -155,7 +155,14 @@ class Output(cowrie.core.output.Output):
(entry["session"], entry["timestamp"], '%Y-%m-%dT%H:%i:%s.%fZ',
entry['url'], entry['outfile'], entry['shasum']))
elif entry["eventid"] == 'cowrie.session.file_download':
elif entry["eventid"] == 'cowrie.session.file_upload':
self.simpleQuery('INSERT INTO `downloads`' + \
' (`session`, `timestamp`, `url`, `outfile`, `shasum`)' + \
' VALUES (%s, STR_TO_DATE(%s, %s), %s, %s)',
(entry["session"], entry["timestamp"], '%Y-%m-%dT%H:%i:%s.%fZ',
'', entry['outfile'], entry['shasum']))
elif entry["eventid"] == 'cowrie.session.input':
self.simpleQuery('INSERT INTO `input`' + \
' (`session`, `timestamp`, `realm`, `input`)' + \
' VALUES (%s, STR_TO_DATE(%s, %s), %s , %s)',