def __init__(self, user, env): self.user = user self.env = env self.cwd = user.home self.hostname = self.env.cfg.get('honeypot', 'hostname') self.fs = fs.HoneyPotFilesystem(deepcopy(self.env.fs)) # commands is also a copy so we can add stuff on the fly self.commands = copy(self.env.commands) self.password_input = False self.cmdstack = []
def __init__(self, user, env, execcmd=None): self.user = user self.env = env self.execcmd = execcmd self.hostname = self.env.cfg.get('honeypot', 'hostname') self.fs = fs.HoneyPotFilesystem(copy.deepcopy(self.env.fs)) if self.fs.exists(user.home): self.cwd = user.home else: self.cwd = '/' # commands is also a copy so we can add stuff on the fly self.commands = copy.copy(self.env.commands) self.password_input = False self.cmdstack = []
def __init__(self, username, env): avatar.ConchUser.__init__(self) 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 # sftp support enabled only when option is explicitly set if self.env.cfg.has_option('honeypot', 'sftp_enabled'): if (self.env.cfg.get('honeypot', 'sftp_enabled') == "true"): self.subsystemLookup['sftp'] = filetransfer.FileTransferServer self.uid = self.gid = core.auth.UserDB().getUID(self.username) if not self.uid: self.home = '/root' else: self.home = '/home/' + username
def __init__(self, avatar): self.avatar = avatar # FIXME we should not copy fs here, but do this at avatar instantiation self.fs = fs.HoneyPotFilesystem(copy.deepcopy(self.avatar.env.fs))