mirror of https://github.com/cowrie/cowrie.git
Merge branch 'master' into pypy-travis
This commit is contained in:
commit
65d60d7a9f
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue