From 2328bd56620baa6e3bb97e52e1a4b1596442b9db Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Sun, 6 Nov 2016 23:00:48 +0400 Subject: [PATCH] Fix #320 --- cowrie/commands/ping.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cowrie/commands/ping.py b/cowrie/commands/ping.py index ec4382d5..52eb2b88 100644 --- a/cowrie/commands/ping.py +++ b/cowrie/commands/ping.py @@ -52,9 +52,7 @@ class command_ping(HoneyPotCommand): self.exit() return - self.host = args[0].strip() - - if not self.host: + if len(args)==0: for l in ( 'Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]', ' [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]', @@ -64,6 +62,7 @@ class command_ping(HoneyPotCommand): self.write(l+'\n') self.exit() return + self.host = args[0].strip() if re.match('^[0-9.]+$', self.host): if self.valid_ip(self.host):