mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-12 15:53:30 -07:00
rootshell: use magic Android GIDs to access sockets
Android kernels with CONFIG_ANDROID_PARANOID_NETWORK extensions set require users to have a few special group IDs before getting network access. Unfortunately, we need to use nightly to get access to the .groups() method.
This commit is contained in:
committed by
Cooper Quintin
parent
25fa4aa0c1
commit
0237cb799b
@@ -32,7 +32,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
targets: armv7-unknown-linux-gnueabihf
|
||||
- name: Install cross-compilation dependencies
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[toolchain]
|
||||
channel = "nightly"
|
||||
@@ -1,3 +1,5 @@
|
||||
#![feature(setgroups)]
|
||||
|
||||
//! a simple shell for uploading to the orbic device.
|
||||
//!
|
||||
//! It literally just runs bash as UID/GID 0
|
||||
@@ -5,6 +7,14 @@ use std::process::Command;
|
||||
use std::os::unix::process::CommandExt;
|
||||
use std::env;
|
||||
|
||||
const ANDROID_PARANOID_NETWORK_GROUPS: &[u32] = &[
|
||||
3001, // AID_BT
|
||||
3002, // AID_BT_NET
|
||||
3003, // AID_INET
|
||||
3004, // AID_NET_RAW
|
||||
3005, // AID_ADMIN
|
||||
];
|
||||
|
||||
fn main() {
|
||||
let mut args = env::args();
|
||||
|
||||
@@ -14,5 +24,6 @@ fn main() {
|
||||
.args(args)
|
||||
.uid(0)
|
||||
.gid(0)
|
||||
.groups(ANDROID_PARANOID_NETWORK_GROUPS)
|
||||
.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user