Can nMap be made to work with IPv6 addresses in a file ?

2 replies [Last post]
amenex
Offline
Joined: 01/03/2015

Starting with this essential command:
> time awk < IPv4.txt '{ print $2"\t"}' - | sudo nmap -6 -T4 --max-retries 8 - > Intm.IPv4.txt

Take my word for it: Works great, no hassles, but time-consuming for the computer; typically
about a minute for each address in the file, which generally is several thousand fields in length.

Now introduce the Modern Age:

> time awk < Question-2Col-IPv6.txt '{ print $2"\t"}' - | sudo nmap -6 -T4 --max-retries 8 - > Intm.Question-2Col-IPv6.txt

Not so great; here's the response, truncated greatly:

>> setup_target: failed to determine route to 2a0d:7c40:3000:98c::2
>> WARNING: No targets were specified, so 0 hosts scanned.

I tried simplification:

> time sudo nmap -6 -iL Question-IPv6.txt > Intm.Question-IPv6.txt

One-at-a-time might work, but there are thousands to be scanned.

The first file has a column $1 that represents a count of the number of instances in the dataset
and a column $2 of IPv6 addresses; there aren't any hostnames in this dataset, which is the point
of my exercise.

The second file is a simplified version with only a single column of some typical IPv6 addreses.

There aren't many Recent Visitors found with my searches that have IPv6 addresses, but there surely
will be ... have to be ready for those ! I used nslookup on a few with decidedly mixed results.; nMap
does much better with recalcitrant IPv4 addresses in datasets which have not had their IPv4 addresses
gratuitously converted to [unresolvable] hostnames.

George Langford

AttachmentSize
Question-2Col-IPv6.txt214 bytes
Question-IPv6.txt171 bytes
amenex
Offline
Joined: 01/03/2015

martinh's link points to Hurricane Electric's free tunnel broker service. Alas, HE's IPv6 service is indescribably
slow; three minutes for 2a07:3b80:0:d95b:68a9:5368:c459:7072 (no servers), even longer for 2a05:7cc0:0:185:80:130:250:1
(same, but nslookup finds it right away), HE timed out before answering a third IPv6 lookup.

Try nslookup instead:

time awk < IPv6.download.fumuga.com.txt '{ print $2"\t"}' - | nslookup - > IntmNL.IPv6.download.fumuga.com.txt
Took 32 seconds real time to examine 109 fields in the source file; fourteen hostnames found.

nMap has been doing much better than nslookup for the IPv4 addresses; of three that have finished since I started the
thirteen scripts two days ago, all three completed the scans of all the fields in their lists and have found their
hosts to be operating.

AttachmentSize
IPv6.download.fumuga.com_.txt 3.04 KB
Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

Just mentioning that, assuming the trailing tabs are useless (I guess they are), your can replace
awk < IPv4.txt '{ print $2"\t"}' -
with
cut -f 2 IPv4.txt

That will make no difference, except that if anybody (including yourself) gets back to the command, (s)he will more easily understand it is simply selecting the second column.