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

Add bootstrapping support #30

Closed mjg59 closed 7 months ago

mjg59 commented 8 months ago

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.

mjg59 commented 8 months ago

Enables https://github.com/EFForg/wavehunter/issues/27

mjg59 commented 8 months ago

This requires tools for the host architecture and also the target architecture, and I'm not familiar enough with Rust cross-building to know how to set that up

wgreenberg commented 8 months ago

thanks @mjg59! i have a few nitpicky idiomatic rust comments if that'd be helpful, though np if not.

re: cross building, i think the .cargo/config.toml file is a pretty convenient place to configure this. maybe we make one per crate, each specifying that crate's desired architecture?

currently we have one such config at the workspace root, which annoyingly will override any sub-crate configs if you run cargo build in the root. so we'd have to descend into each crate and run cargo build if we do this. alternately, we can just run cargo build --bin <crate name> --target=<whatever> for each target

mjg59 commented 7 months ago

This is my first attempt at writing Rust, please do give me guidance on idioms!

mjg59 commented 7 months ago

Still need to work out building the serial tool for the host architecture (and probably also not hardcoding the host architecture) - possibly also want to split the rooting stuff out into a separate script?

cooperq commented 7 months ago

I know @mjg59 still wants to build out to support more host architectures which I think is worthwhile but for now I have cleaned up the script and separated into install and build scripts and I think this is ready for a merge since it's important now that we have more contributors.

cooperq commented 7 months ago

@wgreenberg this is ready for your review.