mirror of
https://github.com/wismna/HackPi.git
synced 2025-10-03 15:40:16 -04:00
Fingerprinting now only uses setup requests with an non-zero wIndex
This commit is contained in:
15
fingerprint.sh
Normal file → Executable file
15
fingerprint.sh
Normal file → Executable file
@@ -1,15 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# s means Setup,
|
# Analyze USB Setup Request
|
||||||
# 80 means device to host (bmRequestType),
|
# 80 means device to host (bmRequestType)
|
||||||
# 06 means get descriptors (bRequest),
|
# 06 means get descriptors (bRequest)
|
||||||
# 03xx means string descriptors (wValue)
|
# 03xx means string descriptors (wValue)
|
||||||
#WLENGTHS=`cat /tmp/0.mon.out | grep "s 80 06 03" | cut -d " " -f 10`
|
# 0409 means english (wIndex)
|
||||||
WLENGTHS=`dmesg | grep "USB DWC2 REQ 80 06 03" | tee /home/pi/HackPi/usbreq.log | cut -d "]" -f 2 | cut -d " " -f 9`
|
# 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
|
TOTAL=0
|
||||||
COUNTER=0
|
COUNTER=0
|
||||||
for i in $WLENGTHS; do
|
for i in $WLENGTHS; do
|
||||||
if [ "$i" = "00ff" ]; then
|
if [ "$i" = "00ff" ]; then
|
||||||
let COUNTER=COUNTER+1
|
let COUNTER=COUNTER+1
|
||||||
fi
|
fi
|
||||||
let TOTAL=TOTAL+1
|
let TOTAL=TOTAL+1
|
||||||
#echo wLength: $i
|
#echo wLength: $i
|
||||||
|
Reference in New Issue
Block a user