#!/bin/bash # # Fuck Off Chinese Hackers # My IP address, so I don't fuck myself off MYIP=12.33.132.17 while true do # iterate through all the IP addresses connected other than mine... 100% Chinese hackers for IP in $(netstat -tnpa | grep 'ESTABLISHED' | grep -v $MYIP | cut -c45-67 | cut -d: -f1) do # get the PID associated with hacker to be fucked off PID=$(netstat -tnpa | grep 'ESTABLISHED' | grep $IP | sed s/"^.*ESTABLISHED "// | cut -d\/ -f1) # drop the fucker iptables -A INPUT -s $IP -j DROP # kill the fucker kill -9 $PID 2>/dev/null # record echo $IP >> ipban # announce echo "Killing $IP on PID $PID" done # wait a moment and do it all over again sleep 2 done
Comments