From f0707842d5fdfdad8b461b9be6820b48afaac32b Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Wed, 12 Nov 2014 17:17:49 +0000 Subject: [PATCH] add uname -r support --- kippo/commands/__init__.py | 1 + kippo/commands/base.py | 10 ---------- kippo/commands/uname.py | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 kippo/commands/uname.py diff --git a/kippo/commands/__init__.py b/kippo/commands/__init__.py index 43592e7..7ded995 100644 --- a/kippo/commands/__init__.py +++ b/kippo/commands/__init__.py @@ -13,6 +13,7 @@ __all__ = [ 'adduser', 'sleep', 'last', + 'uname', 'fs', 'malware', ] diff --git a/kippo/commands/base.py b/kippo/commands/base.py index 71bfaef..a0d97eb 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -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 diff --git a/kippo/commands/uname.py b/kippo/commands/uname.py new file mode 100644 index 0000000..21227d4 --- /dev/null +++ b/kippo/commands/uname.py @@ -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 +