filename=dump-fb.rsc addrlist=cidr_facebook rm -rfv IP ASN "$filename"; echo "AS32934 FACEBOOK AS54115 FACEBOOK AS32934 FACEBOOK " > ASN echo > IP echo -e '/ip firewall address-list\n add list="cidr_dump" address=0.0.0.1\n rem [find list="cidr_dump"]' > "$filename" ; #apt-get -q -y install libnet-netmask-perl clear d=$(date +%H) if [ $d -lt 12 ] then echo -e " Met pagi Om," elif [ $d -lt 16 ] then echo -e " Met siang om," elif [ $d -lt 20 ] then echo -e " Sore om," else echo -e " Malem om," fi echo -e ' Ini daftar AS Number yang akan di-dump :\n\n' ; cat ASN; echo -e ' Silahkan Tunggu...\n\n' ; tail -f IP & for ASN in $(cat ASN | awk '{print $1}'); do { whois -h whois.radb.net -- "-i origin $ASN" | grep '^route:' | perl -MNet::Netmask -ne'm!(\d+\.\d+\.\d+\.\d+/?\d*)! or next; $h = $1; $h =~ s/(\.0)+$//; $b=Net::Netmask->new($h); $b->storeNetblock(); END {print map {$_->base()."/".$_->bits()."\n"} cidrs2cidrs(dumpNetworkTable)}'; } >> IP sleep 5 done echo ""; echo -e '### ====== COPY DARI SINI ====== ###' sort -V IP | uniq | awk '{print "add list=cidr_dump address=" $1}' >> "$filename" echo -e '### ====== EOF ====== ###' >> "$filename" sed -i '4d' "$filename" cat "$filename"
Tuesday, August 8, 2017
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment