nmap extend timeout
@@ -52,6 +52,7 @@ class Nmap(GenericUnixCommand):
:return: None
"""
if is_full_line:
+ self._parse_extend_timeout(line)
try:
self._parse_error(line)
self._parse_ports_line(line)
@@ -148,6 +149,15 @@ class Nmap(GenericUnixCommand):
self.current_ret["SKIPPING_HOST"]["HOST"].append(self._regex_helper.group("HOST"))
raise ParsingDone
+ # UDP Scan Timing: About 61.09% done; ETC: 14:18 (0:21:04 remaining)
+ _re_extend_timeout = re.compile(r"\((?P<HOURS>\d+):(?P<MINUTES>\d+):(?P<SECONDS>\d+)\s+remaining\)")
+
+ def _parse_extend_timeout(self, line):
+ if self._regex_helper.search_compiled(Nmap._re_extend_timeout, line):
+ timedelta = int(self._regex_helper.group("HOURS")) * 3600 + int(self._regex_helper.group("MINUTES"))\
+ * 60 + int(self._regex_helper.group("SECONDS"))
+ self.extend_timeout(timedelta=timedelta)
+
COMMAND_OUTPUT_host_up = """
root@cp19-nj:/home/ute# nmap -d1 -p- -S 192.168.255.126 192.168.255.129 -PN
