From 122588cb0031559ac5ad0012f01a77dc93ca3ed8 Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Tue, 5 Jan 2016 14:10:48 +0200 Subject: [PATCH] Better compression handling. --- ssh-audit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index 14a0a42..f10546d 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -272,9 +272,12 @@ def process_algorithm(alg_type, alg_name, alg_max_len=0): f(' ' * len(prefix + alg_name) + padding + ' `- ' + text) def process_kex(kex): - state = 'zlib@openssh.com' in kex.server.compression - state = 'enabled' if state else 'disabled' - out.good('[info] compression is ' + state) + compressions = [x for x in kex.server.compression if x != 'none'] + if len(compressions) > 0: + cmptxt = 'enabled ({0})'.format(', '.join(compressions)) + else: + cmptxt = 'disabled' + out.good('[info] compression is ' + cmptxt) ml = lambda l: max(len(i) for i in l) maxlen = max(ml(kex.kex_algorithms), ml(kex.key_algorithms),