mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Merge branch 'master' into pypy-travis
This commit is contained in:
@ -88,37 +88,32 @@ class command_tftp(HoneyPotCommand):
|
|||||||
parser.add_argument("-p")
|
parser.add_argument("-p")
|
||||||
parser.add_argument("-r")
|
parser.add_argument("-r")
|
||||||
|
|
||||||
try:
|
args = parser.parse_args(self.args)
|
||||||
args = parser.parse_args(self.args)
|
if args.c:
|
||||||
if args.c:
|
if len(args.c) > 1:
|
||||||
if len(args.c) > 1:
|
self.file_to_get = args.c[1]
|
||||||
self.file_to_get = args.c[1]
|
if args.hostname is None:
|
||||||
if args.hostname is None:
|
self.exit()
|
||||||
self.exit()
|
return
|
||||||
self.hostname = args.hostname
|
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:
|
if self.hostname is None:
|
||||||
self.file_to_get = args.r
|
self.exit()
|
||||||
self.hostname = args.g
|
return
|
||||||
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:
|
if self.hostname.find(':') != -1:
|
||||||
self.exit()
|
host, port = self.hostname.split(':')
|
||||||
return
|
self.hostname = host
|
||||||
|
self.port = int(port)
|
||||||
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))
|
|
||||||
|
|
||||||
|
self.makeTftpRetrieval()
|
||||||
self.exit()
|
self.exit()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,8 +33,8 @@ class ReconnectingConnectionPool(adbapi.ConnectionPool):
|
|||||||
self, interaction, *args, **kw)
|
self, interaction, *args, **kw)
|
||||||
except MySQLdb.OperationalError as e:
|
except MySQLdb.OperationalError as e:
|
||||||
if e[0] not in (2003, 2006, 2013):
|
if e[0] not in (2003, 2006, 2013):
|
||||||
log.msg("RCP: got error {0}, retrying operation".format(e))
|
|
||||||
raise e
|
raise e
|
||||||
|
log.msg("RCP: got error {0}, retrying operation".format(e))
|
||||||
conn = self.connections.get(self.threadID())
|
conn = self.connections.get(self.threadID())
|
||||||
self.disconnect(conn)
|
self.disconnect(conn)
|
||||||
# Try the interaction again
|
# Try the interaction again
|
||||||
|
|||||||
@ -167,7 +167,7 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol, TimeoutMixin):
|
|||||||
if path in self.commands:
|
if path in self.commands:
|
||||||
return self.commands[path]
|
return self.commands[path]
|
||||||
|
|
||||||
log.msg("Can't find command {}".format(path))
|
log.msg("Can't find command {}".format(cmd))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def lineReceived(self, line):
|
def lineReceived(self, line):
|
||||||
|
|||||||
Reference in New Issue
Block a user