mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-26 04:21:41 +01:00
Better packet parsing error output (e.g., protocol mismatch).
This commit is contained in:
parent
82a319f0e7
commit
f7cd4fd954
@ -280,6 +280,8 @@ class SSH(object):
|
|||||||
while self.unread_len < self.__block_size:
|
while self.unread_len < self.__block_size:
|
||||||
s, e = self.recv()
|
s, e = self.recv()
|
||||||
if s < 0:
|
if s < 0:
|
||||||
|
if e is None:
|
||||||
|
e = self.read(self.unread_len).strip()
|
||||||
return -1, e
|
return -1, e
|
||||||
header = self.read(self.__block_size)
|
header = self.read(self.__block_size)
|
||||||
if len(header) == 0:
|
if len(header) == 0:
|
||||||
@ -297,6 +299,8 @@ class SSH(object):
|
|||||||
while self.unread_len < rlen:
|
while self.unread_len < rlen:
|
||||||
s, e = self.recv()
|
s, e = self.recv()
|
||||||
if s < 0:
|
if s < 0:
|
||||||
|
if e is None:
|
||||||
|
e = (header + self.read(self.unread_len)).strip()
|
||||||
return -1, e
|
return -1, e
|
||||||
buf = self.read(rlen)
|
buf = self.read(rlen)
|
||||||
packet = rest[2:] + buf[0:packet_size - lrest]
|
packet = rest[2:] + buf[0:packet_size - lrest]
|
||||||
|
Loading…
Reference in New Issue
Block a user