From f6665ab796ee5de1c17ebaa612f4cfd9e2b3b148 Mon Sep 17 00:00:00 2001 From: desaster Date: Wed, 30 Jun 2010 06:28:00 +0000 Subject: [PATCH] Revert command module loading change until fixed git-svn-id: https://kippo.googlecode.com/svn/trunk@151 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/__init__.py | 14 ++++++++++++++ kippo/core/honeypot.py | 4 +--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 kippo/commands/__init__.py diff --git a/kippo/commands/__init__.py b/kippo/commands/__init__.py new file mode 100644 index 0000000..cf40a4b --- /dev/null +++ b/kippo/commands/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2009 Upi Tamminen +# See the COPYRIGHT file for more information + +__all__ = [ + 'base', + 'ls', + 'ping', + 'ssh', + 'tar', + 'wget', + 'apt', + 'dice', + 'adduser', + ] diff --git a/kippo/core/honeypot.py b/kippo/core/honeypot.py index e9687ca..447d2bb 100644 --- a/kippo/core/honeypot.py +++ b/kippo/core/honeypot.py @@ -375,9 +375,7 @@ class HoneyPotEnvironment(object): self.cfg = config() self.commands = {} import kippo.commands - modules = [x[:-3] for x in os.listdir('kippo/commands') if \ - x.endswith('.py') and x[0] not in '._'] - for c in modules: + for c in kippo.commands.__all__: module = __import__('kippo.commands.%s' % c, globals(), locals(), ['commands']) self.commands.update(module.commands)