MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / hostname

Method hostname

pager_lib/nmap/nmap.py:979–995  ·  view source on GitHub ↗

For compatibility purpose... :returns: try to return the user record or the first hostname of the list hostnames

(self)

Source from the content-addressed store, hash-verified

977 return self["hostnames"]
978
979 def hostname(self):
980 """
981 For compatibility purpose...
982 :returns: try to return the user record or the first hostname of the list hostnames
983
984 """
985 hostname = ""
986 for h in self["hostnames"]:
987 if h["type"] == "user":
988 return h["name"]
989 else:
990 if len(self["hostnames"]) > 0 and "name" in self["hostnames"][0]:
991 return self["hostnames"][0]["name"]
992 else:
993 return ""
994
995 return hostname
996
997 def state(self):
998 """

Callers 2

run_nmap_network_scanMethod · 0.80
deep_scan_hostMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected