markruff icon

hackbotkiller

markruff | PRO | 08/27/16 01:10:12 PM UTC | 0 ⭐ | 363 👁️ | Never ⏰ | []
Bash |

740 B

|

None

|

0 👍

/

0 👎

#!/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