diff --git a/cowrie/insults/insults.py b/cowrie/insults/insults.py index 6e760754..4de8e705 100644 --- a/cowrie/insults/insults.py +++ b/cowrie/insults/insults.py @@ -98,7 +98,7 @@ class LoggingServerProtocol(insults.ServerProtocol): return if self.stdinlog_open: - with file(self.stdinlog_file, 'ab') as f: + with open(self.stdinlog_file, 'ab') as f: f.write(data) elif self.ttylog_open: ttylog.ttylog_write(self.ttylog_file, len(data), diff --git a/cowrie/ssh/userauth.py b/cowrie/ssh/userauth.py index 3bcd50f6..b5f5a342 100644 --- a/cowrie/ssh/userauth.py +++ b/cowrie/ssh/userauth.py @@ -48,7 +48,7 @@ class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer): try: honeyfs = self.portal.realm.cfg.get('honeypot', 'contents_path') issuefile = honeyfs + "/etc/issue.net" - data = file(issuefile).read() + data = open(issuefile).read() except IOError: return if not data or not len(data.strip()):