Fix TTL split logic

This commit is contained in:
Daniel Goldberg 2019-01-26 20:11:38 +02:00
parent c572e515a1
commit 151ec3dbc9
1 changed files with 2 additions and 2 deletions

View File

@ -59,10 +59,10 @@ class PingScanner(HostScanner, HostFinger):
if regex_result: if regex_result:
try: try:
ttl = int(regex_result.group(0)) ttl = int(regex_result.group(0))
if (ttl > LINUX_TTL) and (ttl <= WINDOWS_TTL):
host.os['type'] = 'windows'
if ttl <= LINUX_TTL: if ttl <= LINUX_TTL:
host.os['type'] = 'linux' host.os['type'] = 'linux'
else: # as far we we know, could also be OSX/BSD but lets handle that when it comes up.
host.os['type'] = 'windows'
return True return True
except Exception as exc: except Exception as exc:
LOG.debug("Error parsing ping fingerprint: %s", exc) LOG.debug("Error parsing ping fingerprint: %s", exc)