From 7659bcde8e0b7f07fec52664fbfd673a1c518802 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Thu, 13 Jul 2017 12:31:06 +0000 Subject: [PATCH] @bontchev changes to MySQL logging --- cowrie/output/mysql.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cowrie/output/mysql.py b/cowrie/output/mysql.py index 2676a47c..34ef2264 100644 --- a/cowrie/output/mysql.py +++ b/cowrie/output/mysql.py @@ -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)',