From b8effe14627b7087d4c63ca35f461cd445bbb13d Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Thu, 8 Sep 2016 14:06:36 +0300 Subject: [PATCH] Better output for OpenSSH patch-level. --- ssh-audit.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index 0fa1764..52c4e73 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -242,8 +242,14 @@ class SSH(object): out += self.product if self.version: out += ' {0}'.format(self.version) - if self.patch: - out += ' {0}'.format(self.patch) + patch = self.patch + if self.product == 'OpenSSH': + mx = re.match('^(p\d)(.*)$', self.patch) + if mx is not None: + out += mx.group(1) + patch = mx.group(2).strip() + if patch: + out += ' ({0})'.format(self.patch) if self.os: out += ' running on {0}'.format(self.os) return out