Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PS3='Prosze co chcesz zrobic: '
- options=("Tworzenie bazy danych" "Blokowanie" "Informacje o autorze" "Wyjscie")
- select opt in "${options[@]}"
- do
- case $opt in
- "Tworzenie bazy danych")
- ipset --flush
- ipset create jp hash:net
- for IP1 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/jp.zone)
- do
- ipset add jp $IP1
- done
- ipset create cn hash:net
- for IP2 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/cn.zone)
- do
- ipset add cn $IP2
- done
- ipset create ru hash:net
- for IP3 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ru.zone)
- do
- ipset add ru $IP3
- done
- ipset create us hash:net
- for IP4 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/us.zone)
- do
- ipset add us $IP4
- done
- ipset create ua hash:net
- for IP5 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ua.zone)
- do
- ipset add ua $IP5
- done
- ipset create tr hash:net
- for IP6 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/tr.zone)
- do
- ipset add tr $IP6
- done
- ipset create be hash:net
- for IP7 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/be.zone)
- do
- ipset add be $IP7
- done
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[32m Tworzenie listy zakonczone. \033[0m"
- echo -e "\E[32m Przejdz do kroku nr.2 \033[0m"
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
- echo -e "\E[36m 2)Blokowanie \033[0m"
- echo -e "\E[36m 3)Informacje o autorze \033[0m"
- echo -e "\E[36m 4)Wyjscie \033[0m"
- ;;
- "Blokowanie")
- iptables -A INPUT -m set --match-set jp src -j DROP
- iptables -A INPUT -m set --match-set cn src -j DROP
- iptables -A INPUT -m set --match-set ru src -j DROP
- iptables -A INPUT -m set --match-set us src -j DROP
- iptables -A INPUT -m set --match-set ua src -j DROP
- iptables -A INPUT -m set --match-set tr src -j DROP
- iptables -A INPUT -m set --match-set be src -j DROP
- iptables --list
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[32m Blokowanie listy zakonczone. \033[0m"
- echo -e "\E[32m Mozna przejs cdo kroku nr.4 \033[0m"
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
- echo -e "\E[36m 2)Blokowanie \033[0m"
- echo -e "\E[36m 3)Informacje o autorze \033[0m"
- echo -e "\E[36m 4)Wyjscie \033[0m"
- ;;
- "Informacje o autorze")
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[32m Prosty skrypt do wycinania niechcianych krajów \033[0m"
- echo -e "\E[32m Zakaz dalszego udostepniania bez zgody autora \033[0m"
- echo -e "\E[32m Dimitri specjalnie dla ForGame.pl \033[0m"
- echo -e "\E[32m ============= \033[0m"
- echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
- echo -e "\E[36m 2)Blokowanie \033[0m"
- echo -e "\E[36m 3)Informacje o autorze \033[0m"
- echo -e "\E[36m 4)Wyjscie \033[0m"
- ;;
- "Wyjscie")
- break
- ;;
- *) echo invalid option;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement