diff --git a/commands/base.py b/commands/base.py index e1cf352..0f6909a 100644 --- a/commands/base.py +++ b/commands/base.py @@ -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 diff --git a/commands/wget.py b/commands/wget.py index 3d16260..54edcd8 100644 --- a/commands/wget.py +++ b/commands/wget.py @@ -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)