magikaru banhammer on hatsune
Posted Oct 21, 08:56 PM by cyanoacry to WTF (にゃんでやねん)
So hatsune’s got a magikaru banhammer; if anybody has over 10 established connections they’re nullrouted.
http://a.imouto.org/banhammer.txt
The nullroute script is a nice oneliner and runs every 10 minutes:
netstat -an -f inet | awk '/67\.159\.44\.34\.80.*ESTABLISHED/ {split($5,address,"."); connections[address[1]"."address[2]"."address[3]"."address[4]]++; } END {for(moo in connections) { if (connections[moo] > 10) { printf $moo "\n" ; }}}' | (while read -s moo; do printf "banning $moo\n";route add $moo 127.0.0.1; done;)
(Tested on FBSD 6.2-RELEASE, bash 3.2.25)
There’s probably a nicer way to do it, if anybody’d like to comment.
← A Fusor Story: 20,000 Watts! C73 Goodies →