How to block Shodan scanners

Shodan is a search engine which does not index web sites or web contents, but vulnerable devices on the internet. To set up this index an to keep it up to date, Shodan uses at least 16 scanners with different AS numbers and different physical locations.

In case you want to block those scanners, this guide might help.

Set up host definitions

First, set up host definitions in the firewall menue and put in the following hosts (it might be useful to put in the rDNS name as a hostname):

Known Shodan scanners (last updated 2019-09-08)

rDNS name IP address Location ((it is unclear if this is a scanner IP)) US US US US NL RO US US US US IS IS US DE DE DE US US US US US ((it is unclear if this is a scanner IP)) US US ((it is unclear if this is a scanner IP)) US

The additional following entries have been added on September, 2019:

rDNS name IP address Location SC SC SC (PTR only) SC RO SC (PTR only) US SC US (PTR only) RO SC (PTR only) US

Sources: own research, log reviews.

Contributor Note!
if you DROP ranges that were in the notorious "AS29073 Quasi Networks LTD" already, you're already banning the "SC" (Seychelles) sources detailed above; those ranges have been inherited by AS202425. "AS9009 M247 Ltd" contributes to most of the "RO" (Romania) sources; furtherly M247 (AS9009) seem to be the exit point of most NordVPN/pureVPN and many low cost script-kiddies VPN. Firewalling them is usefull for `quietness. Interactions between shodan and m247 seems to be very close.

You might add a comment to each host, such as "scanner" or "shodan" to make clear why you added those.

It is possible to block other common scanners here, too. However, please keep in mind that this isn't a technique which is very scalable. Please consider running an IPS, if possible.

Project 25499 scanners (last updated 2016-02-28)

rDNS name IP address Location US US US US US


Set up firewall group

Second, set up a firewall group and add all those host entries to it. Add a title and a comment to this firewall group. In this guide, we assume you have named the group "shodanscanners".

Set up firewall rule

Third, create a new firewall rule. Set the "shodanscanners" group as source. For destination, use "standard networks" and set this to "any". Set "rule action" to "drop".

The setting "reject" is not recommended here, since the firewall will send an ICMP status message to the host(s) which triggered the firewall rule. By this, however, the host knows that there is something which at least sends ICMP errors back. To avoid this, "drop" is suitable because the network packets will be dropped silently and there is no way of telling (without additional scans) wether the target IP address is just down or drops network packages.

Enter a comment, if you want to and hit "add" to set the new firewall rule.

Please make sure that this rule is placedbefore rules which accept something (i.e. port forwarding rules) so that shodan scan traffic will be blocked instantly.

Reload the firewall engine to apply the new rule.

Limitations of this guide

Nobody (and nothing) is perfect. This guide isn't either. ;-)

For example, if the IP addresses of the Shodan scanners change, your firewall rule will be probably useless and does not provide any protection against the scanners any more. Consider setting up an IPS for additional protection since some rules there will also block other scanners which are not mentioned here.

Blocking Shodan scanner is fine, but I want to block all scanners
This is basically possible. However, it is a nightmare to set up a firewall host group which covers all IPs which belong to scanners. (And it is also a nightmare to find out those IP addresses since most scanners do not just put them on their web sites...) In case you are thinking similar, setting up an IPS in combination with suitable rules (this is just one example, there are many out there) might be a solution for you.

Edit Page ‐ Yes, you can edit!

Older Revisions • December 16 at 10:30 am • hidden avenger ;-)