This commit is contained in:
Your Name 2024-09-23 22:56:04 -06:00
parent 142f200882
commit 201e8d72b9
2 changed files with 10798 additions and 1076 deletions

View File

@ -58,12 +58,6 @@ MENU_BOTTOM="===================================================================
DATE="$(date +%d/%b/%Y:%H:%M -d '1 minute ago')"
nft list table filter >$NFT_CACHE
#Countries to Block
COUNTRY=(
https://www.ipdeny.com/ipblocks/data/countries/il.zone
https://www.ipdeny.com/ipblocks/data/countries/cn.zone
)
ipBlockParser() {
if [[ "$1" == *":"* ]]; then
$NFT insert rule ip6 filter input position 0 ip6 saddr $1 drop
@ -93,15 +87,11 @@ ipDeleteParser() {
}
blockCountry() {
for i in "${COUNTRY[@]}"; do
echo
DATA=($( redis-cli SMEMBERS country_ip))
for i in "${DATA[@]}"; do
echo "Blocking $i"
DB=($(curl $i))
for j in "${DB[@]}"; do
ipBlockParser $j
done
ipBlockParser $i
done
}
wireguard-networking() {
@ -474,6 +464,17 @@ importDB() {
DATA=($(cat crawlers.txt))
for i in "${DATA[@]}"; do redis-cli SADD crawlers $i; done
redis-cli SADD my_ip $(curl ifconfig.me)
redis-cli SADD country https://www.ipdeny.com/ipblocks/data/countries/il.zone \
https://www.ipdeny.com/ipblocks/data/countries/cn.zone
COUNTRY=($( redis-cli SMEMBERS country) )
for i in "${COUNTRY[@]}"; do
echo
echo "Blocking $i"
DB=($(curl $i))
for j in "${DB[@]}"; do
redis-cli SADD country_ip $j
done
done
}
exportDB() {
@ -497,8 +498,6 @@ elif [ "$1" = "bot-search" ]; then
bot-search
elif [ "$1" = "attacker-protection" ]; then
attacker-protection
elif [ "$1" = "country" ]; then
blockCountry
elif [ "$1" = "status" ]; then
automaticStatus
elif [ "$1" = "forgive" ]; then

11845
nft.rules

File diff suppressed because it is too large Load Diff