From b4ef82081637e3aeafd736c58057bc83ee53c5db Mon Sep 17 00:00:00 2001 From: desaster Date: Thu, 26 Nov 2009 15:37:19 +0000 Subject: [PATCH] New command: history git-svn-id: https://kippo.googlecode.com/svn/trunk@83 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/base.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kippo/commands/base.py b/kippo/commands/base.py index cd9d84b2..29425281 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -281,16 +281,26 @@ class command_reboot(HoneyPotCommand): self.writeln('Connection to server closed.') self.honeypot.hostname = 'localhost' self.exit() - commands['/sbin/reboot'] = command_reboot +class command_history(HoneyPotCommand): + def call(self): + if len(self.args) and self.args[0] == '-c': + self.honeypot.historyLines = [] + self.honeypot.historyPosition = 0 + return + count = 1 + for l in self.honeypot.historyLines: + self.writeln(' %s %s' % (str(count).rjust(4), l)) + count += 1 +commands['history'] = command_history + class command_nop(HoneyPotCommand): def call(self): pass commands['/bin/chmod'] = command_nop commands['set'] = command_nop commands['unset'] = command_nop -commands['history'] = command_nop commands['export'] = command_nop commands['/bin/bash'] = command_nop commands['/bin/sh'] = command_nop