target data file to load = ./recorded_data/benign1.data
8 fold record data has been loaded.
Detection result : False
DTW distance: 5.0
target data file to load = ./recorded_data/benign2.data
8 fold record data has been loaded.
Detection result : False
DTW distance: 5.0
target data file to load = ./recorded_data/malicious1.data
8 fold record data has been loaded.
Detection result : True
DTW distance: 0.0
target data file to load = ./recorded_data/malicious2.data
8 fold record data has been loaded.
Detection result : True
DTW distance: 0.0 SnoopDog\
βββ artifact\
β βββ detector\ <- Source codes for Detector
β β βββ recorded_data\
β β β βββ benign1.data
β β β βββ benign2.data
β β β βββ malicious1.data
β β β βββ malicious2.data
β β βββ rtl_power_library\
β β β βββ rtl-sdr\ <- library for rtl-sdr device
β β β βββ README.md
β β βββ requirements.txt
β β βββ client.py
β β βββ detect_with_recorded_data.py
β β βββ detector.py
β β βββ pyrtl_power.py
β βββ server\ <- Source codes for Server
β β βββ BaitPacketTransmitter.py
β β βββ Server.py
β βββ Iso image
β β βββ download_iso.sh
β βββ detector.zip <-- same as detector folder
β βββ server.zip <-- same as server folder
βββ claim\
β βββ claim1\
β βββ recorded_data\
β β βββ benign1.data
β β βββ benign2.data
β β βββ malicious1.data
β β βββ malicious2.data
β βββ expected output.txt
β βββ requirements.txt
β βββ run.sh
β βββ snoopdog_detector.py
βββ infrastructure\
β βββ colab_link.txt
βββ README.md
-
client.py
Communication codes to send/receive commands from/to Host PC
-
detect_with_recorded_data.py
Source code for detector including detection method in the paper. This program takes raw measurement of EMR signals from the USB device for detection.
For details, please go to "Run Snoopdog with recorded data"
-
detector.py Source code for detector including detection method in the paper. This program requires real-world hardware environment.
-
server.py
Source code for Host PC including communication codes.
-
BaitPacketTransmitter.py
Source code for transmitting bait traffic to Host PC.
- Raspberry Pi 4b or later with USB gadget functionallity
- Auxiliary power for Raspberry Pi
- RTL-SDR
- Near-Field probe
Example of the detector hardware
Note: We use Pisugar external battery to power our RPi.
The power from USB connection from Host PC might be insufficient to operate the detector based on our experience.- Python 3.12 or later
- numpy
- scipy
- fastdtw
- Radio pi
- Python 3.12 or later
- RNDIS driver (if the detector is not recognized)
We provide two setup options:
- Use iso image and flash to your RPi SD card to duplicate our detector.
- Use your RPi and bring up manually.
- Navigate to Iso image
cd artifact/Iso image/- Download Snoopdog.img (the size of the image file is 12Gb)
bash ./run.shor
wget -c -O snoopdog.iso https://tinyurl.com/4pphfmb9- burn image into sdcard
Β Β Β Β Β Β for linux for Mac, use dd command
1. Find your sdcard in your linux system. (you may use 'lsblk')
2. Use dd to copy snoopdog.img to your sdcard.
sudo dd if=/dev/<your sdcard> of=snoopdog.img bs=4M status=progress conv=fsyncΒ Β Β Β Β Β for Windows, you may use rufus
Β Β Β Β Β Β Download rufus
Β Β Β Β Β Β Select your sd card and select snoopdog.img
Β Β Β Β Β Β Click start button
- plug your copied sdcard into your raspberry pi.
- Download pisdr image on your SD card you may use dd or rufus
sudo dd if=/dev/<your sdcard> of=pisdr.img bs=4M status=progress conv=fsyncΒ Β Β Β Β Β replace 'pisdr.img' with the actuall file name of the iso file downloaded from pisdr
- Boot up your raspberry pi and access it using ssh for default ID/passwd check pisdr.
- install or check python 3.12
- Download our detector source codes
wget https://github.com/MobiSec-CSE-UTA/SnoopDog/tree/main/artifact/detector.zip
unzip ~/detector.zip- install requirements
cd ~/detector
python -m pip install -r requirements.txt- enable USB gadget g_ether
-
Open Terminal on the RPi.
-
Open the file
/boot/config.txt. -
Add the following line:
dtoverlay=dwc2
-
Save and exit the file.
-
Navigate to
/boot/cmdline.txt. -
Add the following text at the end of the line, after
rootwait:modules-load=dwc2,g_ether
-
Save and exit the file.
-
open /etc/dhcpcd.conf file.
-
add following lines
interface usb0 static ip_address=192.168.7.2
-
Save and exit the file.
-
reboot your raspberry pi
- Download Our project for Host PC
wget https://github.com/MobiSec-CSE-UTA/SnoopDog/tree/main/artifact/server.zip
unzip server.zip
cd hostFollow these instructions only if your PC cannot recognize the RPi.
- Download the RNDIS driver from Microsoft Update Catalog.
- Open Device Manager β navigate to Other drivers β RNDIS/Ethernet Gadget β right-click and select Update Driver Software.
- Choose the file downloaded in step 1.
- Reboot and reconnect all systems.
- The RPi will appear as a network interface automatically.
The detector should be recognized as a network interface when it is attached to Host PC.
Please follow the diagram above to connect the detector, a USB hub and Host PC.
Upon connecting the detector & hub,
- Locate the ipaddress of Host PC
for Windows, open Powershell/CMD β 'ipconfig'
for linux and Mac, open terminal β 'ifconfig'If the SnoopDog detector is properly recognized, then your Host PC optains an ip address from the detector. The ipaddress should be 192.168.7.xxx, the 'xxx' octet represents the Host PC
- Run snoopdog server on Host PC
python server.py -p 5050- Open terminal and connect to the detector using ssh.
ssh snoopdog@192.168.7.2the password is 'raspberry'
- Run snoopdog_detector.py
python ./snoopdog_detector.py -i 192.168.7.<replace with your Host ip addrss> -p 5050- The program will display the result.
For users who do not have the required hardware/environment for SnoopDog, We provide a recorded raw EMR data to test SnoopDog.
- Python 3.12 or later
- Ubuntu 22.04
- Clone this repo
- Run install.sh with sudo
cd Snoopdog
chmod +x ./install.sh
sudo ./install.sh- Activate venv and navigate to the folder for claim1
source Snoopdog/bin/activate
cd ./claims/claim1/- Run run.sh
chmod +x ./run.sh
./run.shPlease follow the steps mentioned here:
- Download and unzip detector.zip by
wget https://github.com/MobiSec-CSE-UTA/SnoopDog/tree/main/artifact/detector.zip
unzip detector.zip- Navigate into the detector folder
cd detector- Run code To test recorded data from a malicious sniffer
python ./snoopdog_detect_with_recorded_data.py -d ./recorded_data/malicious1.dataTo test recorded data from a benign device.
python ./snoopdog_detect_with_recorded_data.py -d ./recorded_data/malicious1.dataOr you may run without designation of the file.
python ./snoopdog_detect_with_recorded_data.pyin this case, the program will ask which option you want to test.

