mirror of https://github.com/cowrie/cowrie.git
Have ping ignore command line options
git-svn-id: https://kippo.googlecode.com/svn/trunk@92 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
ab137b2751
commit
70f20d600f
|
@ -9,7 +9,13 @@ commands = {}
|
|||
|
||||
class command_ping(HoneyPotCommand):
|
||||
def start(self):
|
||||
if not len(self.args):
|
||||
self.host = None
|
||||
for arg in self.args:
|
||||
if not arg.startswith('-'):
|
||||
self.host = arg.strip()
|
||||
break
|
||||
|
||||
if not self.host:
|
||||
for l in (
|
||||
'Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]',
|
||||
' [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]',
|
||||
|
@ -20,7 +26,6 @@ class command_ping(HoneyPotCommand):
|
|||
self.exit()
|
||||
return
|
||||
|
||||
self.host = self.args[0]
|
||||
if re.match('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$',
|
||||
self.host):
|
||||
self.ip = self.host
|
||||
|
|
Loading…
Reference in New Issue