https://github.com/jblond/ban_em_all
collection of bash scripts to fill iptables with ip adresses
https://github.com/jblond/ban_em_all
bash-script blocking-bots fail2ban iptables
Last synced: 10 days ago
JSON representation
collection of bash scripts to fill iptables with ip adresses
- Host: GitHub
- URL: https://github.com/jblond/ban_em_all
- Owner: JBlond
- License: mit
- Created: 2017-05-18T14:20:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-09-10T09:54:49.000Z (about 1 month ago)
- Last Synced: 2025-09-10T13:19:17.386Z (about 1 month ago)
- Topics: bash-script, blocking-bots, fail2ban, iptables
- Language: Shell
- Homepage:
- Size: 440 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Ban 'em all!
Ban / Block IPs via Iptables from your system.
The current list contains IP and or IP ranges that tried to break in servers, did massive scans, DDOS'ed the webserver, downloaded a single file from the webserver a gazillion times, brute force attacks on sshd, etc.Where is the attacking IP localed? Try www.utrace.de or utrace.me/whois/
## install
```bash
sudo apt-get install git fail2ban make
git clone https://github.com/JBlond/ban_em_all.git ban
cd ban
make
```## update
```bash
make
```## ban some IP (range) on the spot
```bash
./now.sh 5.9.23.231
./now.sh 1.81.0.0/16
./now6.sh 2406:9DC0:6669::/48
```## usage
This simple script shows which rules have been used. So maybe over time you can optimize / shorten the list of blocked IPs for your system.
```bash
make usage
```### China blocking
```bash
make china
make chinav6
```This will run the block list defined in china.sh. Do this only if you know what you are doing.
### immuni web scanning
```bash
make immuniweb
```## Blocking all
```bash
make all
```## Create your list
After using one or the other list of this repository and adding IPs with now and now6, you may want to export that exact list
```bash
make list# or
make list > mylist.txt
```### Still need more?
Also a good place to look for certain IPs is
## Legacy warnings
```bash
sudo apt install nftables
sudo systemctl enable nftables.service
```## Let's encrypt issues
Sometimes the Let's encrypt IP range is in this. They change their range quiet often. In trouble
run
```bash
sudo iptables -F INPUT
sudo iptables --flush bannedDownloader
sudo iptables -X bannedDownloader
```Update your certs
run
```bash
make
```## Contribute
Contributers are welcome. Open Pull request or file an issue.