From c883cdf7c67269a333109644ed379cbad5711a67 Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 30 Apr 2024 17:45:13 -0700 Subject: [PATCH 1/2] daemon: bind to 0.0.0.0 127.0.0.1 is loopback, so rayhunter wasn't accessible via wifi before. --- bin/src/daemon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/src/daemon.rs b/bin/src/daemon.rs index 892e914..4d65521 100644 --- a/bin/src/daemon.rs +++ b/bin/src/daemon.rs @@ -55,7 +55,7 @@ async fn run_server( .route("/", get(|| async { Redirect::permanent("/index.html") })) .route("/*path", get(serve_static)) .with_state(state); - let addr = SocketAddr::from(([127, 0, 0, 1], config.port)); + let addr = SocketAddr::from(([0, 0, 0, 0], config.port)); let listener = TcpListener::bind(&addr).await.unwrap(); task_tracker.spawn(async move { info!("The orca is hunting for stingrays..."); From ea7c3a1467247e6d929660f4ba005d0d96847f1f Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 30 Apr 2024 17:45:48 -0700 Subject: [PATCH 2/2] fix installer script Our build config's changed since this was written, also updated the cargo commands to be a bit more portable. --- install.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index b03e0e0..1d04c35 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,12 @@ -cd serial -cargo build_pc -cd .. -cd rootshell -cargo build --release -cd .. +#!/bin/env bash + +set -e + +cargo build --bin serial +cargo build --bin rootshell --target armv7-unknown-linux-gnueabihf --release + # Force a switch into the debug mode to enable ADB -target/x86_64-unknown-linux-gnu/debug/serial AT +cargo run --bin serial -- AT echo -n "adb enabled, waiting for reboot" until adb shell true 2> /dev/null do @@ -15,11 +16,11 @@ done echo echo "it's alive!" adb push target/armv7-unknown-linux-gnueabihf/release/rootshell /tmp/ -target/x86_64-unknown-linux-gnu/debug/serial "AT+SYSCMD=mv /tmp/rootshell /bin/rootshell" +cargo run --bin serial -- "AT+SYSCMD=mv /tmp/rootshell /bin/rootshell" sleep 1 -target/x86_64-unknown-linux-gnu/debug/serial "AT+SYSCMD=chown root /bin/rootshell" +cargo run --bin serial -- "AT+SYSCMD=chown root /bin/rootshell" sleep 1 -target/x86_64-unknown-linux-gnu/debug/serial "AT+SYSCMD=chmod 4755 /bin/rootshell" +cargo run --bin serial -- "AT+SYSCMD=chmod 4755 /bin/rootshell" echo "we have root!" adb shell /bin/rootshell -c id adb shell '/bin/rootshell -c "mkdir /data/rayhunter"'