From c68211b8e7066d276df380a7aaa20717288ec55f Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Wed, 7 Sep 2016 14:32:40 +0300 Subject: [PATCH] Wait for server banner, before sending client banner (fixes Cisco sshd). --- ssh-audit.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssh-audit.py b/ssh-audit.py index db802b7..e5ebaf5 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -280,6 +280,12 @@ class SSH(object): return self def get_banner(self): + rto = self.__sock.gettimeout() + self.__sock.settimeout(0.7) + s, e = self.recv() + self.__sock.settimeout(rto) + if s < 0: + return self.__banner, self.__header if self.__state < self.SM_BANNER_SENT: self.send_banner() while self.__banner is None: