#!/bin/sh # Witch manipulation tool :-) # by Jan Spitalnik # (c) 2003, licensed under General Public License v2 case "$1" in burn) if [ ! $2 ] || [ ! $3 ] then echo "Usage: $0 burn " exit 1 fi echo -n "Burn! witch Burn!..." iptables -I ipac_in -i $3 -s $2 -j DROP iptables -I ipac_out -o $3 -s $2 -j DROP echo "witch named $2 is now just a pile of ash :-)" ;; kick) if [ ! $2 ] then echo "Usage: $0 kick or -a (will ban all recorded witch addresses)" exit 1 fi if [ "$2" == "-a" ] then for mac in `cat /pub/otravne_mac.txt` do echo ${mac} iwpriv wlan1 addmac ${mac} iwpriv wlan1 kickmac ${mac} done exit fi echo -n "Banning witch by MAC addresses..." iwpriv wlan1 addmac $2 iwpriv wlan1 kickmac $2 echo $2 >> /pub/otravne_mac.txt echo "hmm, must have been some modern witch :-)" ;; revive) if [ ! $2 ] || [ ! $3 ] then echo "Usage: $0 revive " exit 1 fi echo -n "Reviving witch named $2..." iptables -D ipac_in -i $3 -s $2 -j DROP iptables -D ipac_out -o $3 -s $2 -j DROP echo "witch is dead, long live the witch" ;; arp) if [ ! $2 ] then IF=wlan1 else IF=$2 fi arp | grep $IF ;; hunt) if [ ! $2 ] then echo "Usage: $0 hunt [interface]" exit 1 fi if [ ! $3 ] then IF=any else IF=$3 fi tcpdump -i $IF "src host $2 || dst host $2" -s 128 ;; *|help) echo "Witch manipulation tool :-)" echo "Usage: $0 {arp|burn|kick|hunt|revive}" exit 1 ;; esac