Advertisement
markruff

hackbotkiller

Aug 27th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Fuck Off Chinese Hackers
  4.  
  5. # My IP address, so I don't fuck myself off
  6. MYIP=12.33.132.17
  7.  
  8. while true
  9. do
  10.   # iterate through all the IP addresses connected other than mine... 100% Chinese hackers
  11.   for IP in $(netstat -tnpa | grep 'ESTABLISHED' | grep -v $MYIP | cut -c45-67 | cut -d: -f1)
  12.   do
  13.     # get the PID associated with hacker to be fucked off
  14.     PID=$(netstat -tnpa | grep 'ESTABLISHED' | grep $IP | sed s/"^.*ESTABLISHED "// | cut -d\/ -f1)
  15.  
  16.     # drop the fucker
  17.     iptables -A INPUT -s $IP -j DROP
  18.     # kill the fucker
  19.     kill -9 $PID 2>/dev/null
  20.  
  21.     # record
  22.     echo $IP >> ipban
  23.  
  24.     # announce
  25.     echo "Killing $IP on PID $PID"
  26.   done
  27.  
  28.   # wait a moment and do it all over again
  29.   sleep 2
  30. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement