The script is also very simple and elegant.
#!/bin/bash
while [ 1 ] ;
echo "started" ;
do IP=`nc -v -l -p 2222 2>&1 1> /dev/null | grep from | cut -d[ -f 3 | cut -d] -f 1`;
iptables -A INPUT -p tcp -s ${IP} -j DROP ;
done
echo "started" ;
do IP=`nc -v -l -p 2222 2>&1 1> /dev/null | grep from | cut -d[ -f 3 | cut -d] -f 1`;
iptables -A INPUT -p tcp -s ${IP} -j DROP ;
done
Good Stuff from John Strand and the pauldotcom crew for comming up with something so simple, yet so elegant and usefull.
Resources/Good Reading:
http://pauldotcom.com/wiki/index.php/Episode204
http://pauldotcom.com/wiki/index.php/Episode204
No comments:
Post a Comment