Fingerprinting now only uses setup requests with an non-zero wIndex

This commit is contained in:
2017-04-21 12:11:00 -04:00
parent 990047ce80
commit 7e556db114

13
fingerprint.sh Normal file → Executable file
View File

@@ -1,10 +1,13 @@
#!/bin/bash
# s means Setup,
# 80 means device to host (bmRequestType),
# 06 means get descriptors (bRequest),
# Analyze USB Setup Request
# 80 means device to host (bmRequestType)
# 06 means get descriptors (bRequest)
# 03xx means string descriptors (wValue)
#WLENGTHS=`cat /tmp/0.mon.out | grep "s 80 06 03" | cut -d " " -f 10`
WLENGTHS=`dmesg | grep "USB DWC2 REQ 80 06 03" | tee /home/pi/HackPi/usbreq.log | cut -d "]" -f 2 | cut -d " " -f 9`
# 0409 means english (wIndex)
# wLength is the size of the descriptor and this is what we want
LOGFILE=/home/pi/HackPi/usbreq.log
dmesg | grep "USB DWC2 REQ 80 06 03" | tee $LOGFILE
WLENGTHS=`awk '$9!="0000" { print $10 }' $LOGFILE`
TOTAL=0
COUNTER=0
for i in $WLENGTHS; do