How to install anti ddos in termux ?

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.

Share:

More Posts

How to Install Maven on macOS 2025

What you will read?1 Check for Java Installation2 Install Homebrew (If Not Installed)3 Install Maven via Homebrew4 Verify Environment Variables (Optional)5 Create a Sample Maven

How to Use Google SMTP Server

What you will read?1 Step 1: Enable SMTP Access in Gmail2 Step 2: Secure Connection with TLS3 Step 3: Send an Email via SMTP4 Step

how to install wine on RHEL

What you will read?1 Check RHEL version and CPU architecture2 Update system and install base tools3 Verify subscription and enable CodeReady Builder4 Enable EPEL repository5

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments