mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-18 14:34:22 +01:00
Add fake exit
git-svn-id: https://kippo.googlecode.com/svn/trunk@14 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -97,7 +97,8 @@ class command_echo(HoneyPotCommand):
|
|||||||
|
|
||||||
class command_quit(HoneyPotCommand):
|
class command_quit(HoneyPotCommand):
|
||||||
def call(self, args):
|
def call(self, args):
|
||||||
self.honeypot.terminal.loseConnection()
|
self.honeypot.writeln('Connection to server closed.')
|
||||||
|
self.honeypot.prompt = 'localhost:%(path)s# '
|
||||||
|
|
||||||
class command_clear(HoneyPotCommand):
|
class command_clear(HoneyPotCommand):
|
||||||
def call(self, args):
|
def call(self, args):
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class HoneyPotProtocol(recvline.HistoricRecvLine):
|
|||||||
self.env = env
|
self.env = env
|
||||||
self.cwd = '/root'
|
self.cwd = '/root'
|
||||||
self.fs = HoneyPotFilesystem(deepcopy(self.env.fs))
|
self.fs = HoneyPotFilesystem(deepcopy(self.env.fs))
|
||||||
|
self.prompt = 'sales:%(path)s# '
|
||||||
|
|
||||||
def connectionMade(self):
|
def connectionMade(self):
|
||||||
recvline.HistoricRecvLine.connectionMade(self)
|
recvline.HistoricRecvLine.connectionMade(self)
|
||||||
@@ -32,7 +33,10 @@ class HoneyPotProtocol(recvline.HistoricRecvLine):
|
|||||||
path = self.cwd
|
path = self.cwd
|
||||||
if path == '/root':
|
if path == '/root':
|
||||||
path = '~'
|
path = '~'
|
||||||
self.terminal.write('sales:%s# ' % path)
|
attrs = {
|
||||||
|
'path': path,
|
||||||
|
}
|
||||||
|
self.terminal.write(self.prompt % attrs)
|
||||||
|
|
||||||
def getCommandFunc(self, cmd):
|
def getCommandFunc(self, cmd):
|
||||||
return getattr(self, 'do_' + cmd, None)
|
return getattr(self, 'do_' + cmd, None)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ cmdl = {
|
|||||||
'/bin/cat': base.command_cat,
|
'/bin/cat': base.command_cat,
|
||||||
'/usr/bin/whoami': base.command_whoami,
|
'/usr/bin/whoami': base.command_whoami,
|
||||||
'quit': base.command_quit,
|
'quit': base.command_quit,
|
||||||
|
'exit': base.command_quit,
|
||||||
'/usr/bin/clear': base.command_clear,
|
'/usr/bin/clear': base.command_clear,
|
||||||
'/bin/rm': base.command_rm,
|
'/bin/rm': base.command_rm,
|
||||||
'/usr/bin/uptime': base.command_uptime,
|
'/usr/bin/uptime': base.command_uptime,
|
||||||
|
|||||||
Reference in New Issue
Block a user