move hostname setting to avatar. general direction to move settings to avatar

This commit is contained in:
Michel Oosterhof
2014-11-11 20:56:52 +04:00
parent a66f8c92cd
commit 79ac8ca29f
2 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol):
def __init__(self, avatar, env): def __init__(self, avatar, env):
self.user = avatar self.user = avatar
self.env = env self.env = env
self.hostname = self.env.cfg.get('honeypot', 'hostname') self.hostname = avatar.hostname
self.fs = avatar.fs self.fs = avatar.fs
if self.fs.exists(avatar.home): if self.fs.exists(avatar.home):
self.cwd = avatar.home self.cwd = avatar.home

View File

@ -263,6 +263,7 @@ class HoneyPotAvatar(avatar.ConchUser):
self.username = username self.username = username
self.env = env self.env = env
self.fs = fs.HoneyPotFilesystem(copy.deepcopy(self.env.fs)) self.fs = fs.HoneyPotFilesystem(copy.deepcopy(self.env.fs))
self.hostname = self.env.cfg.get('honeypot', 'hostname')
self.channelLookup.update({'session': HoneyPotSSHSession}) self.channelLookup.update({'session': HoneyPotSSHSession})
self.channelLookup['direct-tcpip'] = KippoOpenConnectForwardingClient self.channelLookup['direct-tcpip'] = KippoOpenConnectForwardingClient