New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Hostname / IP address from scan host #1226

Open
drwetter opened this Issue May 25, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@drwetter

drwetter commented May 25, 2018

Hi,

I often encounter situations where I scan from different hosts, for several reasons. For later correlation and sustainable logging it would be great to have an option to tell nmap to log the hostname (and IP address) where the scan was started from in the output files -- e.g. in the runstats summary or at the beginning like

Nmap done on host YYY at Fri May 25...
Nmap A.B.C scan initiated on host YYY Fri May 25...

Cheers, Dirk

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented May 29, 2018

That's an interesting idea. The hostname would be difficult to get in a cross-platform way, but we could add the source IP address to each target. It wouldn't be for the entire scan, because different routes may exist on the scanner resulting in a different source address for some targets.

Preemptively shutting down a possible alternative suggestion: we won't add a way to annotate a scan with freeform text, because you can either use the filename or edit the file afterwards to add that.

@drwetter

This comment has been minimized.

drwetter commented Jun 3, 2018

IP would totally sufficient.

I am a friend of reproducibility and logging the conditions under which the scan took place would be awesome

@sandguardian

This comment has been minimized.

sandguardian commented Jun 24, 2018

Does nmap return hostname of each host in local network?
XML output has hostnames child, but it doesn't contain any data.

I couldn't get hostnames on Ubuntu and Raspbian.

@fyodor

This comment has been minimized.

fyodor commented Jun 26, 2018

@sandguardian perhaps those hosts on the local network don't have reverse DNS? That is how Nmap gets the host names. So make sure you don't use -n, which skips those DNS checks. Also use the -R option if you want rDNS checks even for "hosts" which aren't up and available on the network.

@sandguardian

This comment has been minimized.

sandguardian commented Jun 29, 2018

@fyodor Could you share the cmd?
I used sudo nmap -sn 192.168.2.*
With -R option it got stucked.

@fyodor

This comment has been minimized.

fyodor commented Jul 3, 2018

@sandguardian yes, your command will take a lot longer with -R. Especially if you are not running as root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment