New command: date - thanks adnan!

git-svn-id: https://kippo.googlecode.com/svn/trunk@114 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster 2010-06-01 04:34:53 +00:00
parent 7381375811
commit f28a852518
1 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# 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