add working sleep command

This commit is contained in:
Michel Oosterhof 2014-11-12 16:56:37 +04:00
parent 6b07bb2784
commit 5ed7b390d3
3 changed files with 25 additions and 0 deletions

View File

@ -11,6 +11,7 @@ __all__ = [
'apt',
'dice',
'adduser',
'sleep',
'last',
'fs',
'malware',

24
kippo/commands/sleep.py Normal file
View File

@ -0,0 +1,24 @@
from twisted.internet import reactor
from kippo.core.honeypot import HoneyPotCommand
commands = {}
'''sleep'''
class command_sleep(HoneyPotCommand):
def done(self):
self.exit()
def start(self):
if len(self.args) == 1:
_time = int( self.args[0] )
self.scheduled = reactor.callLater(_time, self.done)
else:
self.writeln('usage: sleep seconds')
self.exit()
commands['/bin/sleep'] = command_sleep
# vim: set sw=4 et tw=0:

View File