summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-09-27 01:00:45 +0200
committerlassulus <lassulus@googlemail.com>2013-09-27 01:00:45 +0200
commit7823e04b4b3f83f1efcc60f11892714b208db96c (patch)
tree58ed873d41472bd038777327500e4f3dfe80d0e7 /usr
parentfef22e8458d721c665709aa521d03128f30d0d40 (diff)
implement painmode
Diffstat (limited to 'usr')
-rwxr-xr-xusr/bin/autowifi5
-rw-r--r--usr/lib/autowifi/lib/plugin_core3
-rwxr-xr-xusr/lib/autowifi/plugins/11belkin_wps1
-rwxr-xr-xusr/lib/autowifi/plugins/30default_wps1
4 files changed, 8 insertions, 2 deletions
diff --git a/usr/bin/autowifi b/usr/bin/autowifi
index 07786d67..7efcee62 100755
--- a/usr/bin/autowifi
+++ b/usr/bin/autowifi
@@ -4,9 +4,10 @@ cd $(dirname $(readlink -f $0))
interface=${interface:-wlan0}
root=${root:-../../}
-crackdir=$root/usr/lib/autowifi/plugins
+crackdir= $root/usr/lib/autowifi/plugins
wifi_keys=$root/etc/autowifi/wifi_keys
wifi_log=$root/var/log/autowifi.log
+painmode=${painmode:-}
# exists() run_hooks()
. $root/usr/lib/autowifi/lib/core
@@ -104,7 +105,7 @@ loop_over_cracks(){
i=$1
KEY=''
for crack in $(find $crackdir -type f | sort -u); do
- KEY="$(eval root=$root \$crack \"\${ESSID_${i}}\" \"\${MAC_${i}}\" \${FREQ_${i}} \${ENCRYPTION_${i}})"
+ KEY="$(eval root=$root painmode=$painmode \$crack \"\${ESSID_${i}}\" \"\${MAC_${i}}\" \${FREQ_${i}} \${ENCRYPTION_${i}})"
if [ $? -eq 0 ]; then
eval connect \"\${MAC_${i}}\" \"\${ESSID_${i}}\" \${ENCRYPTION_${i}} \"\${KEY}\"
if [ $? -eq 0 ]; then
diff --git a/usr/lib/autowifi/lib/plugin_core b/usr/lib/autowifi/lib/plugin_core
index 1b83b0c3..700d15f8 100644
--- a/usr/lib/autowifi/lib/plugin_core
+++ b/usr/lib/autowifi/lib/plugin_core
@@ -36,3 +36,6 @@ check_vendor_mac(){
done
return 1
}
+check_painmode(){
+ test -n "${painmode:-}" && echo "painmode required">&2 && exit 1
+}
diff --git a/usr/lib/autowifi/plugins/11belkin_wps b/usr/lib/autowifi/plugins/11belkin_wps
index 65e08624..d4eb8e37 100755
--- a/usr/lib/autowifi/plugins/11belkin_wps
+++ b/usr/lib/autowifi/plugins/11belkin_wps
@@ -15,6 +15,7 @@ cd $(dirname $(readlink -f $0))
. ../lib/wps
parse_plugin_args "$@"
+check_painmode
! check_vendor_mac "$VENDOR_MAC" 002275 001CDF 09863B && echo "VENDOR MAC $VENDOR_MAC not affected" && exit 1
diff --git a/usr/lib/autowifi/plugins/30default_wps b/usr/lib/autowifi/plugins/30default_wps
index 7f66d117..ee7195e0 100755
--- a/usr/lib/autowifi/plugins/30default_wps
+++ b/usr/lib/autowifi/plugins/30default_wps
@@ -6,6 +6,7 @@ cd $(dirname $(readlink -f $0))
. ../lib/plugin_core
parse_plugin_args "$@"
+check_painmode
DEFAULT_PIN="${DEFAULT_PIN:-12345670}"
if has_wps "$ENC"; then