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

Method listscan

pager_lib/nmap/nmap.py:181–199  ·  view source on GitHub ↗

do not scan but interpret target hosts and return a list a hosts

(self, hosts="127.0.0.1")

Source from the content-addressed store, hash-verified

179 return (self._nmap_version_number, self._nmap_subversion_number)
180
181 def listscan(self, hosts="127.0.0.1"):
182 """
183 do not scan but interpret target hosts and return a list a hosts
184 """
185 assert (
186 type(hosts) is str
187 ), f"Wrong type for [hosts], should be a string [was {type(hosts)}]"
188 output = self.scan(hosts, arguments="-sL")
189 # Test if host was IPV6
190 if (
191 "scaninfo" in output["nmap"]
192 and "error" in output["nmap"]["scaninfo"]
193 and len(output["nmap"]["scaninfo"]["error"]) > 0
194 and "looks like an IPv6 target specification"
195 in output["nmap"]["scaninfo"]["error"][0]
196 ): # noqa
197 self.scan(hosts, arguments="-sL -6")
198
199 return self.all_hosts()
200
201 def scan( # NOQA: CFQ001, C901
202 self, hosts="127.0.0.1", ports=None, arguments="-sV", sudo=False, timeout=0

Callers 2

__scan_progressive__Function · 0.80
scanMethod · 0.80

Calls 2

scanMethod · 0.95
all_hostsMethod · 0.95

Tested by

no test coverage detected