def finish(self, line): self.honeypot.password_input = False if line != self.passwd or self.passwd == '*': self.writeln('Sorry, passwords do not match') self.exit() return userdb = UserDB() userdb.adduser(self.honeypot.user.username, self.honeypot.user.uid, self.passwd) self.writeln('passwd: password updated successfully') self.exit()
def finish(self, line): self.protocol.password_input = False if line != self.passwd or self.passwd == '*': self.writeln('Sorry, passwords do not match') self.exit() return userdb = UserDB() userdb.adduser(self.protocol.user.username, self.protocol.user.uid, self.passwd) self.writeln('passwd: password updated successfully') self.exit()
def finish(self, line): """ """ self.protocol.password_input = False if line != self.passwd or self.passwd == '*': self.write('Sorry, passwords do not match\n') self.exit() return userdb = UserDB(self.protocol.cfg) userdb.adduser(self.protocol.user.username, self.passwd) self.write('passwd: password updated successfully\n') self.exit()
def finish(self, line): """ """ self.protocol.password_input = False if line != self.passwd or self.passwd == "*": self.write("Sorry, passwords do not match\n") self.exit() return userdb = UserDB(self.protocol.cfg) userdb.adduser(self.protocol.user.username, self.passwd) self.write("passwd: password updated successfully\n") self.exit()
def __init__(self, username, server): avatar.ConchUser.__init__(self) self.username = username self.server = server self.cfg = self.server.cfg self.env = self.server.env self.protocol = None self.channelLookup.update({'session': HoneyPotSSHSession}) self.windowSize = [80, 24] self.channelLookup['direct-tcpip'] = CowrieOpenConnectForwardingClient # 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 = UserDB().getUID(self.username) if not self.uid: self.home = '/root' else: self.home = '/home/' + username