Files
rayhunter/rootshell/src/main.rs
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

15 lines
243 B
Rust

use std::process::Command;
use std::os::unix::process::CommandExt;
use std::env;
fn main() {
let mut args = env::args();
// discard argv[0]
let _ = args.next();
Command::new("/bin/bash")
.args(args)
.uid(0)
.gid(0)
.exec();
}