From 70f20d600f9fb4de2a3a07f781c674f2c2a04485 Mon Sep 17 00:00:00 2001 From: desaster Date: Fri, 4 Dec 2009 05:45:58 +0000 Subject: [PATCH] Have ping ignore command line options git-svn-id: https://kippo.googlecode.com/svn/trunk@92 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/ping.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kippo/commands/ping.py b/kippo/commands/ping.py index 988edd8c..6aa1c277 100644 --- a/kippo/commands/ping.py +++ b/kippo/commands/ping.py @@ -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