Wait for server banner, before sending client banner (fixes Cisco sshd).

This commit is contained in:
Andris Raugulis 2016-09-07 14:32:40 +03:00
parent 280a37ba20
commit c68211b8e7

View File

@ -280,6 +280,12 @@ class SSH(object):
return self return self
def get_banner(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: if self.__state < self.SM_BANNER_SENT:
self.send_banner() self.send_banner()
while self.__banner is None: while self.__banner is None: