1
0
mirror of https://github.com/jtesta/ssh-audit.git synced 2025-07-05 21:42:49 -05:00

Gracefully handle rare exceptions (i.e.: crashes) while performing GEX tests.

This commit is contained in:
Joe Testa
2024-02-17 13:44:06 -05:00
parent a958fd1fec
commit 699739d42a
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
import struct
import traceback
# pylint: disable=unused-import
@ -65,7 +66,7 @@ class GEXTest:
# Parse the server's KEX.
_, payload = s.read_packet(2)
SSH2_Kex.parse(out, payload)
except KexDHException:
except (KexDHException, struct.error):
out.v("Failed to parse server's kex. Stack trace:\n%s" % str(traceback.format_exc()), write_now=True)
return False