modified: Cargo.lock
modified: frida_client/Cargo.toml modified: frida_client/src/client.rs modified: frida_core/Cargo.toml
This commit is contained in:
parent
ddbefcc0dc
commit
a81d0a2bf1
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -1668,7 +1668,7 @@ dependencies = [
|
|||||||
"env_logger",
|
"env_logger",
|
||||||
"frida_core",
|
"frida_core",
|
||||||
"log",
|
"log",
|
||||||
"network-interface",
|
"regex",
|
||||||
"tokio 1.42.0",
|
"tokio 1.42.0",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"x25519-dalek",
|
"x25519-dalek",
|
||||||
@ -1696,7 +1696,6 @@ dependencies = [
|
|||||||
"jni 0.20.0",
|
"jni 0.20.0",
|
||||||
"log",
|
"log",
|
||||||
"log4rs",
|
"log4rs",
|
||||||
"network-interface",
|
|
||||||
"nonblock",
|
"nonblock",
|
||||||
"packet",
|
"packet",
|
||||||
"rand",
|
"rand",
|
||||||
@ -2961,18 +2960,6 @@ dependencies = [
|
|||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "network-interface"
|
|
||||||
version = "2.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "433419f898328beca4f2c6c73a1b52540658d92b0a99f0269330457e0fd998d5"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
"winapi 0.3.9",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.29.0"
|
version = "0.29.0"
|
||||||
|
@ -20,4 +20,4 @@ tokio = { version = "1", features = ["full", "signal", "tracing"] }
|
|||||||
tokio-util = "0.7.12"
|
tokio-util = "0.7.12"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
log = "0.4.20"
|
log = "0.4.20"
|
||||||
network-interface = "2.0.0"
|
regex = "1.11.1"
|
@ -201,34 +201,54 @@ pub mod desktop {
|
|||||||
use tokio::net::UdpSocket;
|
use tokio::net::UdpSocket;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use network_interface::{NetworkInterface, NetworkInterfaceConfig};
|
use regex::Regex;
|
||||||
|
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn configure_routes(endpoint_ip: &str) {
|
fn configure_routes(endpoint_ip: &str) {
|
||||||
let interfaces = NetworkInterface::show().unwrap();
|
let mut if_out = std::process::Command::new("ip")
|
||||||
|
.arg("-4")
|
||||||
|
.arg("route")
|
||||||
|
.arg("show")
|
||||||
|
.arg("default")
|
||||||
|
.output()
|
||||||
|
.expect("Failed to get default route");
|
||||||
|
|
||||||
let net_inter = interfaces.iter()
|
if !if_out.status.success() {
|
||||||
.filter(|i| !i.addr.iter().any(|b| b.ip().to_string() == "127.0.0.1" || b.ip().to_string() == "::1") )
|
log::error!("Failed to execute ip route command: {:?}", String::from_utf8_lossy(&if_out.stderr));
|
||||||
.min_by(|x, y| x.index.cmp(&y.index))
|
}
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
info!("Main interface: {:?}", net_inter);
|
let r = if_out.stdout;
|
||||||
|
|
||||||
let inter_name = net_inter.name.clone();
|
let gateway = None;
|
||||||
|
let if_name = None;
|
||||||
|
|
||||||
info!("Main network interface: {:?}", inter_name);
|
let rg = Regex::new(r"default via .+ dev ").unwrap();
|
||||||
|
|
||||||
|
if let Some(m) = rg.find(r) { // gateway
|
||||||
|
gateway = Some(&m.as_str()[12..m.len()-4]);
|
||||||
|
}
|
||||||
|
|
||||||
|
let rg = Regex::new(r"dev .+ proto").unwrap();
|
||||||
|
if let Some(m) = rg.find(r) { // name
|
||||||
|
if_name = Some(&m.as_str()[4..m.len()-6]);
|
||||||
|
}
|
||||||
|
|
||||||
|
info!("Main interface: {:?}", &if_name.unwrap());
|
||||||
|
|
||||||
|
let inter_name = if_name.unwrap();
|
||||||
|
|
||||||
|
info!("Main network interface: {:?}", &gateway.unwrap());
|
||||||
|
|
||||||
/*
|
|
||||||
let mut ip_output = std::process::Command::new("sudo")
|
let mut ip_output = std::process::Command::new("sudo")
|
||||||
.arg("route")
|
.arg("route")
|
||||||
.arg("add")
|
.arg("add")
|
||||||
.arg("-host")
|
.arg("-host")
|
||||||
.arg(endpoint_ip)
|
.arg(endpoint_ip)
|
||||||
.arg("gw")
|
.arg("gw")
|
||||||
.arg() // default interface gateway
|
.arg(&gateway.unwrap()) // default interface gateway
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg() // default interface
|
.arg(&inter_name) // default interface
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute route command.");
|
.expect("Failed to execute route command.");
|
||||||
|
|
||||||
@ -242,7 +262,7 @@ pub mod desktop {
|
|||||||
.arg("add")
|
.arg("add")
|
||||||
.arg("0.0.0.0/0")
|
.arg("0.0.0.0/0")
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg() // tun adapter name
|
.arg("tun0") // tun adapter name
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute ip route command.");
|
.expect("Failed to execute ip route command.");
|
||||||
|
|
||||||
@ -256,7 +276,7 @@ pub mod desktop {
|
|||||||
.arg("add")
|
.arg("add")
|
||||||
.arg("128.0.0.0/1")
|
.arg("128.0.0.0/1")
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg() // tun adapter name
|
.arg("tun0") // tun adapter name
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute ip route command.");
|
.expect("Failed to execute ip route command.");
|
||||||
|
|
||||||
@ -270,16 +290,15 @@ pub mod desktop {
|
|||||||
.arg("-host")
|
.arg("-host")
|
||||||
.arg(endpoint_ip)
|
.arg(endpoint_ip)
|
||||||
.arg("gw")
|
.arg("gw")
|
||||||
.arg() // default interface gateway
|
.arg(&gateway.unwrap()) // default interface gateway
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg() // default interface
|
.arg(&inter_name) // default interface
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute route command.");
|
.expect("Failed to execute route command.");
|
||||||
|
|
||||||
if !ip_output.status.success() {
|
if !ip_output.status.success() {
|
||||||
log::error!("Failed to execute route command: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
log::error!("Failed to execute route command: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DesktopClient {
|
pub struct DesktopClient {
|
||||||
|
@ -33,7 +33,6 @@ x25519-dalek = { version = "2.0.1", features = ["getrandom", "static_secrets"] }
|
|||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
chrono = "0.4.38"
|
chrono = "0.4.38"
|
||||||
console-subscriber = "0.4.0"
|
console-subscriber = "0.4.0"
|
||||||
network-interface = "2.0.0"
|
|
||||||
tun = { version = "0.7.5", features = ["async"] }
|
tun = { version = "0.7.5", features = ["async"] }
|
||||||
|
|
||||||
[target.'cfg(target_os="windows")'.dependencies]
|
[target.'cfg(target_os="windows")'.dependencies]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user