From 13d945d8dfba7962cf7e0d4fb9161e5faf08eb06 Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Thu, 8 Sep 2016 15:01:57 +0300 Subject: [PATCH] Fix: Do not hang, while reading banner. --- ssh-audit.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index 23a6a91..4ade242 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -415,9 +415,10 @@ class SSH(object): if self.__state < self.SM_BANNER_SENT: self.send_banner() while self.__banner is None: - s, e = self.recv() - if s < 0: - break + if not s > 0: + s, e = self.recv() + if s < 0: + break while self.__banner is None and self.unread_len > 0: line = self.read_line() if len(line.strip()) == 0: