diff --git a/kippo.cfg.dist b/kippo.cfg.dist index 0851833..b26c103 100644 --- a/kippo.cfg.dist +++ b/kippo.cfg.dist @@ -3,5 +3,5 @@ ssh_port = 2222 hostname = sales log_path = log download_path = dl -contents_dir = honeyfs +contents_path = honeyfs filesystem_file = fs.pickle diff --git a/kippo/commands/base.py b/kippo/commands/base.py index 595f031..ce5d7ca 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -24,7 +24,7 @@ class command_cat(HoneyPotCommand): f = self.fs.getfile(path) realfile = self.fs.realfile(f, - '%s/%s' % (config().contents_path, path)) + '%s/%s' % (config().get('honeypot', 'contents_path'), path)) if realfile: f = file(realfile, 'rb') self.write(f.read()) @@ -138,6 +138,7 @@ class command_exit(HoneyPotCommand): self.honeypot.terminal.reset() self.writeln('Connection to server closed.') self.honeypot.hostname = 'localhost' + self.honeypot.cwd = '/root' commands['exit'] = command_exit class command_clear(HoneyPotCommand): diff --git a/kippo/commands/ssh.py b/kippo/commands/ssh.py index 6bfe2bf..ba17c4b 100644 --- a/kippo/commands/ssh.py +++ b/kippo/commands/ssh.py @@ -47,6 +47,7 @@ class command_ssh(HoneyPotCommand): if len(rest) and rest[0].isalpha(): host = rest[0] self.honeypot.hostname = host + self.honeypot.cwd = '/root' self.honeypot.password_input = False self.writeln( 'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686' % \ diff --git a/kippo/core/honeypot.py b/kippo/core/honeypot.py index c76f7a4..09b704d 100644 --- a/kippo/core/honeypot.py +++ b/kippo/core/honeypot.py @@ -296,8 +296,9 @@ def getRSAKeys(): file('private.key', 'w+b').write(privateKeyString) print "done." else: - publicKeyString = file('public.key').read() - privateKeyString = file('private.key').read() + cfg = config() + publicKeyString = file(cfg.get('honeypot', 'public_key')).read() + privateKeyString = file(cfg.get('honeypot', 'private_key')).read() return publicKeyString, privateKeyString # vim: set sw=4 et: