diff --git a/kippo/commands/base.py b/kippo/commands/base.py index 3859c20..09cb500 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -306,5 +306,6 @@ commands['export'] = command_nop commands['/bin/bash'] = command_nop commands['/bin/sh'] = command_nop commands['/bin/kill'] = command_nop +commands['/bin/su'] = command_nop # vim: set sw=4 et: diff --git a/kippo/core/honeypot.py b/kippo/core/honeypot.py index ae040e1..9d728a2 100644 --- a/kippo/core/honeypot.py +++ b/kippo/core/honeypot.py @@ -152,6 +152,15 @@ class HoneyPotProtocol(recvline.HistoricRecvLine): def initializeScreen(self): self.setInsertMode() + def txtcmd(self, txt): + class command_txtcmd(HoneyPotCommand): + def call(self): + print 'Reading txtcmd from "%s"' % txt + f = file(txt, 'r') + self.write(f.read()) + f.close() + return command_txtcmd + def getCommand(self, cmd): if not len(cmd.strip()): return None @@ -168,6 +177,9 @@ class HoneyPotProtocol(recvline.HistoricRecvLine): if self.fs.exists(i): path = i break + txt = os.path.abspath('txtcmds/%s' % (path,)) + if os.path.exists(txt): + return self.txtcmd(txt) if path in self.commands: return self.commands[path] return None diff --git a/txtcmds/sbin/ifconfig b/txtcmds/sbin/ifconfig new file mode 100644 index 0000000..ba4c18c --- /dev/null +++ b/txtcmds/sbin/ifconfig @@ -0,0 +1,17 @@ +eth0 Link encap:Ethernet HWaddr 00:4c:a8:ab:32:f4 + inet addr:10.98.55.4 Bcast:10.98.55.255 Mask:255.255.255.0 + inet6 addr: fe80::21f:c6ac:fd44:24d7/64 Scope:Link + UP wROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:84045991 errors:0 dropped:0 overruns:0 frame:0 + TX packets:103776307 errors:0 dropped:0 overruns:0 carrier:2 + collisions:0 txqueuelen:1000 + RX bytes:50588302699 (47.1 GiB) TX bytes:97318807157 (90.6 GiB) + +lo Link encap:Local Loopback + inet addr:127.0.0.1 Mask:255.0.0.0 + inet6 addr: ::1/128 Scope:Host + UP LOOPBACK RUNNING MTU:16436 Metric:1 + RX packets:308297 errors:0 dropped:0 overruns:0 frame:0 + TX packets:308297 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:355278106 (338.8 MiB) TX bytes:355278106 (338.8 MiB)