win32 fixes

git-svn-id: https://kippo.googlecode.com/svn/trunk@43 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster
2009-11-21 19:50:25 +00:00
parent 675dbadaa0
commit f4e4445588
2 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ class command_cat(HoneyPotCommand):
realfile = self.fs.realfile(f,
'%s/%s' % (config.contents_path, path))
if realfile:
f = file(realfile, 'r')
f = file(realfile, 'rb')
self.write(f.read())
f.close()
commands['/bin/cat'] = command_cat
@@ -115,14 +115,14 @@ class command_uptime(HoneyPotCommand):
def call(self):
self.writeln(
' %s up 14 days, 3:53, 0 users, load average: 0.08, 0.02, 0.01' % \
time.strftime('%T'))
time.strftime('%H:%M:%S'))
commands['/usr/bin/uptime'] = command_uptime
class command_w(HoneyPotCommand):
def call(self):
self.writeln(
' %s up 14 days, 3:53, 0 users, load average: 0.08, 0.02, 0.01' % \
time.strftime('%T'))
time.strftime('%H:%M:%S'))
self.writeln('USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT')
commands['/usr/bin/w'] = command_w
commands['/usr/bin/who'] = command_w

View File

@@ -67,7 +67,7 @@ class command_wget(HoneyPotCommand):
time.strftime('%Y%m%d%H%M%S'),
re.sub('[^A-Za-z0-9]', '_', url))
self.deferred = self.download(url, outfile,
file(self.safeoutfile, 'w'))
file(self.safeoutfile, 'wb'))
if self.deferred:
self.deferred.addCallback(self.success)
self.deferred.addErrback(self.error, url)
@@ -78,7 +78,7 @@ class command_wget(HoneyPotCommand):
self.writeln('Sorry, SSL not supported in this release')
return None
self.writeln('--%s-- %s' % (time.strftime('%Y-%m-%d %T'), url))
self.writeln('--%s-- %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), url))
self.writeln('Connecting to %s:%d... connected.' % (host, port))
self.write('HTTP request sent, awaiting response... ')
@@ -182,7 +182,7 @@ class HTTPProgressDownloader(client.HTTPDownloader):
self.wget.honeypot.terminal.nextLine()
self.wget.writeln(
'%s (%d KB/s) - `%s\' saved [%d/%d]' % \
(time.strftime('%Y-%m-%d %T'),
(time.strftime('%Y-%m-%d %H:%M:%S'),
self.speed / 1000,
self.fakeoutfile, self.currentlength, self.totallength))
outfile = '%s/%s' % (self.wget.honeypot.cwd, self.fakeoutfile)