From 0757e057ae2ffd29fa7baec8e4dd31015e28c92a Mon Sep 17 00:00:00 2001 From: fe7ch Date: Fri, 27 Jan 2017 09:40:55 +0300 Subject: [PATCH] Prevent cowrie from crashing on invalid host for wget (#429) Thanks for submitting this! --- cowrie/commands/wget.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cowrie/commands/wget.py b/cowrie/commands/wget.py index f09de95..c24cdb4 100644 --- a/cowrie/commands/wget.py +++ b/cowrie/commands/wget.py @@ -142,6 +142,9 @@ class command_wget(HoneyPotCommand): path = parsed.path or '/' if scheme != 'http' and scheme != 'https': raise NotImplementedError + if not host: + self.exit() + return None except: self.write('%s: Unsupported scheme.\n' % (url,)) self.exit()