Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

apache-ultimate-bad-bot-blocker

> 安全
Open source

Apache Block Bad Bots, (Referer) Spam Referrer Blocker, Vulnerability Scanners, Malware, Adware, Ransomware, Malicious Sites, Wordpress Theme Detectors and Fail

974 stars0 likes2 views
WebsiteGitHub

About

Apache Block Bad Bots, (Referer) Spam Referrer Blocker, Vulnerability Scanners, Malware, Adware, Ransomware, Malicious Sites, Wordpress Theme Detectors and Fail

REPO BECOME A SPONSOR
Your logo and link to your domain will appear here if you become a sponsor. Simply email me on [email protected] if you would like to sponsor this project as South Africa is not supported yet under the Github sponsor program.
Help Support Me at https://ko-fi.com/mitchellkrog

Apache Bad Bot and User-Agent Blocker, Spam Referrer Blocker, Bad IP Blocker and Wordpress Theme Detector Blocker

The Ultimate Apache (2.2 > 2.4+) Bad Bot, User-Agent, Spam Referrer Blocker, Adware, Malware and Ransomware Blocker, Clickjacking Blocker, Click Re-Directing Blocker, SEO Companies and Bad IP Blocker with Anti DDOS System, Nginx Rate Limiting and Wordpress Theme Detector Blocking. Stop and Block all kinds of bad internet traffic from ever reaching your web sites. PLEASE SEE: Definition of Bad Bots

Version: V3.2026.09.2726

Bad Referrer Count: 7115

Bad Bot Count: 699

Fake Googlebots: 218


  • Created by: https://github.com/mitchellkrogza
  • Copyright Mitchell Krog

Two Versions of the Blocker ? PLEASE TAKE NOTE :exclamation:

:exclamation:There are now two distinctly different versions of this blocker.:exclamation:

Apache 2.2 > 2.4+ (access_compat) [ TESTED ON APACHE 2.2 > 2.4.27 ]


A Version for Apache 2.2 > 2.4 + which requires the module access_compat and uses the older 
Order Allow,Deny Access Control Methods. 

This is the ORIGINAL VERSION of the blocker and is now located in the folder Apache_2.2 at:
https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/tree/master/Apache_2.2

Apache 2.4+ ONLY [ TESTED ON APACHE 2.4 > 2.4.34 ]


A new version for Apache 2.4+ only which uses new the Access Control Structures of 
 and . 

Anyone using Apache 2.4 should be using this new version as it fully complies with the new Access 
Control Methods of Apache and does not require the access_compat module to be loaded. 

This new version is at: 
https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/tree/master/Apache_2.4

For Support, Contributions & Idea Sharing

Please make sure you are subscribed to Github Notifications to be notified when the blocker is updated or when any important or mission critical (potentially breaking) changes may take place.

Also follow me on twitter @ubuntu101za

Help Support This Project


CONFIGURATION OF THE APACHE BAD BOT BLOCKER:

  • CPANEL Users read - https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/blob/master/_CPanel_Instructions/README.md
  • Users Unable to run the full Bot Blocker read - https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/blob/master/_htaccess_versions/README.md
  • Includes the creation of a google-exclude.txt file for creating filters / segments in Google Analytics (see instructions lower down)
  • Includes the creation of a google-disavow.txt file for use in Google Webmaster Tools (see instructions lower down)
  • Includes .htaccess and robots.txt files for users without root access to their Apache Servers.

COPY THE GLOBALBLACKLIST.CONF FILE FROM THE REPO $APACHE_CONF is generally located at /etc/apache2 or /etc/httpd depending on OS

Copy the contents of globalblacklist.conf into your $APACHE_CONF/custom.d folder. e.g. /etc/apache2/custom.d on Ubuntu/Debian /etc/httpd on RHEL/centos You need to create this folder.

The following directions use /etc/apache2 as an example.

sudo mkdir /etc/apache2/custom.d

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/globalblacklist.conf -O /etc/apache2/custom.d/globalblacklist.conf

If your Linux distribution does not have wget you can replace the wget commands using curl as follows:

curl -sL https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/globalblacklist.conf -o /etc/apache2/custom.d/globalblacklist.conf


WHITELIST ALL YOUR OWN DOMAIN NAMES AND IP ADDRESSES

Whitelist all your own domain names and IP addresses. Please note important changes, this is now done using include files so that you do not have to keep reinserting your whitelisted domains and IP addresses every time you update.

:exclamation: :exclamation: :exclamation: WARNING: Please do NOT ever use 127.0.0.1 as a whitelisted IP address in whitelist-ips.conf it will cause the blocker to stop functioning.

  • copy the whitelist-ips.conf file into that folder

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/whitelist-ips.conf -O /etc/apache2/custom.d/whitelist-ips.conf

  • copy the whitelist-domains.conf file into the same folder

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/whitelist-domains.conf -O /etc/apache2/custom.d/whitelist-domains.conf

Use nano, vim or any other text editor to edit both whitelist-ips.conf and whitelist-domains.conf to include all your own domain names and IP addresses that you want to specifically whitelist from the blocker script.

When pulling any future updates now you can simply pull the latest globalblacklist.conf file and it will automatically include your whitelisted domains and IP addresses. No more remembering having to do this yourself.


DOWNLOAD CUSTOM BLACKLIST INCLUDE FILE FOR IP ADDRESS AND IP RANGE BLOCKING

Blacklist any IP addresses or Ranges you wish to keep out of your servers. Please note important changes, this is now done using include files so that you have full control over what IP addresses and IP Ranges and blocked from your Apache Server.

  • copy the blacklist-ips.conf file into that folder

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/blacklist-ips.conf -O /etc/apache2/custom.d/blacklist-ips.conf

Use nano, vim or any other text editor to edit the blacklist-ips.conf file as you like.

When pulling any future updates now your custom IP blacklist will not be overwritten.


DOWNLOAD CUSTOM BAD REFERRER WORDS INCLUDE FILE FOR CUSTOMIZED SCANNING OF BAD WORDS

Scan for any bad referrer words you wish to keep out of your servers. Please note important changes, this is now done using include files so that you have full control over what IP addresses and IP Ranges and blocked from your Apache Server.

  • copy the bad-referrer-words.conf file into that folder

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/bad-referrer-words.conf -O /etc/apache2/custom.d/bad-referrer-words.conf

Use nano, vim or any other text editor to edit the bad-referrer-words.conf file as you like.

When pulling any future updates now your custom bad referrer words list will not be overwritten.


DOWNLOAD CUSTOM BLACKLIST USER-AGENTS INCLUDE FILE FOR CUSTOMIZED BLOCKING OF USER AGENTS

Allows you to add your own custom list of user agents with this new include file.

  • copy the blacklist-user-agents.conf file into that folder

sudo wget https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/Apache_2.2/custom.d/blacklist-user-agents.conf -O /etc/apache2/custom.d/blacklist-user-agents.conf

NOTE: On the Apache Blocker if you want to over-ride any of the whitelisted bots you can add them to this include file and the previously whitelisted bots in the blocker will be over-ridden by this include file. So let's say for some "obscure" reason you really do not want any search engines like Googlebot or Bingbot to ever access or index your site, you add them to your blacklist-user-agents.conf and they will be over-ridden from the earlier whitelisting in the blocker. This now gives users total control over the blocker without every having to try and modify the globalblacklist.conf file. So now you can customize all your include files and you can still pull the daily updates of globalblacklist.conf and it will not touch any of your custom include files.


INCLUDE THE GLOBALBLACKLIST.CONF

Include the globalblacklist.conf file in the beginning of a directory block just after your opening Options statements and before the rest of your host config example below. **Remove the " ServerName local.dev DocumentRoot /var/www/html ErrorLog /tmp/error.log

Options +Includes
Options +FollowSymLinks -Indexes
Include custom.d/globalblacklist.conf

You can include globalblacklist.conf globally (for all virtual hosts) if you put the following configuration after virtual host configuration.

GLOBAL! deny bad bots and IP addresses

should be set after s see https://httpd.apache.org/docs/2.4/sections.html#merging

# AND-combine with preceding configuration sections  
AuthMerging And
# include black list
Include custom.d/globalblacklist.conf
…

You can include globalblacklist.conf globally (for all virtual hosts) if you put the following configuration after virtual host configuration.

# ######################################
# GLOBAL! deny bad bots and IP addresses
# ######################################
#
# should be set after s see https://httpd.apache.org/docs/2.4/sections.html#merging

	# AND-combine with preceding configuration sections  
	AuthMerging And
	# include black list
	Include custom.d/globalblacklist.conf

TEST YOUR APACHE CONFIGURATION

Do an Apache2 Config Test

sudo apache2ctl configtest

If you get no errors then you followed my instructions so now you can make the blocker go live with a simple.

sudo service apache2 reload

or

sudo service httpd reload

The blocker is now active and working so now you can run some simple tests from another linux machine to make sure it's working.


TESTING*

Run the following commands one by one from a terminal on another linux machine against your own domain name. substitute yourdomain.com in the examples below with your REAL domain name

curl -A "googlebot" http://yourdomain.com

Should respond with 200 OK

curl -A "80legs" http://yourdomain.com

curl -A "masscan" http://yourdomain.com

Should respond with 403 Forbidden

curl -I http://yourdomain.com -e http://100dollars-seo.com

curl -I http://yourdomain.com -e http://zx6.ru

Should respond with 403 Forbidden

The Apache Ultimate Bot Blocker is now WORKING and PROTECTING your web sites !!!


**UPDATING THE APACHE BAD BOT BLOCK

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Capacheapache2bad-wordsbadwords

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.