Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- rm -f dump.csv
- wget -q https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv || exit 1
- cat dump.csv | cut -d";" -f1 | tr '|' '\n' | grep '/' | tr -d ' ' | sort -k1 -n | uniq > norkn_subnets.txt
- cat dump.csv | cut -d";" -f1 | tr '|' '\n' | grep -v '/' | tr -d ' ' | sort -k1 -n | uniq | egrep -v "Updated|^$" > norkn_hosts.txt
- cat norkn_hosts.txt | sed 's/\./ /g' | awk '{ print $1"."$2"."$3 }' | sort | uniq -d | awk '{ print $1".0/24" }' > norkn_hosts_uniq_net_24.txt
- cp norkn_hosts_uniq_net_24.txt norkn_subnets_and_uniq_net_24.txt
- grep -v --fixed-strings ".0/24"./norkn_subnets.txt >> norkn_subnets_and_uniq_net_24.txt
- echo "/ip firewall address-list remove numbers=[ find list=rkn_block ]" > norkn_subnets_and_uniq_net_24.rsc
- cat norkn_subnets_and_uniq_net_24.txt | awk '{ print "/ip firewall address-list add address="$1" list=rkn_block timeout=30d12h" }' >> norkn_subnets_and_uniq_net_24.rsc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement