mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-18 14:34:22 +01:00
Added ability to add commands to the honeypot by adding a textfile in txtcmds/
git-svn-id: https://kippo.googlecode.com/svn/trunk@97 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
17
txtcmds/sbin/ifconfig
Normal file
17
txtcmds/sbin/ifconfig
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user