mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-29 17:09:59 -07:00
Cleanup rootshell, add better setup/testing to install script
This commit is contained in:
committed by
Cooper Quintin
parent
8e256b6455
commit
f18b993df3
@@ -1,17 +1,21 @@
|
||||
//! a simple shell for uploading to the orbic device.
|
||||
//!
|
||||
//! It literally just runs bash as UID/GID 0
|
||||
//! It literally just runs bash as UID/GID 0, with special Android GIDs 3003
|
||||
//! (AID_INET) and 3004 (AID_NET_RAW).
|
||||
use std::process::Command;
|
||||
use std::os::unix::process::CommandExt;
|
||||
use std::env;
|
||||
|
||||
use nix::unistd::{Gid, Uid};
|
||||
use nix::unistd::Gid;
|
||||
|
||||
fn main() {
|
||||
let mut args = env::args();
|
||||
|
||||
nix::unistd::setegid(Gid::from_raw(0)).expect("setegid(0) failed");
|
||||
nix::unistd::seteuid(Uid::from_raw(0)).expect("seteuid(0) failed");
|
||||
let gids = &[
|
||||
Gid::from_raw(3003), // AID_INET
|
||||
Gid::from_raw(3004), // AID_NET_RAW
|
||||
];
|
||||
nix::unistd::setgroups(gids).expect("setgroups failed");
|
||||
|
||||
// discard argv[0]
|
||||
let _ = args.next();
|
||||
|
||||
Reference in New Issue
Block a user