EFForg / rayhunter

Rust tool to detect cell site simulators on an orbic mobile hotspot
GNU General Public License v3.0
19 stars 2 forks source link

HTTP server that serves a pcap file #5

Closed wgreenberg closed 8 months ago

wgreenberg commented 9 months ago

Two main tasks here:

  1. serialize the diag logs so far into a pcap file (https://docs.rs/pcap-file/ looks promising)
  2. a very simple http server (imo just implemented manually via tcp rather than w/ a http framework) that generates/sends the pcap file
cooperq commented 8 months ago

for now I am doing this buy making a link in /var/www/wavehunter/ to /data/wavehunter/wavehunter.pcap but we should actually be able to just list the contents of that directory so we can support multiple pcaps I think.

Either way, we should use the built in HTTP server. No need to roll our own.

wgreenberg commented 8 months ago

thought about this a bit, and i actually think we'll wanna roll an HTTP server and serve the pcap from it for a few reasons:

  1. configuring and interacting w/ wavehunter in a browser is just way more user-friendly than via CLI, and opens the door for all sorts of nice user-facing features (browser-friendly UI, live system stats and logs, etc)
  2. the current setup of statically serving the pcap file as we write to it will cause data races: if a request comes in when we're halfway through writing a new packet, the pcap will be corrupt
  3. natural place to implement live-streaming pcap data via TCP
wgreenberg commented 8 months ago

This implemented in #17