After doing the homework suggested by Magic Banana, I tried out his well thought out one-line solution, substituting
the prefix for a representative multi-addressed PTR record (2a02:120b):

$ prefix=2a02:120b ; od -A x -N 786432 -xw12 /dev/urandom | tr ' ' : | sed s/^/$prefix/

The time to run this script, which produces 65,536 complete IPv6 addresses ready for analysis, is 0.000 second CPU time & 0.000 second real time, even when run four times at once.

It appears not to produce any "000x", "00xx" or "0xxx" fields, which do occur in real IPv6 addresses.

"-A x" means hexadecimal notation throughout; "-N 786432" means number of bytes output; and "-xw12" means six, four-character hexadecimal fields. Together, these arguments gather sufficient bytes of random data from
/dev/urandom to fill the 3rd through 8th fields of 65,536 IPv6 addresses.

Putting it all together with our nmap script and an enumeration script:

prefix=2a02:120b ; od -A n -N 786432 -xw12 /dev/urandom | tr ' ' : | sed s/^/$prefix/ > TempMB4320A.txt ; nmap -6 -sn -T4 -sL -iL TempMB4320A.txt | grep "Nmap scan report for " - | tr -d '()' | sort -k5 | awk 'NR >= 1 { print $5, $6 }' | awk 'NR >= 1 { print $2, $1 }' | uniq -Df 1 | sed '/^\s\s*/d' | awk '{ print $2 "\t" $1 }' > TempMB4320B.txt ; awk '{print $2,$1}' 'TempMB4320B.txt' | sort -k 2 | uniq -cdf 1 | awk '{print $3"\t"$1}' '-' > Multi-IPv6-MB-dynamic.wline.6rd.res.cust.swisscom.ch-Tally.txt | awk '{print $3"\t"$1}' '-' > Multi-IPv6-MB-dynamic.wline.6rd.res.cust.swisscom.ch-Tally.txt ;
rm TempMB4320A.txt TempMB4320B.txt

Final output file: dynamic.wline.6rd.res.cust.swisscom.ch       65536

Giving a similar answer in about six minutes that my other scripts took 58 hours to complete when run on 508 IPv6 addresses: All the IPv6 addresses have the same dig -x result, even when randomly generated rather
than hunted down with Internet searches.

Reply via email to