C0nw0nk / Nginx-Lua-Anti-DDoS

A Anti-DDoS script to protect Nginx web servers using Lua with a HTML Javascript based authentication puzzle inspired by Cloudflare I am under attack mode an Anti-DDoS authentication page protect yourself from every attack type All Layer 7 Attacks Mitigating Historic Attacks DoS DoS Implications DDoS All Brute Force Attacks Zero day exploits Social Engineering Rainbow Tables Password Cracking Tools Password Lists Dictionary Attacks Time Delay Any Hosting Provider Any CMS or Custom Website Unlimited Attempt Frequency Search Attacks HTTP Basic Authentication HTTP Digest Authentication HTML Form Based Authentication Mask Attacks Rule-Based Search Attacks Combinator Attacks Botnet Attacks Unauthorized IPs IP Whitelisting Bruter THC Hydra John the Ripper Brutus Ophcrack unauthorized logins Injection Broken Authentication and Session Management Sensitive Data Exposure XML External Entities (XXE) Broken Access Control Security Misconfiguration Cross-Site Scripting (XSS) Insecure Deserialization Using Components with Known Vulnerabilities Insufficient Logging & Monitoring Drupal WordPress Joomla Flash Magento PHP Plone WHMCS Atlassian Products malicious traffic Adult video script avs KVS Kernel Video Sharing Clip Bucket Tube sites Content Management Systems Social networks scripts backends proxy proxies PHP Python Porn sites xxx adult gaming networks servers sites forums vbulletin phpbb mybb smf simple machines forum xenforo web hosting video streaming buffering ldap upstream downstream download upload rtmp vod video over dl hls dash hds mss livestream drm mp4 mp3 swf css js html php python sex m3u zip rar archive compressed mitigation code source sourcecode chan 4chan 4chan.org 8chan.net 8ch 8ch.net infinite chan 8kun 8kun.net anonymous anon tor services .onion torproject.org nginx.org nginx.com openresty.org darknet dark net deepweb deep web darkweb dark web mirror vpn reddit reddit.com adobe flash hackthissite.org dreamhack hack hacked hacking hacker hackers hackerz hackz hacks code coding script scripting scripter source leaks leaked leaking cve vulnerability great firewall china america japan russia .gov government http1 http2 http3 quic q3 litespeedtech litespeed apache torrents torrent torrenting webtorrent bittorrent bitorrent bit-torrent cyberlocker cyberlockers cyber locker cyberbunker warez keygen key generator free irc internet relay chat peer-to-peer p2p cryptocurrency crypto bitcoin miner browser xmr monero coinhive coin hive coin-hive litecoin ethereum cpu cycles popads pop-ads advert advertisement networks banner ads protect ovh blazingfast.io amazon steampowered valve store.steampowered.com steamcommunity thepiratebay lulzsec antisec xhamster pornhub porn.com pornhub.com xhamster.com xvideos xvdideos.com xnxx xnxx.com popads popcash cpm ppc
MIT License
1.17k stars 269 forks source link

ip blacklist not working #45

Open rosolinol opened 4 years ago

rosolinol commented 4 years ago

tried to ban myself as

local ip_blacklist = {
"xx.99.0.0/18",
}

logs

2020/05/16 17:37:03 [warn] 1244#1244: *11 [lua] _G write guard:12: __newindex(): writing a global lua variable ('shuffle') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
        /etc/nginx/anti_ddos_challenge.lua:2454: in main chunk, client: xx.99.118.30, server: example.com, request: "GET /index.php HTTP/2.0", host: "example.com"

the same things stands for ip_whitelist doesn't work also some other user reported https://github.com/C0nw0nk/Nginx-Lua-Anti-DDoS/issues/44

also i have another question can you provide a more friendly log output or allowing user to somewhat log "functions" or create custom log formats something similar to nginx ?

log_format raw 'FROM: $remote_addr  | STATUS: $status | TO: $request | CACHE: $upstream_cache_status';

?!

Thank you.

Sylvvvia commented 4 years ago

Simply restart your webserver. It needs to reload script.

rosolinol commented 4 years ago

@Sylvvvia please stop telling ppl to restart nginx it makes no sense at all. ppl who had the knowledge to install lua and this module they also know that restart is required after changes.

In my case was wrong ipv4 passed to nginx since it was behind NAT. After this fix it has been working well so far.

Still requesting help for custom logs so i'm not closing this without e reply from dev.

glushchenko commented 1 year ago

Fix here https://github.com/bis-gmbh/Nginx-Lua-Anti-DDoS/commit/80f23fd677cea630cafb142039f681fec85f08da