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

Bandwidth and CPU drain #48

Open BradPerbs opened 4 years ago

BradPerbs commented 4 years ago

Any tip to reduce the CPU and bandwidth usage?

I'm currently using 2x KVM VPS in round robin with 20 and 8 cores, but with a simple attack, I reach 700 Mbit on both and 100% CPU usage.

Maybe a mitigation system that ban the hosts in netflow could work?

If you have any suggestion please let me know

BradPerbs commented 4 years ago

any ideas on how to filter that 80%?

hroost commented 4 years ago

Use services that provide ddos mitigation

BradPerbs commented 4 years ago

Use services that provide ddos mitigation

For "services" you mean providers? because in that case will not work, since that mitigate only Layer 3/4 traffic, not layer 7 HTTP legitimate traffic

C0nw0nk commented 4 years ago

This is where things get complex and I could solve it by allowing the script to take control of the servers built in firewall. For windows server users this would be netsh advfirewall and Linux would be iptables -A INPUT -s 192.168.0.1 -j DROP

I have the ability with Nginx Lua to access os.execute in order to run such things through a command line or console but i am looking at io.popen a bit more since os.execute blocks threads and workers while they run and io.popen is non blocking so will allow others users requests to finish and connect still.

ti-bone commented 2 years ago

This is where things get complex and I could solve it by allowing the script to take control of the servers built in firewall. For windows server users this would be netsh advfirewall and Linux would be iptables -A INPUT -s 192.168.0.1 -j DROP

I have the ability with Nginx Lua to access os.execute in order to run such things through a command line or console but i am looking at io.popen a bit more since os.execute blocks threads and workers while they run and io.popen is non blocking so will allow others users requests to finish and connect still.

Check this https://github.com/juce/lua-resty-shell

AndreiG6 commented 2 years ago

Seems like a useless tool antiddos then..

On Mon, 13 Jul 2020 at 20:44 GiacomoDevIT @.***> wrote:

You have to break 80% of attack before arriving to NGINX.. if the attack arrives to nginx the host will go offline for high CPU Usage.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/C0nw0nk/Nginx-Lua-Anti-DDoS/issues/48#issuecomment-657698130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6DR6F3C2ECSC34RHZK5GDR3NBXPANCNFSM4NZTCDEQ .

wumingpc commented 1 year ago

Hi, you can try third-party free DDOS/HTTP Flood defense with unlimited traffic Layer L3-4 defense www.freecdn.pw FreeCDN Accelerated Defense