⚲
Project
General
Profile
Sign in
Register
Home
Projects
Search
:
CHIRP
All Projects
CHIRP
Home
Download
Documentation
Activity
Issues
Repository
Download (649 Bytes)
DevelopersUSB Sniffing in Linux
» start_trace.sh
capture script -
Daniel Clemmensen
, 02/24/2019 10:02 AM
#! /bin/bash
# Copyright (c) 2019 Dan Clemmensen, licensed to you under GPL v3.
#
# find the correct USB serial port device and run tshark on its usbmon,
# to capture the interactions into cap.pcap.
# this script take one parameter: the device id (as 4 hex digits).
# for example one Prolific device has an ID of 067b
# We use this apporach because the bus and device numbers can
# change when you plug and unplug the USB connector.
#
# must run as root
#
devstr
=
$(
lsusb
-d
$1
: |
tr
-d
":"
)
words
=(
$devstr
)
bus
=
${
words
[1]#0
}
dev
=
${
words
[3]#0
}
bus
=
$((
$bus
-
0
))
echo
" Starting capture on USB
$bus
, device
$dev
"
tshark - i usbmon
$bus
-w
cap.pcap
« Previous
1
2
3
Next »
(2-2/3)
Loading...