Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # lint-16800-info.sh -- Dump info from a potfile
- #
- # based on 16800-tail-n1-info.sh from diegodieguex
- # Changes:
- # - Iterate over file
- # - Cleaned up code
- # - Support for 2500 pots as well
- #
- # (C) 2018 Carlos Lint, licensed as MIT.
- #
- if [ -r "$1" ] ; then
- while read LINE ; do
- if [ `echo $LINE | grep -c \*` -gt 0 ]; then
- SEP=\*
- AST=1
- else
- SEP=\:
- AST=0
- fi
- TMP2=`echo "$LINE" | cut -c 34-`
- BSSID=`echo "$TMP2" | cut -d "$SEP" -f1`
- PREC=`echo "$LINE" | cut -c 47-`
- CLIENT=`echo "$PREC" | cut -d "$SEP" -f1`
- TMP3=`echo "$TMP2" | cut -c 27-`
- ESSID=`echo "$TMP3" | cut -d ":" -f1`
- PSK=`echo $LINE | awk 'BEGIN { FS = ":" } ; { print $NF }'`
- echo "VENDOR:\t"`whoismac -m "$BSSID"`
- echo "CLIENT:\t"`whoismac -m "$CLIENT"`
- if [ $AST = 0 ]; then
- echo "ESSID:\t$ESSID"
- else
- echo "ESSID:\t"`echo $ESSID | xxd -r -p`
- fi
- echo -n "PSK:\t"
- echo "$PSK" | awk 'BEGIN { FS = ":" } ; { print $NF }'
- echo -n "COUNT:\t"
- echo "$PSK" | awk '{t+=length($0)}END{print t}'
- echo
- echo
- done < "$1"
- else
- echo "Usage: $0 <potfile>"
- echo
- fi
Add Comment
Please, Sign In to add comment