Commit Graph

783 Commits

Author SHA1 Message Date
Matthew Garrett
ea84d74f9d Some fixes
Ensure the mode switch works, and handle broken pipe failures. Also handle
devices that are in diag+rndis mode.
2024-01-10 15:13:28 -08:00
Matthew Garrett
4d39248bf9 Add bootstrapping support
Add tools for launching a root shell on the device, and for sending
serial commands to the device. Extend the make.sh script to push those
and configure a root shell. Commands can now be executed as root via:

adb shell rootshell -c \"touch /tmp/test\"

allowing automatic configuration of the tooling.
2024-01-07 19:45:15 -08:00
Cooper Quintin
3d869971d9 Merge pull request #23 from EFForg/landing-page
wavehunter: adds static server, system stats
2024-01-05 16:47:05 -08:00
Cooper Quintin
1b07e3bfeb update readme and scirpts 2024-01-05 16:44:19 -08:00
Cooper Quintin
7a6a61744b update make.sh to release version 2024-01-05 16:22:58 -08:00
Will Greenberg
c3d6227243 index.html: periodically update system stats 2024-01-05 10:55:16 -08:00
Will Greenberg
fe0e84ba18 wavehunter: adds static server, system stats
This commit does a couple things:

1. breaks out the pcap streaming logic into its own module
2. bundles wavehunter/static files into the binary for easy distribution
3. serves those static files
4. serves dynamic json representing system and diag stats

I also threw together the world's ugliest website to display all this.
2024-01-04 19:41:19 -08:00
Cooper Quintin
dea1d17337 Merge pull request #17 from EFForg/http-server
Http server, lots more testing, and more!
2024-01-04 14:10:53 -08:00
Will Greenberg
7037928a6e wavehunter: add route to serve qmdl file
This is easier than pulling files via adb
2024-01-03 11:29:58 -08:00
Will Greenberg
84f2fc1751 wavehunter: add some debug logging for blocking calls
This may come in handy if the read/write loop ever gets stuck.
2024-01-03 11:29:58 -08:00
Will Greenberg
13e0ed2679 Appease clippy 2024-01-03 11:29:58 -08:00
Will Greenberg
65b41bd541 wavehunter: add debug mode
This just runs the server off of a QMDL file, so we can run/test
the server locally w/o the Qualcomm hardware
2024-01-03 11:29:58 -08:00
Will Greenberg
4d80f992ac pcap: fix timestamp values 2024-01-03 11:29:58 -08:00
Will Greenberg
aa0f044b8a wavehunter: split out code into different modules 2024-01-03 11:29:58 -08:00
Will Greenberg
f4caac147b Renaming wavehunter -> orca 2024-01-03 11:29:58 -08:00
Will Greenberg
e20fe92213 Refactor lib/binary into separate crates 2024-01-03 11:29:58 -08:00
Will Greenberg
51fc9eba56 wavehunter: implement HTTP server
The server streams a pcap file to the user in small chunks, so
the memory overhead is extremely small.
2024-01-03 11:29:58 -08:00
Will Greenberg
2a27f04cc1 wavehunter_reader: update to new interfaces 2024-01-03 11:29:58 -08:00
Will Greenberg
f3afda3ce4 pcap: refactor to take Write, rename struct 2024-01-03 11:29:58 -08:00
Will Greenberg
ed1848def6 minor whitespace fixes 2024-01-03 11:29:58 -08:00
Will Greenberg
38f8a78b60 Refactor QMDL and DiagReader for better testing
For the QMDL code, this mostly rewrites the structs to accept generic
types that implement Read and Write, which allows for better unit
testing. Also adds a bunch of unit tests.
2024-01-03 11:29:58 -08:00
Will Greenberg
ef42dfe99f diag_reader: raise parsing/hdlc error handling to caller
This'll let us unit test the reader more easily
2024-01-03 11:29:58 -08:00
Will Greenberg
0f2e4676e5 Refactor error types and add config file parsing
1. Main binary now parses a config toml and uses its paths for the
   output pcap and qmdl files
2. Previously we were relying on DiagDeviceError for several things
   that aren't a diag device. This modularizes that error in a way
   that both improves the error descriptions, and also allows for
   better separation of concerns.
2024-01-03 11:29:58 -08:00
Will Greenberg
59c0a9d944 Use QMDL instead of our custom debug file format
This might be a bit premature, but since we don't seem to be
experiencing any more parsing errors when reading MessagesContainers,
let's switch to outputting a standard QMDL (Qualcomm Mobile
Diagnostic Log) file. This file format is more widely used by tools
like scat, and the only data we lose out on is the container metadata
and non-UserData messages (which we weren't using anyway).
2024-01-03 11:29:58 -08:00
Cooper Quintin
f5a366960f Merge pull request #16 from EFForg/tests
Tests
2024-01-03 09:21:28 -08:00
Will Greenberg
06efa2c114 diag_device: minor fixup 2024-01-02 16:14:10 -08:00
Will Greenberg
20c6e9bf09 diag: slightly improve logs 2023-12-22 12:13:57 -08:00
Will Greenberg
73ed01de62 gstmtap_parser: Add support for NAS messages 2023-12-22 12:13:57 -08:00
Will Greenberg
9fa8284343 Add integration tests for LTE RRC parsing 2023-12-22 12:13:57 -08:00
Will Greenberg
5128f468cf diag_reader: move error handling outside of trait 2023-12-22 12:13:57 -08:00
Will Greenberg
eed983daae diag_device: rm 0 byte read warning 2023-12-22 12:13:51 -08:00
Cooper Quintin
b0855e2af5 Merge pull request #13 from EFForg/scripts
adding init.d scripts and updating makefile
2023-12-16 10:40:32 -08:00
Cooper Quintin
0f6020cc2d updating files to push to /data/wavehunter directory 2023-12-15 16:40:02 -08:00
Cooper Quintin
43a40e02c9 Merge branch 'main' into scripts 2023-12-15 14:38:39 -08:00
Cooper Quintin
746c41ad77 better logging and pid handling 2023-12-15 14:38:32 -08:00
Cooper Quintin
17782b3fa2 Merge pull request #10 from EFForg/gsmtap
Gsmtap
2023-12-15 14:34:24 -08:00
Cooper Quintin
b91f4af0a7 Merge branch 'main' into gsmtap 2023-12-15 14:34:03 -08:00
Cooper Quintin
6b2de86ddf Merge pull request #12 from EFForg/handle-empty-reads
diag_device: handle 0 byte reads
2023-12-15 14:14:23 -08:00
Will Greenberg
85d8526829 diag_device: handle 0 byte reads 2023-12-15 13:21:40 -08:00
Cooper Quintin
9500882ce2 adding init.d scripts and updating makefile 2023-12-14 17:19:13 -08:00
Will Greenberg
d1bb29f6c2 some minor cleanups, comments 2023-12-14 12:29:06 -08:00
Will Greenberg
f99d0897eb wavehunter and wavehunter-reader now output pcap files 2023-12-14 11:48:30 -08:00
Will Greenberg
fd5d01ad1f Switch to using log crate macros 2023-12-14 11:48:30 -08:00
Will Greenberg
d6266db1b9 Add GSMTAP parsing and PcapNg file writing 2023-12-14 11:48:30 -08:00
Cooper Quintin
20a31a05bd Merge pull request #9 from EFForg/failsafe
Debug logging, rename to Wave Hunter
2023-12-14 11:31:41 -08:00
Will Greenberg
557de415d7 More reorganization, renamed to Wave Hunter 2023-12-13 16:51:55 -08:00
Will Greenberg
69d40a766a some renaming, reorganization 2023-12-13 16:51:55 -08:00
Will Greenberg
0187fa51e8 rename failsafe mode to debug mode 2023-12-13 16:51:55 -08:00
Will Greenberg
6cc22c3863 exit failsafe_reader if incorrect args are supplied 2023-12-13 16:51:55 -08:00
Will Greenberg
2504a1da2e add failsafe writer and reader 2023-12-13 16:51:55 -08:00