efforg/rayhunter#547

View on GitHub →
#547 Running rayhunter on nethunter devices
new-hardware

I was curious about running rayhunter on a rooted nethunter device (OnePlus 6 A6003) as I knew it provides a /dev/diag device. I already used it in combination with qcsuper. For anyone interested in the procedure I write the steps to install rayhunter on the device:

1. build the rayhunter-daemon

the musl build will be used to avoid dynamic linking which might not work depending on the nethunter version you are running.

cd daemon/web
npm install
npm run build

rustup target add aarch64-unknown-linux-musl                                                                                                                                                                           cargo build --bin rayhunter-daemon --release --target aarch64-unknown-linux-musl

2. move the binary to the device

scp ./target/aarch64-unknown-linux-musl/release/rayhunter-daemon root@<IP>:/usr/local/bin/

make shure the binary is executable on the device:

chmod +x /usr/local/bin/rayhunter-daemon

3. create a config file (which is needed for the rayhunter-daemon to run)

create something like ./config.toml and move it to the device the webinterface will be available at the configured ip:port

4. run the daemon

now you can run the daemon using the terminal app of nethunter oder create a custom command in the nethunter app. (prefered)

label: rayhunter

command: /usr/local/bin/rayhunter-daemon /sdcard/rayhunter/config.toml

send to: kali

exec mode: background

runonboot: as you prefer

if you create a custom command you can also enshure the application is started on boot.

I made the needed changes in my fork of the project but didnt add support for automatic deployment via the install routine. If you are interested in adding it to the installer I will have a look after it. Im quite shure this will work for a lot of nethunter installations (with root privilage). So maybe a generic solution is possible.

1👍 2
Comments (2)

I see a few different things that could be upstreamed:

  • pre-built binaries for aarch64, I don’t think we have those for rayhunter-daemon
  • Whatever modifications you needed to make to the project (to the daemon binary?) – we can put these behind a device config flag as we already have for other devices.
  • Adding some instructions to the docs for this device
  • Adding an actual installer to the docs, though I guess it wouldn’t actually root the device and just create some files on the device itself? I think the Pinephone installer already works like that.

I don’t know enough about nethunter but it could be nice to also figure out an installation routine that works on the OnePlus if nethunter is not installed?

1

I’m attempting on Oneplus 7t. I’m getting “failed to initialize /dev/diag”. Do I need to use qcsuper?

1