Scrapers, Bots and Probers Oh My!

The "Web" has become a smorgasboard for data scrapers, AI bots, vulnerability probers, site rippers and those who wish to do your site harm in some way or another. It doesn't matter if it is a simple niche site like The Guitar Gallery, they blindly grab as much as they can as fast as they can. They couldn't care less if their activity buries your site in unwanted traffic or completely skews and pollutes your site analytics. They simply want to make money freeloading off of you, the small site owner or worse commandeer your site for their on nefarious purposes.

It is estimated that nearly 50% of all web traffic is generated by these jerks. Sure, you can deny them in robots.txt but the reality is most do not retrieve it much less obey it. It's not just that "guy in the dark basement chugging Redbull" that does this. Facebook, Amazon, Google Cloud, Huawei Cloud, Tencent, Microsoft, Apple, Akamai and MANY other "big ones" do the same. Using a robots.txt is quite simply an exercise in futility.

Most shared hosting companies do not block or discourage this kind of activity. As a matter of fact the greedier hosting companies WELCOME it! They use it as leverage to push you into more expensive hosting plans such as Managed Hosting or Bare Metal. This is simply not an option for a small site owner, especially if it solely supported by the site owner. They are only concerned with the safety of THEIR hosting platform, NOT your site.

I have tried a number of hosting companies such as Webline, A2 Hosting, Hosting.com and IONOS. Their support was akin to what you'd get when you have a problem with your cheapie Hong Kong Phooey router. Understanding the words coming out of their mouths is another thing entirely. The last I used was the US based IONOS and it was their WordPress specific hosting plan. Twice they did something on the back end that broke something on the site. They have NO helpdesk ticket system or support email address, only a phone number and we're back to trying to translate gibberish into English. Their response both times was to "Contact WordPress" for support. Needless to say I told them AMF.

Some time back I moved a number of my other domains to Hawk Host and I could not be more impressed or say enough good about them. Not only is the hosting top notch but their support is intelligent, knowledgeable and responsive. Several times now they have bent over backwards to help me solve an issue and never once told me to "Go Fish." In addition they have never tried to upsell me using the bots as leverage. Their security is another thing. They actually know how to use Imunify360 and already block a number of the worst of the worst. When I moved to them I noticed a marked decrease in unwanted traffic.

Combating these jerks is not easy but can be done. They are getting smarter and smarter all the time. Simply blocking by user agent or IP by themselves is not enough. Some switch user agents from one hit to the next. Some are now using anonymizng VPNs (Virtual Private Networks) to circumvent countermeasures. Blocking single IPs is pointless as there are so many of them. I block entire CIDRs (groups if IP addresses ranging from just a few IPs to as many as a million IPs) and in some cases I've blocked ALL the CIDRs associated with a hosting/cloud company if I see too many different IP connections from their service. You will NOT stop them all and keeping up with them requires regular monitoring. However you can block the majority with some work and some simple .htaccess file rules.

I use a two pronged approach. First by user agent and the second by denying CIDRs. Here are the two supported by Apache 2.4. I use comments to tell me what hosting/cloud service or other reason I used for the block. Comments begin with a "#" symbol. However I should say this is and will be an ongoing process and requires regular monitoring to be even partially effective. Here are a few examples:

Blocking CIDRs. The first in this example blocks 65,536 IPs in a SINGLE line. I used huawei cloud as an example as they brought down my forums on three different occasions with incessant rapid fire connections and cost me bandwidth.

# huawei cloud incessant connections
Require not ip 1.92.0.0/16
Require not ip 1.94.0.0/18
Require not ip 1.94.64.0/20

Blocking by user agent. This .htaccess directive ignores case and looks for only the portion of the user agent you specify. If found they get the boot.

BrowserMatchNoCase "dwnupd" badagent
BrowserMatchNoCase "ASPscan" badagent
BrowserMatchNoCase "WellKnownBot" badagent
BrowserMatchNoCase "ImageBot" badagent
BrowserMatchNoCase "HubSpot" badagent
BrowserMatchNoCase "WPMU" badagent
BrowserMatchNoCase "Baiduspider" badagent
BrowserMatchNoCase "baidu.com" badagent
Deny from env=badagent

I also block VPNs known to be used by bad actors however there are some legitimate users who use these VPNs for privacy reasons. I cannot specify by single IP address and if it is an anonymizing VPN the IP can change quickly. As a result I block ALL VPNs known to be used by bad actors. There is ZERO need to use a VPN here, this site collects no data other than the Apache/Litespeed access logs which EVERY SITE DOES. No other data is collected so a VPN is pointless here. I do specify the reasons should a connection get blocked in my 403.shtml file (the page shown when an access is denied) to inform legitimate visitors as to why they were blocked allowing them to turn off the VPN for this site. Unfortunately I cannot allow all VPN connections for the sake of one or a few. For every legitimate VPN connection there are hundreds attempting malicious activity.

Another thing I block is outdated browser versions. Not only because script kiddie bots often report old browser versions but keeping a browser up to date with the latest security fixes is indispensable. Make no mistake, the web is a dangerous place and you are NOT paranoid if you think they are out to get you. SOME ARE. Using a fork of say Firefox or Chrome that does NOT keep its core up to the latest stable patch level is not wise, I don't care what the "benefits" are. I allow two versions back (usually no more than two months old) but it stops there.

403 = Forbidden!
This may also occur if you are using an outdated version of your browser.
This site supports no more than two version back. Anything older is out of date and rejected.
Bots and hackers report older user agents.

This means Chrome 150 and older, Firefox 152 and older and Edge 149 and older.

If you are using a fork of Chrome or Firefox that does NOT keep it's core up to date
with the latest security fixes I suggest switching browsers to something that does.
For your own safety update your browser!

If you're a bot you get the boot.

If you're using a hosting or cloud service to connect you get the boot.

If you're using an anonymizing VPN service you're in the company of bad actors hiding their origin and get the boot.
Abusive site scrapers have now begun using VPNs or similar to hide their origin in order to circumvent blocking measures.
We do NOT collect any data other than server access logs (as does everywhere). There is no need here.
For every legitimate VPN connection there are hundreds attempting malicious activity. You get the idea.

Or you are attempting to access content you're not allowed access to.


Hotlinking or direct image scraping is another issue that can can also quickly bring an image rich site such as forums hosting many images or a photography site to its knees in no time. I won't cover that here but there is hotlink protection of some kind in nearly all hosting control panels such as cPanel.

In conclusion bots are getting smarter and smarter every day and with the increasing number of AI bots blocking them has become time consuming work. It takes daily monitoring of accesses and adjustments made daily to be effective. Owning and managing a site is work, there's no way around that. Doing so effectively can be a lot of work.