From 79ac8ca29fee8ec79ba6a774e8ab876f6f89b06c Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Tue, 11 Nov 2014 20:56:52 +0400 Subject: [PATCH] move hostname setting to avatar. general direction to move settings to avatar --- kippo/core/protocol.py | 2 +- kippo/core/ssh.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kippo/core/protocol.py b/kippo/core/protocol.py index 706b7bd..2aa8ee2 100644 --- a/kippo/core/protocol.py +++ b/kippo/core/protocol.py @@ -23,7 +23,7 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol): def __init__(self, avatar, env): self.user = avatar self.env = env - self.hostname = self.env.cfg.get('honeypot', 'hostname') + self.hostname = avatar.hostname self.fs = avatar.fs if self.fs.exists(avatar.home): self.cwd = avatar.home diff --git a/kippo/core/ssh.py b/kippo/core/ssh.py index 67a401f..721ea9f 100644 --- a/kippo/core/ssh.py +++ b/kippo/core/ssh.py @@ -263,6 +263,7 @@ class HoneyPotAvatar(avatar.ConchUser): self.username = username self.env = env self.fs = fs.HoneyPotFilesystem(copy.deepcopy(self.env.fs)) + self.hostname = self.env.cfg.get('honeypot', 'hostname') self.channelLookup.update({'session': HoneyPotSSHSession}) self.channelLookup['direct-tcpip'] = KippoOpenConnectForwardingClient