Skip to content
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

Provide a default exclude list of 'bad' ip ranges #638

Open
reedjones opened this issue Dec 16, 2021 · 7 comments
Open

Provide a default exclude list of 'bad' ip ranges #638

reedjones opened this issue Dec 16, 2021 · 7 comments

Comments

@reedjones
Copy link

Not really a bug or issue but,

In the readme it says:

Scanning the entire Internet is bad. For one thing, parts of the Internet react badly to being scanned. For another thing, some sites track scans and add you to a ban list, which will get you firewalled from useful parts of the Internet. Therefore, you want to exclude a lot of ranges.

I'm wondering is there any known comprehensive list of 'bad' ip ranges?

I've found a few like this

Just wondering if there is any kind of official/comprehensive list?

@GodlyEcstasy
Copy link

Probably not. What are you trying to avoid? It appears most of the ranges in the URL you linked are government ranges.

@reedjones
Copy link
Author

Yeah that's the point. It says in readme that masscan can scan the whole internet but that you shouldn't. Trying to void getting on some blacklist for scanning some military network or something ;)

@reedjones
Copy link
Author

Note- In the nmap documentation it says that they do this (filter out 'bad' ranges) when the iR (random hosts) flag is set.
maybe something to look into

@yfdyh000
Copy link

yfdyh000 commented Mar 1, 2022

Note- In the nmap documentation it says that they do this (filter out 'bad' ranges) when the iR (random hosts) flag is set. maybe something to look into

See the https://nmap.org/book/host-discovery-specify-targets.html.

Nmap automatically skips certain undesirable IPs, such as those in private, multicast, or unallocated address ranges.

That's it.

@dingusgh
Copy link

dingusgh commented Mar 3, 2022

what IPs does nmap skip?
https://github.com/nmap/nmap/blob/master/libnetutil/netutil.cc#L427:L485

0.0.0.0/8 is IANA Reserved
127.0.0.0/8 Loopback
10.0.0.0/8 is reserved for private nets by RFC1918
169.254.0.0/16 is reserved for DHCP clients seeking addresses RFC3927
172.16.0.0/12 is reserved for private nets by RFC1918
192.0.2.0/24 is reserved for documentation and examples RFC5737
192.168.0.0/16 is reserved for private nets by RFC1918
192.88.99.0/24 is used as 6to4 Relay anycast prefix by RFC3068
198.18.0.0/15 is used for benchmark tests by RFC2544
198.51.100.0/24 is reserved for documentation RFC5737
203.0.113.0/24 is reserved for documentation RFC5737
224.0.0.0/4 is all multicast stuff
240.0.0.0/4 is IANA reserved

notably missing is 100.64.0.0/10 reserved for shared address space RFC6598
maybe I should submit a PR right ;)

see also https://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xhtml

@sickcodes
Copy link

ARIN Reserved IPv4 Address CIDR Blocks:
https://gist.github.com/sickcodes/5e72643852e301aac84cf34a0348ef09

0.0.0.0/8
0.0.0.0/32
10.0.0.0/8
100.64.0.0/10
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.0.0.0/24
192.0.0.0/29
192.0.0.8/32
192.0.0.9/32
192.0.0.10/32
192.0.0.170/32
192.0.0.171/32
192.0.2.0/24
192.31.196.0/24
192.52.193.0/24
192.88.99.0/24
192.168.0.0/16
192.175.48.0/24
198.18.0.0/15
198.51.100.0/24
203.0.113.0/24
240.0.0.0/4
255.255.255.255/32
tee -a myscan.conf <<EOF
excludefile = exclude.txt
EOF

masscan ... -c myscan.conf

@flotwig
Copy link

flotwig commented Apr 15, 2024

There's a suggested exclude.conf in the repo itself: https://github.com/robertdavidgraham/masscan/blob/master/data/exclude.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants