Simple Python Script for Slowloris/http flood/DDoS protection [Linux]

Recently, I’ve been getting a lot of DDoS attacks on my FXServer running on Linux. Most commonly attacks were Slowloris and HTTP Flood.

To combat these attacks, I blocked the rest of the world from accessing my server except my country from where most players are. but then I started getting DDoS from IPs from my own country. So with the help of my friend we created a simple python script that utilizes Linux’s UFW firewall (Basically a simple version of IPTables) to block IPs making more than N number of connections every N seconds (You can configure the number of connections and timeout for script)

This way the scripts automatically ban bad IPs or proxies attacking your server.

So, if your FXServer runs on Linux, this script can be useful for you. If you need any help to set it up on your server, I can answer your issues in the comment section.

DDoS Protection Fivem

6 Likes

Can u help me in windows im from Dream Life India

MY server is getting ddos attacks since 3 days

send me a DM

Anything for windows?

In where do i put this script? is it inside the fivem resource files or anywhere it could be?

I recommend you avoid apache and use nginx or openlitespeed and then you be les variable to stuff like slowlorries attack etc