* exit and ssh should reset cwd

* More kippo.cfg options: contents_path, public_key, private_key


git-svn-id: https://kippo.googlecode.com/svn/trunk@55 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster 2009-11-23 14:45:48 +00:00
parent ff1579f6fe
commit 97256e45f6
4 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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):

View File

@ -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' % \

View File

@ -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: