剑庭安
首页
黑客安全首页全部安全栏目 黑客技术黑客技术、渗透测试、漏洞利用工具与教程 安全软件安全工具、扫描器、检测与审计软件 病毒分析恶意软件分析、样本、逆向与沙箱 CTF思路CTF 题目、writeup、解题思路与工具 防护思路防御技术、加固、检测响应与蓝队 红蓝攻防红队攻击模拟、蓝队对抗、攻防演练 漏洞知识库漏洞、CVE、PoC、EXP 与安全研究
逆向|反编译
PHP源码PHP 网站源码、程序、系统 APP源码安卓/iOS APP 源码 ASP源码ASP 网站源码与程序 NET源码.NET 网站源码与系统 小程序源码微信/支付宝小程序源码 Dedecms风格模板Dedecms 织梦风格模板 Empirecms风格模板EmpireCMS 帝国风格模板 Discuz商业模板/插件Discuz 商业模板与插件 WordPress主题/插件WordPress 主题与插件 其它源码、模板其它各类源码与模板 游戏源码游戏源码与引擎项目 加密货币源码加密货币、区块链、钱包、USDT/比特币相关源码与工具 手游源码手机游戏源码、服务端、客户端与引擎项目 传奇源码热血传奇、传奇世界、复古传奇等客户端/服务端/引擎源码 页游源码网页游戏、H5 游戏、浏览器游戏源码 端游源码电脑单机游戏、PC 网游客户端/服务端源码
最新万能免驱动支持所有型号打印机下载程序 日历天气老黄历 · 每天同步真实日期与天气
站长工具站长工具 自助开通会员浏览该分类 其他资源qtziy SEO工具SEO工具 站群源码站群源码 泛程序泛程序 蜘蛛模板蜘蛛模板 蜘蛛池蜘蛛池 外链工具外链工具
搜索 自助开通会员🔓 破甲 API
登录 注册
首页 分类列表 安全软件 nginx-ultimate-bad-bot-block…
安全软件
作者:admin 发布:2026-10-05

nginx-ultimate-bad-bot-blocker - Nginx Block Bad Bots, Spam Referrer Blocker, Vulne

项目说明<img src=" alt="Nginx Ultimate Bad Bot Spam Referrer Blocker - Nginx Block Bad Bots, Scanners, Malware and Adware, Malicious Sites, S…
资源可下载 免费下载 0 条讨论
会员资源
开通会员后即可下载全部资源。
登录后开通会员
会员方案
511浏览量
0讨论
2下载链接
可下载资源状态
内容可验证
更新 2026-10-05
人工审核发布
评论区答疑

项目说明

<img src=" alt="Nginx Ultimate Bad Bot Spam Referrer Blocker - Nginx Block Bad Bots, Scanners, Malware and Adware, Malicious Sites, Spam Referrers, Bad Referrers, Spam Blocker with DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders"/>

<!--<table>
<tr><th colspan=2>SPONSORS</th></tr>
<tr><td><a href=" alt="Tines Sponsorship" width="140px" src=" /></a></td><td><a href=" alt="Limacharlie Sponsorship" width="140px" src=" /></a></td></tr>
</table>-->

| REPO | BECOME A SPONSOR |
| :--: | :--: |
| ![DUB]() | Your logo and link to your domain will appear here if you become a sponsor. Simply email me on if you would like to sponsor this project as South Africa is not supported yet under the Github sponsor program. |
<a href=' src=' alt='Follow '></a> | Help Support Me at |

Nginx Bad Bot and User-Agent Blocker, Spam Referrer Blocker, Anti DDOS, Bad IP Blocker and Wordpress Theme Detector Blocker


##### The Ultimate Nginx 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 even Fake Googlebots from e your web sites. PLEASE SEE: Definition of Bad Bots

_______________
#### : V4.2026.10.6180
#### Bad Referrers Blocked: 7116
#### Bad User-Agents (Bots) Blocked: 700
#### Fake Googlebots Blocked: 218
____________________

Help Support This Project

<img src=" alt="Buy me Coffee" width="300"/>


  • Created by: Mitchell Krog for use on Nginx Web Server

  • Copyright Mitchell Krog <>
  • _______________________
    ##### Tested On:
    ##### nginx : nginx/1.10.x -> mainstream :hea:
    __________________________

    Not Using Nginx? See the ![Get the APACHE ULTIMATE BAD BOT BLOCKER]()

    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.


    EASY AUTO CONFIGURATION INSTRUCTIONS FOR THE NGINX BAD BOT BLOCKER


    Please follow the instructions below step by step :exclamation:

  • This is our new preferred method of installation which is now done through a set of shell scripts contributed to this repo and maintained by Stuart Cardall who is one of the Alpine Linux package maintainers.
  • The instructions below are for a quick and painfree installation process which downloads all required files for the blocker and the scripts include adding the required includes to your nginx.conf and nginx .vhost files. The setup script assumes your vhost config files are located in /etc/nginx/sites-a/ and each vhost config file ends with a file extension of .vhost
  • For manual installation instructions please see - Please see:
  • setup-ngxblocker, install-ngxblocker and update-ngxblocker can all be configured with custom installation / update locations from the command line. (See Step 11 of the instructions to show you how use these scripts and non-standard Nginx locations)
  • Run any of the setup, install or update scripts with --help or -h to view options.
  • > PLEASE NOTE: For those using Let's Encrypt SSL Certificates the preferred and 100% working method is to use the Webroot Authenticator Method. There appears to be some issues with people using the http challenge method but can confirm that webroot work flawlessly. We are uncertain at this point whether the http-01 challenge method is a certbot or nginx bug.

    [WARN] DUPLICATE NETWORK MESSAGES FROM NGINX


    PLEASE READ THIS

    The Duplicate network reports from Nginx is NOT a bug nor can it be fixed, this is the desired behaviour of the blocker. Daily updates of IP blacklists cause some well known IP's and ranges to be blacklisted these are then whitelisted at the very end of globalblocklist which is the order of loading which then sets IP's we know are good to their new thereby whitelisting them. It has been this way since day 1 of the blocker and will remain this way. These are simple [WARN] messages not [EMERG] messages and they do not affect the operation of Nginx in any way whatsoever.


    <img src="

    ##### Linux

    Download install-ngxblocker to your /usr/local/sbin/ directory and make the script executable.

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

    ##### FreeBSD

    Install the package.

    Alternatively install :


    <img src="

    Now run the install-ngxblocker script in DRY-MODE which will show you what changes it will make and what files it will download for you. This is only a DRY-RUN so no changes are being made yet.

    The install-ngxblocker downloads all required files including the setup and update scripts.

    This will show you output as follows of the changes that will be made
    (NOTE: this is only a DRY-RUN no changes have been made)

    setup-ngxblocker, install-ngxblocker and update-ngxblocker can all be configured with custom installation / update locations from the command line.

    Run any of the setup, install or update scripts with --help or -h to view options.


    <img src="

    Now run the install script with the -x parameter to download all the necessary files from the repository:

    This will give you the following output:

    All the required files have now been downloaded to the correct folders on Nginx for you direct from the repository.

    MAKE SURE you set your setup and update scripts to be executable by running the following two commands. This is important before continuing with Step 4 and onwards.

    setup-ngxblocker, install-ngxblocker and update-ngxblocker can all be configured with custom installation / update locations from the command line.

    Run any of the setup, install or update scripts with --help or -h to view options.


    <img src="

    Now run the setup-ngxblocker script in DRY-MODE which will show you what changes it will make and what files it will download for you. This is only a DRY-RUN so no changes are being made yet.

    This will give you output as follows (this output below assumes your nginx.conf file already has the default include of /etc/nginx/conf.d/*)
    All Nginx installations I know of have this default include in the nginx.conf file distributed with all .

    This script also whitelists your IP in the whitelist-ips.conf file for you.
    Further IP's or IP ranges can be added to your customizable whitelits-ips.conf file located in /etc/nginx/bots.d/whitelist-ips.conf.

    setup-ngxblocker, install-ngxblocker and update-ngxblocker can all be configured with custom installation / update locations from the command line.

    Run any of the setup, install or update scripts with --help or -h to view options.


    <img src="

    Now run the setup script with the -x parameter to make all the necessary changes to your nginx.conf (if required) and also to add the required includes into all your vhost files.

    This setup-ngxblocker script assumes that all your vhost files located in /etc/nginx/sites-a end in an extension .vhost. It is good practice to make all your vhost config files end with a .vhost extension but if you prefer to stick what you already have eg .conf you can simply modify run setup-ngxblocker using the -e parameter to specify the extension you use for your vhost files.

    For instance if your vhost files end in .conf you will change this execute setup-ngxblocker with an additional command line parameter as follows:

    sudo ./setup-ngxblocker -x -e conf

    So now let's run the setup script and let it make all the changes we need to make the Bot Blocker active on all your sites.

    You will see output as follows:

    You will note it has done the includes in all the .vhost files on my test bed server and also whitelisted your own IP address in the whitelist-ips.conf file for you. Further IP's or IP ranges can be added to your customizable whitelits-ips.conf file located in /etc/nginx/bots.d/whitelist-ips.conf.

    What this setup script has done has simply added the following include statements into your .vhost files for you, it also adds /etc/nginx/conf.d/* to the includes in nginx.conf (if not already in nginx.conf), otherwise, the whole script will fail.

    setup-ngxblocker, install-ngxblocker and update-ngxblocker can all be configured with custom installation / update locations from the command line.

    Run any of the setup, install or update scripts with --help or -h to view options.


    <img src="

    Now test your nginx configuration

    sudo nginx -t

    and you should see


    <img src="

    Now simply reload / restart Nginx and the Bot Blocker will immediately be active and protecting all your web sites.

    sudo nginx -t && sudo nginx -s reload

    or

    sudo service nginx restart

    That's it, the blocker is now active and protecting your sites from thousands of malicious bots and domains.


    <img src="

    Now setup cron to automatically update the blocker for you every day so you always have the latest up to date protection.

    sudo crontab -e

    Add the following line at the end of your crontab file. Note adding the -e command line parameter to specify your email address where the update report is sent to. Ob substitute with your real email address or you will not receive the email when the script has updated.

    00 22 * * * sudo /usr/local/sbin/update-ngxblocker -e

    This will update the blocker every night for you at 10 PM.

    If you want it to update more frequently (as sometimes I push out 3-4 updates a day) you can set it as follows to run the cron every 8 hours, although just once a day is more than enough.

    00 */8 * * * sudo /usr/local/sbin/update-ngxblocker -e

    If you don't want any email notification after an update (not ad in case Nginx ever has an EMERG when reloading), then simply run your cron as follows.

    00 */8 * * * sudo /usr/local/sbin/update-ngxblocker -n

    If you would rather send e-mail via <a href=" then run your cron as so:

    00 22 * * * sudo /usr/local/sbin/update-ngxblocker -g -d yourdomain.com -a mailgun api key -f

    That's it, the blocker will automatically keep itself up to date and also reload Nginx once it has downloaded the latest of the globalblacklist.conf file.


    <img src="

    You can now customize any of the following files below to suit your en or requirements. These include files never get modified during an update using the auto update script above so whate you do here will never be o during an update.

    Let's say for some "obscure" reason you actually want to block GoogleBot from accessing your site. You would simply add it to the /etc/nginx/bots.d/blacklist-user-agents.conf file and it will o the default whitelist for GoogleBot. the same applies to any other bots that are whitelisted by default.

    All include files are commented for your con.


    If This This Project helped you out, help support it

    <img src=" alt="Buy me Coffee" width="300"/>


    <img src="

    (TEST THAT IT IS WORKING)

    TESTING

    Run the following commands one by one from a terminal on another linux machine against your own domain name.

    :exclamation:
    substitute http:// yourdomain.com :exclamation: in the examples below with your own REAL domain name :exclamation:

    curl -A "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +)" -I

    curl -A "Mozilla/5.0 (compatible; bingbot/2.0; +)" -I

    Should respond with 200 OK

    curl -A "Xenu Link Sleuth/1.3.8" -I

    curl -A "Mozilla/5.0 (compatible; AhrefsBot/5.2; +)" -I

    Should respond with either of the following error messages:

  • curl: (52) Empty reply from server

  • curl: (56) TCP connection reset by peer

  • curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
  • curl -I -e

    curl -I -e

    Should respond with either of the following error messages:

  • curl: (52) Empty reply from server

  • curl: (56) TCP connection reset by peer

  • curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
  • The Nginx Ultimate Bot Blocker is now WORKING and PROTECTING your web sites !!!

    :exclamation:
    substitute http:// yourdomain.com :exclamation: in the examples below with your own REAL domain name :exclamation:

    <img src="

    NOTE to Cloudflare Users !!!

    If you are a Cloudflare user who is using the Cloudflare CDN / Caching System you should always disable the Cloudflare CDN (set gray Cloud)

    While testing you will get the correct response codes results as below:

  • curl: (52) Empty reply from server

  • curl: (56) TCP connection reset by peer

  • curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
  • This is by design. The CDN is doing its work, meaning, the first response from your server said to the bot, "go away" by issuing it 444 or 443 responses.

    Cloudflare cache's that response and hence the second time you test you will get served a 520 Origin Error origin error message.

    While testing the blocker, disable the CDN / cacheing system and once you are happy with your tests, re-enable the CDN/Cache on your li as you do want the bots to get that response from Cloudflare.

    Most other CDN systems will probably show the same behavior so always disable a CDN during testing to rule out anything that will interfere with your testing. Always make sure to re-enable the CDN when done testing !!

    Once you Enable Cloudflare CDN, test again.

    While testing, you get

  • curl: 520 Origin Error
  • This means the CDN is working.


    <img src="

    #### OPTIONAL
    INSTALLING THE BLOCKER TO NON-STANDARD NGINX FOLDER LOCATIONS

    Some people build Nginx themselves and do not end up having the standard nginx folder locations at /etc/nginx

    For users like this you can run the install-ngxblocker, setup-ngxblocker and update-ngxblocker specifying your
    folder location in the command lines as follows.

    sudo ./install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d

    sudo ./setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d

    sudo ./update-ngxblocker -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d -e

    This will automatically put the files into the locations you specify, it will do the includes into your using your custom locations and when update-ngxblocker pulls a new update it will also now automatically re-write the "Include" sections inside the globalblacklist.conf file your own custom locations. Thanks again to Stuart Cardall for his contributions of these excellent scripts.

    [WARN] DUPLICATE NETWORK MESSAGES FROM NGINX


    PLEASE READ THIS

    The Duplicate network reports from Nginx is NOT a bug nor can it be fixed, this is the desired behaviour of the blocker. Daily updates of IP blacklists cause some well known IP's and ranges to be blacklisted these are then whitelisted at the very end of globalblocklist which is the order of loading which then sets IP's we know are good to their new thereby whitelisting them. It has been this way since day 1 of the blocker and will remain this way. These are simple [WARN] messages not [EMERG] messages and they do not affect the operation of Nginx in any way whatsoever.

    WHY BLOCK BAD BOTS ?

    <h4 id="define-bad-bots">
    Definition of Bad Bots
    </h4>

    ##### Bad bots are:

  • Bad Referrers

  • Bad User-Agent Strings

  • Spam Referrers

  • Spam Bots and malicious Bots

  • Nuisance or Unwanted Bots

  • Sites Linked to Lucrati, Adware and Ransomware Clickjacking Campaigns

  • scanners

  • Gambling and Porn Web Sites

  • E-mail har

  • Content scrapers

  • Link Ranking Bots

  • Aggressive bots that scrape content

  • Image Hotlinking Sites and Image Thieves

  • Bots or Servers linked to or malware

  • Go sur bots

  • Botnet Attack Networks (Mirai)

  • Known Wordpress Theme Detectors (Updated Regularly)

  • SEO companies that your competitors use to try impro SEO

  • Link Research and Backlink Testing Tools

  • Stopping Google Analytics Ghost Spam

  • Browser Adware and Malware (Yontoo etc)
  • (Over 4000 bad referers, spam referrers, user-agents, bad bots, bad IP's, porn, gambling and clickjacking sites, lucrative seo companies, wordpress theme detectors and counting)

  • 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)

  • See sample Nginx SSL Vhost config at:


  • Help Support This Project

    Thousand of hours of programming and testing have gone into this project, show some love

    <img src=" alt="Buy me Coffee" width="300"/>


    Welcome to the Ultimate Nginx Bad Bot, User-Agent, Spam Referrer Blocker, Adware, Malware and Ransomware Blocker, Click-Jacking Blocker, Click-Redirect Blocker and Bad IP Blocker with Anti DDOS System, Nginx Rate Limiting and Wordpress Theme Detector Blocking.

    Bots attempt to make themselves look like other software or web sites by disguising their user agent. Their user agent names may look harmless, perfectly legitimate even.

    For example, "^Java" but according to Project Honeypot, it's actually one of the most dangerous BUT a lot of legitimate bots out there have "Java" in their user agent string so the approach taken by many to block "Java" is not only ignorant but also blocking out very legitimate crawlers including some of Google's and Bing's and makes it very clear to me that those people writing bot blocking scripts seldom ever test them.

    Spam Referrers and Spam Domain Names use very cle to hop off your sites running very lucrati and click-redirecting campaigns which serve ads to unsuspecting people browsing the web or e malware, adware or ransomware into their browsers which then become part of their lucrati of bots.

    This Bot Blocker includes hundreds of domain names and IP addresses that most people will not even see in their Nginx logs. This comes as a result of all my sites running of SSL and using Content-Security-Policy (CSP) which blocks things before they even get to Nginx and I ha up and continue to pick up some of the worst domains and bots out there.

    A massi of Porn, Gambling and Fake News web sites are also blocked in this blocker script which also grows at a rapid pace.

    Unfortunately most bot blocker scripts out there are simply copy and pasted from other people's scripts and made to look like their own work. This one was inspired by the one created by and I contributed to that project but went off into a totally new layout, cleaned it up big time and started from scratch. It is now a completely independent project. It's clean, it works and has been thoroughly tested.


    THE BASICS

    This nginx bad bot bot blocker list is designed to be a global Nginx include file and uses the Nginx map $http_user_agent, map $http_referer and geo $ directives.

    This way the .conf file is loaded once into memory by Nginx and is a to all web sites that you operate. You simply need to use an Include statement in an Nginx vhost conf file.


    IT'S CENTRALISED:

    The beauty of this is that it is one central file used by all your web sites. This means there is only place to make amendments ie. adding new bots that you discover in your log files. Any changes are applied immediately to all sites after a simple "sudo service nginx reload". But of course always do a sudo nginx -t to test any config changes before you reload.


    IT IS TINY AND LIGHTWEIGHT

    The file is tiny in size. At the time of this writing and the first public commit of this the file size including all the commenting "which nginx ignores" currently at a mere 185 kb in size and already containing over 5000 bad domains, bad bots and bad IP addresses. It is so lightweight that Nginx does not even know it's there. It already contains thousands of entries - total updated at the top of this README.


    IT IS ACCURATE AND IS FALSE POSITI

    Unlike many other bad bot blockers out there for Nginx and Apache where people simply copy and paste lists from others, this list has been built from the ground up and tested thoroughly and I mean thoroughly for now over 10 months. It comes from actual server logs that are monitored daily and there are at least 3-10 new additions to this file almost daily.

    It has also been throughly tested for false positi months of constant and regular testing and monitoring of log files.

    All web sites listed in the bad referers are checked one by one before they are e. Simply copying anything that look suspicious in your log file and adding it to a blocker like this without actually seeing what it is first .... well it's foolish to say the least.


    DROP THEM AND THAT'S IT

    Nginx has a lovely error called 444 which just literally drops the connection. All these rules issue a 444 response so if a rule matches, the requesting IP simply get's no response and it would appear that your server does not exist to them or appears to be offline.

    A test with curl using one of the test command line's documented in the /conf.d/globalblacklist.conf file will give a simple "curl: (52) Empty reply from server" and that's the reply the bad referrers and bots get.


    RATE LIMITING FUNCTIONALITY BUILT IN

    For bot's or spiders that you still want to allow but want to limit their rate, you can use the built in rate limiting functions I ha. The file is extensively commented throughout so you should figure it out otherwise simply message me if you are having problems.


    PULL REQUESTS / CORRECTIONS / FALSE POSITIVES:

    ![Log an Issue]() or to contribute your own bad referers, bots or to make corrections to any incorrectly blocked bots or domains please fork a copy of this repository and send pull requests on the <a href=" files located here</a> and then send a pull request (PR).

    ##### All Additions, Removals and Corrections will all be checked for accuracy before being merged into main blocker.


    ISSUES:

    ![Log an Issue]() regarding incorrect listings or any other problems on the issues system and they will be in and removed if necessary. I responde very quickly to user problems and ha countless users for days on end to get their bot blocker working. You could say I am mad (disputable) but I lo people and do not ignore issues or people with problems getting this to work.


    FEATURES OF THE NGINX BAD BOT BLOCKER:

  • Extensi of Bad and Known Bad Bots and Scrapers (updated almost daily)

  • Blocking of Spam Referrer Domains and Web Sites

  • Blocking of SEO data collection companies like Semalt.com, Builtwith.com, WooRank.com and many others (updated regularly)

  • Blocking of clickjacking Sites linked to Adware, Malware and Ransomware

  • Blocking of Porn and Gambling Web Sites who use Lucrative Ways to Earn Money through Serving Ads by hopping off your domain names and web sites.

  • Blocking of Bad Domains and IP's that you cannot even see in your Nginx Logs. Thanks to the Content Security Policy (CSP) on all my SSL sites I can see things trying to pull resources off my sites before they even get to Nginx and get blocked by the CSP.

  • Anti DDOS Filter and Rate Limiting of Agressive Bots

  • Alphabetically ordered for easier maintenance (Pull Requests Welcomed)

  • Commented sections of certain important bots to be sure of before blocking

  • Includes the IP range of Cy who are known to ignore robots.txt rules

  • and snoop around all over the Internet.
  • Whitelisting of Google, Bing and Cloudflare IP Ranges

  • Whitelisting of your own IP Ranges that you want to avoid blocking by mistake.

  • Ability to add other IP ranges and IP blocks that you want to block out.

  • If its out there and it's bad it's already in here and BLOCKED !!

  • UNDERSTANDS PUNYCODE / IDN DOMAIN NAMES

    A lot of lists out there put funny domains into their hosts file. Your hosts file and DNS will not understand this. This list uses con domains which are in the correct DNS format to be understood by any operating system. Avoid using lists that do not put the correctly formatted domain structure into their lists.

    For instance
    The domain:

    lifehacĸer.com (note the K)

    actually translates to:

    xn--lifehacer-1rb.com

    You can do an nslookup on any operating system and it will resol.

    nslookup xn--lifehacer-1rb.com

  • Look at: for more info on this.

  • ALWAYS MONITOR WHAT YOU ARE DOING:

    MAKE SURE to monitor your web site logs after implementing this. I suggest you first load this into one site and monitor it for any possible false positi putting this into production on all your web sites.

    Do not sit like an ostrich with your head in the sand, being a responsible ser and web site owner means you must monitor your logs frequently. A reason many of you ended up here in the first place because you saw nasty looking stuff in your Nginx log files.

    Also monitor your logs daily for new bad referers and user-agent strings that you want to block. Your best source of adding to this list is your own server logs, not mine.

    Feel free to contribute bad referers from your own logs to this project by sending a Pull Request (PR). You can however rely on this list to keep out 99% of the baddies out there.


    HOW TO MONITOR YOUR LOGS DAILY (The Easy Way):

    With great thanks and appreciation to

    To monitor your top referer's for a web site's log file's on a daily basis use the following simple cron jobs which will email you a list of top referer's / user agents every morning from a particular web site's log files. This is an example for just one cron job for one site. Set up multiple one's for each one you want to monitor. Here is a cron that runs at 8am every morning and emails me the stripped down log of referers. When I say stripped down, the domain of the site and other referers like Google and Bing are stripped from the results. Of course you must change the log file name, domain name and your email address in the examples below. The second cron for collecting User agents does not do any stripping out of any referers but you can add that functionality if you like copying the awk statement !~ from the first example.

    ##### Cron for Monitoring Daily Referers on Nginx

    00 08 * * * tail -10000 /var/log/nginx/mydomain-access.log | awk '$11 !~ /google|bing|yahoo|yandex|mywebsite.com/' | awk '{print $11}' | tr -d '"' | sort | uniq -c | sort -rn | head -1000 | mail -s "Top 1000 Referers for Mydomain.com"

    This emails you a daily list of referrers using an awk command to exclude domains like google, bing and your own domain name.

    ##### Cron for Monitoring Daily User Agents on Nginx

    00 08 * * * tail -50000 /var/log/nginx/mydomain-access.log | awk '{print $12}' | tr -d '"' | sort | uniq -c | sort -rn | head -1000 | mail -s "Top 1000 Agents for Mydomain.com"

    This emails you a list of top User-Agents who your site in the last 24 hours, helpful for spotting any rogue or suspicious looking User-Agents strings.


    BLOCK AGGRESSIVE BOTS AT FIREWALL LE FAIL2BAN:

    I ha a custom Fail2Ban filter and action that I ha which monitors your Nginx logs for bots that generate a large number of 444 errors. This custom jail for Fail2Ban will scan logs over a 1 week period and ban the offender for 24 hours.
    It helps a great deal in keeping out some repeat offenders and pre them from filling up your log files with 444 errors.
    See the Fail2Ban folder for instructions on configuring this great add on for the Nginx Bad Bot Blocker.


    STOPPING GOOGLE ANALYTICS "GHOST" SPAM:

    Simply using the Nginx blocker does not stop Google Analytics ghost referral spam because they are hitting Analytics directly and not always necessarily touching your website.

    You should use regex filters in Analytics to prevent ghost referral spam.

    For this there are several google-exclude-0*.txt files which have been created for you and they are updated at the same time when the Nginx Blocker is updated. As the list grows there will be more exclude files created.


    TO STOP "GHOST" SPAM ON GOOGLE ANALYTICS FOLLOW THE SIMPLE GUIDE BELOW

    Follow the step by step instructions below to add these google-exclude files as segments to your web site.

    <table style="width:100%;margin:0;">
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    <tr>
    <td align="left"><img src=" alt="Google Analytics - Adding Segments to Stop Ghost Spam"/></td>
    </tr>
    </table>


    BLOCKING SPAM DOMAINS USING GOOGLE SEARCH CONSOLE / WEBMASTER TOOLS


    (How to use the google-disavow.txt file)

    I ha the creation of a Google Disavow text file called google-disavow.txt. This file can be used in Google's Webmaster Tools to block all these domains out as spammy or bad links. Use with caution.


    ROBOTS.txt for those who cannot use this full blocker?

    Lots of people are at the peril of their hosting company and do not have root access to the ser behind their web site. If this is your situation check out the automatically generated robots.txt file which will help you to some degree to keep a lot of Bad Bots and User-Agents out of your sites.


    .htaccess for those who cannot use this full blocker?

    Lots of people are at the peril of their hosting company and do not have root access to the ser behind their web site.

    If this is your situation check out the automatically generated .htaccess of the Spam Referrer Blocker which can be found in <a href=" repository</a> this .htaccess method (FOR APACHE SITES ONLY) will help you to keep all the Spam Referrers in this blocker out of your site.

    This is merely mentioned here as a lot of people using CPanel systems think they are sitting behind an Nginx server but in reality are actually running on an Apache Ser behind an Nginx Proxy Server. .htaccess does not work on Nginx sites.

    Not Using Nginx Web Server? See the ![Get the APACHE ULTIMATE BAD BOT BLOCKER]()


    IT FORKING WORKS !!!



    Just Enjoy now what the Nginx Bad Bot Blocker Can Do For You and Your Web Sites.


    And Help Support This Project

    Thousand of hours of programming and testing have gone into this project, show some love

    <img src=" alt="Buy me Coffee" width="300"/>


    HAS YOUR WEB SITE BEEN HACKED?

    ![Contact me for help](mailto:) to help you clean up and secure your web site.


    SOME OTHER AWESOME FREE PROJECTS
















  • ALSO CHECKOUT THE NEW BIG LIST OF HACKED MALWARE & WORDPRESS WEB SITES

    This repository contains a list of all web sites I come across that are hacked with malware.
    Most site owners are unaware their sites have been hacked and are being used to plant malware.

    Check it out at:


    INTO PHOTOGRAPHY?

    Come drop by and visit me at mitchellkrog.com or Facebook or Follow Me on Twitter <a href=' src=' alt='Follow '></a>


    ACKNOWLEDGMENTS & CONTRIBUTORS:

    Many Thanks to those contributing to this project.

    Many parts of the generator scripts and code running behind this project have been adapted from snippets from hundreds of sources.
    In fact it is so hard to mention e but here are a few key people whose little snippets of code ha me introduce new features all the time. Show them some love and check out some of their projects too.

  • Konstantin Goretzki (Impro on Fail2Ban Filter)

  • Stuart Cardall - (Install, Update and Setup Scripts & Alpine Linux Package Maintainer)

  • Mike -

  • Nissar Chababy - (Excellent script for checking ACTI and EXPIRED Domain Names)

  • Marius Voila

  • Cătălin Mariș

  • deformhead

  • bluedragonz

  • Alexander

  • Ste

  • Fail2Ban -

  • Ste Hartog

  • Sir Athos from StackO - (help with Tra Tagging and Committing)

  • StackO - (bash scripts from hundreds of questions and answers)

  • SuperUser - (snippets from questions and answers)
  • If you believe your name should be here, drop me a line.


    Writing Code like this takes lots of time !!

    Thousand of hours of programming and testing have gone into this project, show some love

    <img src=" alt="Buy me Coffee" width="300"/>

    <img src="


    MIT License

    Copyright (c) 2017 Mitchell Krog -


    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The abo notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

    项目信息

    开发语言:Shell

    Star 数:4801

    技术要点

    该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。

    从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。

    使用与学习建议

    1. 下载源码压缩包,解压到本地环境。

    2. 根据项目类型准备对应的运行环境与依赖。

    3. 按照 README 中的步骤完成配置与部署。

    4. 在隔离的测试环境中运行验证,避免影响生产系统。

    免责声明

    本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。

    资源标题nginx-ultimate-bad-bot-blocker - Nginx Block Bad Bots, Spam Referrer Blocker, Vulne
    所属分类安全软件
    发布作者admin
    发布时间2026-10-05 22:32:32
    下载权限 免费下载
    附件数量2 个下载链接
    浏览次数511
    讨论数量0
    主题状态正常讨论中

    本资源免费,登录后即可在本页「下载链接」区域获取全部附件。

    请在评论区留言说明具体链接,或联系作者补档。楼主更新后本页会同步最新的下载地址。

    请先阅读正文中的授权说明;未注明的默认仅限站内学习交流,禁止直接搬运到其他站点二次售卖。
    还没有讨论,快来抢沙发~
    登录 后才能参与讨论
    下载链接
    会员才能下载
    登录后开通会员
    同分类推荐
    暂无同类资源
    免费登录即可下载
    查看会员
    放大预览

    © 2026 剑庭安 - 网站开发定制 SEO 优化蜘蛛池代做 在线看手相算命. 保留所有权利。

    Powered by 酷像SEOv3.0

    网站地图 Sitemap.xml
    首页 全部分类 黑客安全 逆向|反编译 精品源码 站长工具自助开通会员其他资源SEO工具站群源码泛程序蜘蛛模板蜘蛛池外链工具创意乐园 搜索 会员服务 登录 注册