robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.
GNU Affero General Public License v3.0
23.18k stars 3.04k forks source link

Feature to Scan ASN Number #385

Open Labs22 opened 5 years ago

Labs22 commented 5 years ago

Hey can you add a feature to scan the ASN number?

p-l- commented 5 years ago

As for #368, I'll use this opportunity for some shameless promotion.

You can use IVRE and run: ivre runscans --output ListCIDRs --asnum XXXXX > ASNum-XXXXX (the list is generated based on Maxmind GeoIP databases).

Then, just run masscan -iL ASNum-XXXXX.

Hope this helps.

Labs22 commented 5 years ago

This really help me a lot. thank you very much I'm in loving with IoT search engine. I've been using shodan, censys, zoomeye and now Ivre.

Rokin05 commented 5 years ago
ASNUM="XXXXXX"
whois -h whois.ripe.net -T route $ASNUM -i origin | egrep "route: " | awk '{print $NF}' >> MYASIP.TXT 
p-l- commented 5 years ago

@Rokin05 good point, thanks for this hint! (but you should try IVRE anyway ;-) )

You have (I think) an error: you need to add AS before $ASNUM: whois -h whois.ripe.net -T route AS$ASNUM [...] (at least, I had to do so). Also, you could use awk directly and remove egreg:

ASNUM="XXXXXX"
whois -h whois.ripe.net -T route AS$ASNUM -i origin | awk '/^route:/ {print $NF}' > MYASIP.TXT