New command: history

git-svn-id: https://kippo.googlecode.com/svn/trunk@83 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster 2009-11-26 15:37:19 +00:00
parent 1508f60838
commit b4ef820816
1 changed files with 12 additions and 2 deletions

View File

@ -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