mirror of https://github.com/cowrie/cowrie.git
To simplify customization, load kippo/commands/*.py using a directory listing
git-svn-id: https://kippo.googlecode.com/svn/trunk@149 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
aee8bc4d20
commit
d8b1b0df63
|
@ -1,15 +0,0 @@
|
|||
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
|
||||
# See the COPYRIGHT file for more information
|
||||
|
||||
__all__ = [
|
||||
'base',
|
||||
'ls',
|
||||
'ping',
|
||||
'ssh',
|
||||
'tar',
|
||||
'wget',
|
||||
'apt',
|
||||
'dice',
|
||||
'adduser',
|
||||
'last',
|
||||
]
|
|
@ -375,7 +375,9 @@ class HoneyPotEnvironment(object):
|
|||
self.cfg = config()
|
||||
self.commands = {}
|
||||
import kippo.commands
|
||||
for c in kippo.commands.__all__:
|
||||
modules = [x[:-3] for x in os.listdir('kippo/commands') if \
|
||||
x.endswith('.py') and x[0] not in '._']
|
||||
for c in modules:
|
||||
module = __import__('kippo.commands.%s' % c,
|
||||
globals(), locals(), ['commands'])
|
||||
self.commands.update(module.commands)
|
||||
|
|
Loading…
Reference in New Issue