-
Notifications
You must be signed in to change notification settings - Fork 19
/
showMyPinDates
executable file
·31 lines (30 loc) · 1.28 KB
/
showMyPinDates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
source ./configurationSettings;
IFS=$'\n';
for LINE in $(cat apTargets.txt); do
SSID=$(echo $LINE | awk '{ print $3 }');
CHANNEL=$(echo $LINE | awk '{ print $2 }');
# sed -r s/-.*-// - in case that comment '-----PIN-WAS-FOUND---- is added
# sed s/#// - in case that line is preceded by comment sign
MAC=$(echo $LINE | awk '{ print $1 }' | sed s/#// | sed -r s/-.*-//);
BSSID_CLEAR=$(echo $MAC | sed s/://g | tr '[:lower:]' '[:upper:]');
SESSIONFILE=$REAVER_SESSION_DIR'/'$BSSID_CLEAR'.wpc';
if [[ ! -f "$SESSIONFILE" ]]; then
echo "------- $SSID (Couldn't find session: $SESSIONFILE) ";
continue;
fi
FIRST_PINS=$(sed '1!d' $SESSIONFILE);
SECOND_PINS=$(sed '2!d' $SESSIONFILE);
FIRST_PINS_LINE=$[ $FIRST_PINS + 3 ];
SECOND_PINS_LINE=$[ $SECOND_PINS + 10004 ];
LAST_FIRST_PIN=$(sed "$FIRST_PINS_LINE!d" $SESSIONFILE);
LAST_SECOND_PIN=$(sed "$SECOND_PINS_LINE!d" $SESSIONFILE);
if [[ -z $FIRST_PINS || -z $SECOND_PINS ]]; then
echo "------- $SSID (No checked PINs)";
else
ALL_PINS=$[ $FIRST_PINS+$SECOND_PINS ];
echo "------- $SSID (PINs checked: $ALL_PINS) ---------";
echo "------- LAST CHECKED PIN PARTS: $LAST_FIRST_PIN, $LAST_SECOND_PIN ---------";
fi
./showPinDates $MAC --group-by-day
done;