agent: add icmp property to VictimHost

Keep track of whether or not PingScanner was successful by storing a
boolean in VictimHost objects. This information is communicated back to
the Monkey Island via telemetry.
This commit is contained in:
Mike Salvatore 2021-02-02 11:00:59 -05:00
parent 458e01cf24
commit c7a1f246cb
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ class VictimHost(object):
self.domain_name = str(domain_name) self.domain_name = str(domain_name)
self.os = {} self.os = {}
self.services = {} self.services = {}
self.icmp = False
self.monkey_exe = None self.monkey_exe = None
self.default_tunnel = None self.default_tunnel = None
self.default_server = None self.default_server = None
@ -40,7 +41,7 @@ class VictimHost(object):
victim += "] Services - [" victim += "] Services - ["
for k, v in list(self.services.items()): for k, v in list(self.services.items()):
victim += "%s-%s " % (k, v) victim += "%s-%s " % (k, v)
victim += '] ' victim += '] ICMP: %s ' % (self.icmp)
victim += "target monkey: %s" % self.monkey_exe victim += "target monkey: %s" % self.monkey_exe
return victim return victim

View File

@ -62,6 +62,9 @@ class PingScanner(HostScanner, HostFinger):
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. else: # as far we we know, could also be OSX/BSD but lets handle that when it comes up.
host.os['type'] = 'windows' host.os['type'] = 'windows'
host.icmp = True
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)