mirror of https://github.com/desaster/kippo.git
* 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:
parent
ff1579f6fe
commit
97256e45f6
|
@ -3,5 +3,5 @@ ssh_port = 2222
|
||||||
hostname = sales
|
hostname = sales
|
||||||
log_path = log
|
log_path = log
|
||||||
download_path = dl
|
download_path = dl
|
||||||
contents_dir = honeyfs
|
contents_path = honeyfs
|
||||||
filesystem_file = fs.pickle
|
filesystem_file = fs.pickle
|
||||||
|
|
|
@ -24,7 +24,7 @@ class command_cat(HoneyPotCommand):
|
||||||
f = self.fs.getfile(path)
|
f = self.fs.getfile(path)
|
||||||
|
|
||||||
realfile = self.fs.realfile(f,
|
realfile = self.fs.realfile(f,
|
||||||
'%s/%s' % (config().contents_path, path))
|
'%s/%s' % (config().get('honeypot', 'contents_path'), path))
|
||||||
if realfile:
|
if realfile:
|
||||||
f = file(realfile, 'rb')
|
f = file(realfile, 'rb')
|
||||||
self.write(f.read())
|
self.write(f.read())
|
||||||
|
@ -138,6 +138,7 @@ class command_exit(HoneyPotCommand):
|
||||||
self.honeypot.terminal.reset()
|
self.honeypot.terminal.reset()
|
||||||
self.writeln('Connection to server closed.')
|
self.writeln('Connection to server closed.')
|
||||||
self.honeypot.hostname = 'localhost'
|
self.honeypot.hostname = 'localhost'
|
||||||
|
self.honeypot.cwd = '/root'
|
||||||
commands['exit'] = command_exit
|
commands['exit'] = command_exit
|
||||||
|
|
||||||
class command_clear(HoneyPotCommand):
|
class command_clear(HoneyPotCommand):
|
||||||
|
|
|
@ -47,6 +47,7 @@ class command_ssh(HoneyPotCommand):
|
||||||
if len(rest) and rest[0].isalpha():
|
if len(rest) and rest[0].isalpha():
|
||||||
host = rest[0]
|
host = rest[0]
|
||||||
self.honeypot.hostname = host
|
self.honeypot.hostname = host
|
||||||
|
self.honeypot.cwd = '/root'
|
||||||
self.honeypot.password_input = False
|
self.honeypot.password_input = False
|
||||||
self.writeln(
|
self.writeln(
|
||||||
'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686' % \
|
'Linux %s 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686' % \
|
||||||
|
|
|
@ -296,8 +296,9 @@ def getRSAKeys():
|
||||||
file('private.key', 'w+b').write(privateKeyString)
|
file('private.key', 'w+b').write(privateKeyString)
|
||||||
print "done."
|
print "done."
|
||||||
else:
|
else:
|
||||||
publicKeyString = file('public.key').read()
|
cfg = config()
|
||||||
privateKeyString = file('private.key').read()
|
publicKeyString = file(cfg.get('honeypot', 'public_key')).read()
|
||||||
|
privateKeyString = file(cfg.get('honeypot', 'private_key')).read()
|
||||||
return publicKeyString, privateKeyString
|
return publicKeyString, privateKeyString
|
||||||
|
|
||||||
# vim: set sw=4 et:
|
# vim: set sw=4 et:
|
||||||
|
|
Loading…
Reference in New Issue