do not scan but interpret target hosts and return a list a hosts
(self, hosts="127.0.0.1")
| 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 |
no test coverage detected