summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2014-12-23 00:29:00 +0100
committerlassulus <lass@aidsballs.de>2014-12-23 00:29:00 +0100
commit004e3ad3efb6e4bc19604467f4da8b03b28dbbbe (patch)
tree6e65ca80c2765a2b2ba4d5fe19bba3f8e882e6c6
parent3a7a49b9bda4b2df849db827c61aa347a68a96be (diff)
./inspector_wifi -w for wpa_supplicant output
-rwxr-xr-xrecon/wifi_inspector/inspector_wifi47
1 files changed, 40 insertions, 7 deletions
diff --git a/recon/wifi_inspector/inspector_wifi b/recon/wifi_inspector/inspector_wifi
index 06f37ddb..bf2297d9 100755
--- a/recon/wifi_inspector/inspector_wifi
+++ b/recon/wifi_inspector/inspector_wifi
@@ -2,19 +2,33 @@
# Usage; sudo iwlist wlan0 scan | ./inspector_wifi
#
#
-set -eu
+# set -eu
cd "$(dirname "$(readlink -f "$0")")"
-echo "waiting for iwlist scan data..." >&2
+#echo "waiting for iwlist scan data..." >&2
crack_wifi(){
for i in plugins/*;do
if RET=$(./$i "$@" 2>/dev/null);then
- echo "$@ - with crack $i succeeded - Key is $RET"
+ 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'
}
@@ -60,16 +74,35 @@ iwlist_scan_parser(){
esac
done;
crack_wifi "$ESSID" $MAC $CHANNEL any_encryption
- echo WIFI_COUNT=$count
+ #echo WIFI_COUNT=$count
}
-wifi_init(){
- iwlist_scan_parser
-}
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