From f28a85251874eeceda34373c021ab58bc7e52e97 Mon Sep 17 00:00:00 2001 From: desaster Date: Tue, 1 Jun 2010 04:34:53 +0000 Subject: [PATCH] New command: date - thanks adnan! git-svn-id: https://kippo.googlecode.com/svn/trunk@114 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kippo/commands/base.py b/kippo/commands/base.py index 7656368e..342817eb 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -1,7 +1,7 @@ # Copyright (c) 2009 Upi Tamminen # See the COPYRIGHT file for more information -import os, time, anydbm +import os, time, anydbm, datetime from kippo.core.honeypot import HoneyPotCommand from kippo.core.fs import * from twisted.internet import reactor @@ -300,6 +300,12 @@ class command_touch(HoneyPotCommand): self.fs.mkfile(path, 0, 0, 0, 33188) commands['/bin/touch'] = command_touch +class command_date(HoneyPotCommand): + def call(self): + time = datetime.datetime.utcnow(); + self.writeln(time.strftime("%a %b %d %H:%M:%S UTC %Y")) +commands['/bin/date'] = command_date + class command_nop(HoneyPotCommand): def call(self): pass