Added TinySSH support. Fixes #7.

This commit is contained in:
Joe Testa 2019-08-27 17:02:03 -04:00
parent 6846b1bf29
commit 747177c1c7

View File

@ -1206,6 +1206,7 @@ class SSH(object): # pylint: disable=too-few-public-methods
OpenSSH = 'OpenSSH' OpenSSH = 'OpenSSH'
DropbearSSH = 'Dropbear SSH' DropbearSSH = 'Dropbear SSH'
LibSSH = 'libssh' LibSSH = 'libssh'
TinySSH = 'TinySSH'
class Software(object): class Software(object):
def __init__(self, vendor, product, version, patch, os_version): def __init__(self, vendor, product, version, patch, os_version):
@ -1406,6 +1407,9 @@ class SSH(object): # pylint: disable=too-few-public-methods
if bool(mx): if bool(mx):
v, p = 'Cisco', 'IOS/PIX sshd' v, p = 'Cisco', 'IOS/PIX sshd'
return cls(v, p, mx.group(1), None, None) return cls(v, p, mx.group(1), None, None)
mx = re.match(r'^tinyssh_(.*)', software)
if bool(mx):
return cls(None, SSH.Product.TinySSH, mx.group(1), None, None)
return None return None
class Banner(object): class Banner(object):
@ -1675,7 +1679,8 @@ class SSH(object): # pylint: disable=too-few-public-methods
# pylint: disable=too-many-locals,too-many-statements # pylint: disable=too-many-locals,too-many-statements
vproducts = [SSH.Product.OpenSSH, vproducts = [SSH.Product.OpenSSH,
SSH.Product.DropbearSSH, SSH.Product.DropbearSSH,
SSH.Product.LibSSH] SSH.Product.LibSSH,
SSH.Product.TinySSH]
if software is not None: if software is not None:
if software.product not in vproducts: if software.product not in vproducts:
software = None software = None