Merge branch 'master' into pypy-travis

This commit is contained in:
Michel Oosterhof 2019-09-12 12:14:34 +01:00 committed by GitHub
commit 65d60d7a9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 30 deletions

View File

@ -88,37 +88,32 @@ class command_tftp(HoneyPotCommand):
parser.add_argument("-p")
parser.add_argument("-r")
try:
args = parser.parse_args(self.args)
if args.c:
if len(args.c) > 1:
self.file_to_get = args.c[1]
if args.hostname is None:
self.exit()
self.hostname = args.hostname
args = parser.parse_args(self.args)
if args.c:
if len(args.c) > 1:
self.file_to_get = args.c[1]
if args.hostname is None:
self.exit()
return
self.hostname = args.hostname
elif args.r:
self.file_to_get = args.r
self.hostname = args.g
else:
self.write('usage: tftp [-h] [-c C C] [-l L] [-g G] [-p P] [-r R] [hostname]\n')
self.exit()
return
elif args.r:
self.file_to_get = args.r
self.hostname = args.g
else:
self.write('usage: tftp [-h] [-c C C] [-l L] [-g G] [-p P] [-r R] [hostname]\n')
self.exit()
return
if self.hostname is None:
self.exit()
return
if self.hostname is None:
self.exit()
return
if self.hostname.find(':') != -1:
host, port = self.hostname.split(':')
self.hostname = host
self.port = int(port)
self.makeTftpRetrieval()
except Exception as err:
log.err(str(err))
if self.hostname.find(':') != -1:
host, port = self.hostname.split(':')
self.hostname = host
self.port = int(port)
self.makeTftpRetrieval()
self.exit()

View File

@ -33,8 +33,8 @@ class ReconnectingConnectionPool(adbapi.ConnectionPool):
self, interaction, *args, **kw)
except MySQLdb.OperationalError as e:
if e[0] not in (2003, 2006, 2013):
log.msg("RCP: got error {0}, retrying operation".format(e))
raise e
log.msg("RCP: got error {0}, retrying operation".format(e))
conn = self.connections.get(self.threadID())
self.disconnect(conn)
# Try the interaction again

View File

@ -167,7 +167,7 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol, TimeoutMixin):
if path in self.commands:
return self.commands[path]
log.msg("Can't find command {}".format(path))
log.msg("Can't find command {}".format(cmd))
return None
def lineReceived(self, line):