Magic Banana wisely suggested:

> You can redirect the output of any command (including 'nmap') to a file.
> Append "&> file_name" (without the quotes and with the file name of your choice) to the command line,
> to redirect what it writes on both the standard and the error outputs.

That teenie little ampersand (&) is the key:

sudo nmap -sS -p3389 -T4 --max-retries 8 --script asn-query -iL FTR-UnresolvedHNs.txt &> HNs-nMap-testlist.txt
==> only "Failed to Resolve" in output file

sudo nmap -sS -p3389 -T4 --max-retries 8 --script asn-query -iL HNs-nMap-MixedList.txt &> HNs-nMap-MixedOutput.txt
==> Failed to resolve" listed first. OK !
[I randomized the list from among the first list and a "selection" that was accidentally all resolved]

The original list of hostnames had 22 thousand lines and took nMap over three hours to process.

Note in passing: The IPv4 addresses that were not (for whatever reason) converted by the server software to hostnames is much longer and equally productive of useful data. I wish there could be a scripted way of separating the two populations into two lists. Manually, it's very tedious.

George Langford

Reply via email to