Skip to content

Nmap --resume gets confused by IPv6 and MAC addresses #1680

Description

@dmiller-nmap

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions