diff options
author | lassulus <lass@aidsballs.de> | 2014-12-23 00:31:47 +0100 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2014-12-23 00:31:47 +0100 |
commit | e265640b3427bb8083bc3d28ea58c71d54f895f9 (patch) | |
tree | 1af66093efebf3f2eb8679dd84a9258484f0af46 /recon/inspector_wifi/inspector_wifi | |
parent | 004e3ad3efb6e4bc19604467f4da8b03b28dbbbe (diff) |
wifi_inspector is really inspector_wifi
Diffstat (limited to 'recon/inspector_wifi/inspector_wifi')
-rwxr-xr-x | recon/inspector_wifi/inspector_wifi | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/recon/inspector_wifi/inspector_wifi b/recon/inspector_wifi/inspector_wifi new file mode 100755 index 00000000..bf2297d9 --- /dev/null +++ b/recon/inspector_wifi/inspector_wifi @@ -0,0 +1,108 @@ +#!/bin/sh +# Usage; sudo iwlist wlan0 scan | ./inspector_wifi +# +# +# set -eu + +cd "$(dirname "$(readlink -f "$0")")" +#echo "waiting for iwlist scan data..." >&2 + +crack_wifi(){ + for i in plugins/*;do + if RET=$(./$i "$@" 2>/dev/null);then + if [ ! -z wpa_sup ]; then + make_config $@ $RET + else + echo "$@ - with crack $i succeeded - Key is $RET" + fi + fi + done +} + +make_config(){ + cat<<EOF +network={ + ssid="$1" + psk="$5" +} +EOF + +} + +shell_escape(){ + sed 's/./\\&/g' +} +remove_quotes(){ + sed 's/^"\|"$//g' +} + + +iwlist_scan_parser(){ + count=0 + while read line; + do + case "$line" in + + *"Cell "*) + if [ $count -ne 0 ];then + crack_wifi "$ESSID" $MAC $CHANNEL any_encryption + fi + WPA=0 + WPA2=0 + : $((count+=1)) + MAC=${line#*Address: } + ;; + *Channel:*) + CHANNEL=${line#*:} + ;; + *Quality=*) + QUALITY="`printf '%s' ${line#*Quality=} | cut -d/ -f 1`" + ;; + *"Encryption key:"*) + ENCRYPTION=${line#*key:} + ;; + *ESSID:*) + ESSID=$(echo "${line#*ESSID:}" | remove_quotes) + ;; + *"IE: IEEE 802.11i/WPA2"*) + WPA2=1 + ;; + *"IE: WPA Version 1"*) + WPA=1 + ;; + *);; #important, do not delete! + esac + done; + crack_wifi "$ESSID" $MAC $CHANNEL any_encryption + #echo WIFI_COUNT=$count +} + + +loop_networks(){ + for i in `seq 1 $WIFI_COUNT`; do + loop_over_cracks "$i" + done +} + +wifi_init(){ + iwlist_scan_parser +} + +print_wpa_supplicant(){ + echo "args $@" +} + +while getopts hw OPT; do + case "$OPT" in + h) + echo $USAGE + exit 0 + ;; + w) + wpa_sup=1 + ;; + *) + ;; + esac +done +wifi_init |