add uname -r support

This commit is contained in:
Michel Oosterhof
2014-11-12 17:17:49 +00:00
parent 5ed7b390d3
commit f0707842d5
3 changed files with 20 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ __all__ = [
'adduser',
'sleep',
'last',
'uname',
'fs',
'malware',
]

View File

@@ -82,16 +82,6 @@ class command_hostname(HoneyPotCommand):
self.writeln(self.honeypot.hostname)
commands['/bin/hostname'] = command_hostname
class command_uname(HoneyPotCommand):
def call(self):
if len(self.args) and self.args[0].strip() in ('-a', '--all'):
self.writeln(
'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686 GNU/Linux' % \
self.honeypot.hostname)
else:
self.writeln('Linux')
commands['/bin/uname'] = command_uname
class command_ps(HoneyPotCommand):
def call(self):
user = self.honeypot.user.username

19
kippo/commands/uname.py Normal file
View File

@@ -0,0 +1,19 @@
#
from kippo.core.honeypot import HoneyPotCommand
commands = {}
class command_uname(HoneyPotCommand):
def call(self):
if len(self.args) and self.args[0].strip() in ('-a', '--all'):
self.writeln(
'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686 GNU/Linux' % \
self.honeypot.hostname)
elif len(self.args) and self.args[0].strip() in ('-r', '--kernel-release'):
self.writeln( '2.6.26-2-686' )
else:
self.writeln('Linux')
commands['/bin/uname'] = command_uname