The code for --resume in main.cc tries to parse a XML file by looking for the last occurrence of "<address addr=" and parsing what follows as an IPv4 address (inet_pton(AF_INET, found, &lastip)). The code for Grepable and Normal output files does something similar. In all cases, this will fail for IPv6 addresses. In the case of XML files, it will also fail for MAC addresses (test with --max-hostgroup 1 to make it easy to interrupt a local LAN scan).
We need to parse the command line of the original scan to determine the address family (-6 means IPv6) to use with inet_pton. Additionally, for XML, we need to check that the addrtype is not "mac".
The code for
--resumeinmain.cctries to parse a XML file by looking for the last occurrence of "<address addr=" and parsing what follows as an IPv4 address (inet_pton(AF_INET, found, &lastip)). The code for Grepable and Normal output files does something similar. In all cases, this will fail for IPv6 addresses. In the case of XML files, it will also fail for MAC addresses (test with--max-hostgroup 1to make it easy to interrupt a local LAN scan).We need to parse the command line of the original scan to determine the address family (
-6means IPv6) to use withinet_pton. Additionally, for XML, we need to check that theaddrtypeis not "mac".