From 0dcd4c2091be616dc40e43ecb096debc4419e23e Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Tue, 29 Dec 2015 12:22:37 +0000 Subject: [PATCH] catch AttributeError in exit() --- cowrie/core/honeypot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cowrie/core/honeypot.py b/cowrie/core/honeypot.py index 2ee11db..51a11f9 100644 --- a/cowrie/core/honeypot.py +++ b/cowrie/core/honeypot.py @@ -80,9 +80,12 @@ class HoneyPotCommand(object): """ Sometimes client is disconnected and command exits after. So cmdstack is gone """ - if self.protocol.cmdstack: + try: self.protocol.cmdstack.pop() self.protocol.cmdstack[-1].resume() + except AttributeError: + # cmdstack could be gone already (wget + disconnect) + pass def handle_CTRL_C(self):