diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py index 2df94a190..434dc35a7 100644 --- a/monkey_island/cc/resources/pthmap.py +++ b/monkey_island/cc/resources/pthmap.py @@ -204,9 +204,14 @@ class Machine(object): return None @cache - def GetInstalledServices(self): + def GetCriticalServicesInstalled(self): def IsNameOfCriticalService(name): - services = ("iis", "exchange", "active directory", "domain controller", "mssql") + services = ("W3svc", "MSExchangeServiceHost", "MSSQLServer") + services = map(string.lower, services) + + if not name: + return False + name = name.lower() for ser in services: @@ -217,6 +222,9 @@ class Machine(object): doc = self.latest_system_info found = [] + + if self.IsDomainController(): + found.append("Domain Controller") for product in doc["data"]["Win32_Product"]: service_name = eval(product["Name"]) @@ -787,6 +795,16 @@ class PassTheHashMap(object): return count + @cache + def GetCritialServers(self): + machines = set() + + for m in self.machines: + if m.IsCriticalServer(): + machines.add(m) + + return machines + def main(): pth = PassTheHashMap() @@ -875,6 +893,16 @@ def main(): print """{ip}{hostname}{domain}{path_count}""".format(ip=m.GetIp(), hostname=m.GetHostName(), domain=m.GetDomainName(), path_count=path_count) print """""" + print "

Critical Servers

" + print "

List of all machines identified as critical servers

" + critical_servers = pth.GetCritialServers() + + print """""" + print """""" + for m in critical_servers: + print """""".format(ip=m.GetIp(), hostname=m.GetHostName(), domain=m.GetDomainName()) + print """
IpHostnameDomain Name
{ip}{hostname}{domain}
""" + print "
" for m in pth.machines: @@ -911,7 +939,7 @@ def main(): print """

Installed Critical Services

""" print """

List of crtical services found installed on machine

""" print """"""