Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install anti ddos in termux ?

How to install anti ddos in termux ?

Publication Date

07/17/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Termux can be a powerful mobile terminal environment, and you can use it to run lightweight anti-DDoS scripts to protect small-scale services or educational labs. This guide walks you through setting it up from scratch.

Step 1: Update Termux and Install Dependencies

Start by updating Termux and installing required tools:

pkg update && pkg upgrade -y
pkg install git python curl -y
pip install --upgrade pip

You may also need tsu if you’re on a rooted device:

pkg install tsu

Step 2: Clone a Lightweight Anti-DDoS Script

There are a few open-source projects you can use. One of the popular ones is Anti-DDOS by Zsbzsb.

Clone it using Git:

git clone https://github.com/Zsbzsb/anti-ddos.git
cd anti-ddos

Step 3: Configure the Script

Edit the config to whitelist your own IPs or change the port limits. For example:

nano ban.sh

Look for sections like:

iptables -A INPUT -p tcp --dport 80 -m connlimit --connlimit-above 20 -j DROP

Modify the port (80/443) or limit as needed.

If you’re using iptables-based detection, make sure it’s supported in your Termux environment. On some devices, you may need iptables-nft or root access.

Step 4: Run the Script

Once configured, simply run:

bash ban.sh

To keep it running or auto-trigger on boot (if you have root access), add it to your .bashrc or .termux/boot folder (Termux:Boot addon required):

echo "bash /data/data/com.termux/files/home/anti-ddos/ban.sh" >> ~/.bashrc

Step 5: Monitor Logs

If your script supports logging, check logs using:

cat /var/log/iptables.log

Or pipe output in real time:

tail -f /var/log/iptables.log

You can also add email or Telegram bot notifications for every blocked IP — just extend the script with a webhook or mailer library using Python.

Linux VPS
U
Loading...

Related Posts