From c8b7523569e7f1d8b318adb146faaf4d2c05b51d Mon Sep 17 00:00:00 2001 From: Dave Germiquet Date: Sun, 19 Jun 2016 02:21:08 -0400 Subject: [PATCH] Fixed up sh -c so if its an invalid file it will display command not found (#192) --- cowrie/commands/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cowrie/commands/base.py b/cowrie/commands/base.py index 0184c14..024b971 100644 --- a/cowrie/commands/base.py +++ b/cowrie/commands/base.py @@ -497,6 +497,12 @@ class command_sh(HoneyPotCommand): if self.input_data: self.write(self.input_data) + else: + log.msg(eventid='cowrie.command.failed', + input=''.join(cmd), format='Command not found: %(input)s') + self.write('bash: %s: command not found\n' % (cmd)) + + commands['/bin/bash'] = command_sh commands['/bin/sh'] = command_sh