remove dblog/texlog.

This commit is contained in:
Michel Oosterhof
2016-12-06 17:45:25 +00:00
parent 0bd9777f59
commit f4e65f570f
2 changed files with 2 additions and 58 deletions

View File

@@ -1,56 +0,0 @@
#
# this module uses the dblog feature to create a "traditional" looking logfile
# ..so not exactly a dblog.
#
from cowrie.core import dblog
import time
import uuid
class DBLogger(dblog.DBLogger):
def start(self, cfg):
self.outfile = file(cfg.get('database_textlog', 'logfile'), 'a')
def write(self, session, msg):
self.outfile.write('%s [%s]: %s\r\n' % \
(session, time.strftime('%Y-%m-%d %H:%M:%S'), msg))
self.outfile.flush()
def createSession(self, peerIP, peerPort, hostIP, hostPort):
sid = uuid.uuid4().hex
sensorname = self.getSensor() or hostIP
self.write(sid, 'New connection: %s:%s' % (peerIP, peerPort))
return sid
def handleConnectionLost(self, session, args):
self.write(session, 'Connection lost')
def handleLoginFailed(self, session, args):
self.write(session, 'Login failed [%s/%s]' % \
(args['username'], args['password']))
def handleLoginSucceeded(self, session, args):
self.write(session, 'Login succeeded [%s/%s]' % \
(args['username'], args['password']))
def handleCommand(self, session, args):
self.write(session, 'Command [%s]' % (args['input'],))
def handleUnknownCommand(self, session, args):
self.write(session, 'Unknown command [%s]' % (args['input'],))
def handleInput(self, session, args):
self.write(session, 'Input [%s] @%s' % (args['input'], args['realm']))
def handleTerminalSize(self, session, args):
self.write(session, 'Terminal size: %sx%s' % \
(args['width'], args['height']))
def handleClientVersion(self, session, args):
self.write(session, 'Client version: [%s]' % (args['version'],))
def handleFileDownload(self, session, args):
self.write(session, 'File download: [%s] -> %s with SHA-256 %s' % \
(args['url'], args['outfile'], args['shasum']))
# vim: set sw=4 et:

View File

@@ -3,7 +3,6 @@ import cowrie.core.output
from csirtgsdk.indicator import Indicator
from csirtgsdk.client import Client
from datetime import datetime
from pprint import pprint
import logging
import os
@@ -61,5 +60,6 @@ class Output(cowrie.core.output.Output):
logger.info('logged to csirtg %s ' % ret['indicator']['location'])
else:
pprint(self.context)
pass
self.context[today][peerIP].append(sid)