Small changes for linux
modified: .gitignore modified: Cargo.lock modified: Cargo.toml modified: build.rs modified: src/client.rs modified: src/server.rs
This commit is contained in:
parent
8402b5d15d
commit
82ae8e3d39
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
target
|
target
|
||||||
.vscode
|
.vscode
|
||||||
|
.cargo
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1552,7 +1552,7 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "frida_vpn"
|
name = "frida_vpn"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "frida_vpn"
|
name = "frida_vpn"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
authors = ["alterdekim"]
|
authors = ["alterdekim"]
|
||||||
@ -22,7 +22,6 @@ path = "src/main.rs"
|
|||||||
name = "frida-gui"
|
name = "frida-gui"
|
||||||
path = "src/gui/mod.rs"
|
path = "src/gui/mod.rs"
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
aes-gcm = "0.10.3"
|
aes-gcm = "0.10.3"
|
||||||
|
1
build.rs
1
build.rs
@ -1,5 +1,6 @@
|
|||||||
extern crate embed_resource;
|
extern crate embed_resource;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
embed_resource::compile("tray.rc", embed_resource::NONE);
|
embed_resource::compile("tray.rc", embed_resource::NONE);
|
||||||
}
|
}
|
@ -291,7 +291,7 @@ pub mod desktop {
|
|||||||
|
|
||||||
info!("Main network interface: {:?}", inter_name);
|
info!("Main network interface: {:?}", inter_name);
|
||||||
|
|
||||||
/*let mut ip_output = Command::new("sudo")
|
/*let mut ip_output = std::process::Command::new("sudo")
|
||||||
.arg("ip")
|
.arg("ip")
|
||||||
.arg("route")
|
.arg("route")
|
||||||
.arg("del")
|
.arg("del")
|
||||||
@ -303,7 +303,7 @@ pub mod desktop {
|
|||||||
error!("Failed to delete default gateway: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
error!("Failed to delete default gateway: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
let mut ip_output = Command::new("sudo")
|
let mut ip_output = std::process::Command::new("sudo")
|
||||||
.arg("ip")
|
.arg("ip")
|
||||||
.arg("-4")
|
.arg("-4")
|
||||||
.arg("route")
|
.arg("route")
|
||||||
@ -315,10 +315,10 @@ pub mod desktop {
|
|||||||
.expect("Failed to execute ip route command.");
|
.expect("Failed to execute ip route command.");
|
||||||
|
|
||||||
if !ip_output.status.success() {
|
if !ip_output.status.success() {
|
||||||
error!("Failed to route all traffic: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
log::error!("Failed to route all traffic: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}
|
}
|
||||||
// TODO: replace 192.168.0.1 with relative variable
|
// TODO: replace 192.168.0.1 with relative variable
|
||||||
ip_output = Command::new("sudo")
|
ip_output = std::process::Command::new("sudo")
|
||||||
.arg("ip")
|
.arg("ip")
|
||||||
.arg("route")
|
.arg("route")
|
||||||
.arg("add")
|
.arg("add")
|
||||||
@ -331,7 +331,7 @@ pub mod desktop {
|
|||||||
.expect("Failed to make exception for vpns endpoint.");
|
.expect("Failed to make exception for vpns endpoint.");
|
||||||
|
|
||||||
if !ip_output.status.success() {
|
if !ip_output.status.success() {
|
||||||
error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
log::error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ pub mod desktop {
|
|||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
let s_a: SocketAddr = self.client_config.server.endpoint.parse().unwrap();
|
let s_a: std::net::SocketAddr = self.client_config.server.endpoint.parse().unwrap();
|
||||||
configure_routes(&s_a.ip().to_string(), self.s_interface.clone());
|
configure_routes(&s_a.ip().to_string(), self.s_interface.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ fn configure_routes(s_interface: Option<&str>) {
|
|||||||
|
|
||||||
let inter_name = if s_interface.is_some() { s_interface.unwrap() } else { &net_inter.name };
|
let inter_name = if s_interface.is_some() { s_interface.unwrap() } else { &net_inter.name };
|
||||||
|
|
||||||
let mut ip_output = Command::new("iptables")
|
let mut ip_output = std::process::Command::new("iptables")
|
||||||
.arg("-A")
|
.arg("-A")
|
||||||
.arg("FORWARD")
|
.arg("FORWARD")
|
||||||
.arg("-i")
|
.arg("-i")
|
||||||
@ -45,7 +45,7 @@ fn configure_routes(s_interface: Option<&str>) {
|
|||||||
error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}
|
}
|
||||||
|
|
||||||
ip_output = Command::new("iptables")
|
ip_output = std::process::Command::new("iptables")
|
||||||
.arg("-A")
|
.arg("-A")
|
||||||
.arg("FORWARD")
|
.arg("FORWARD")
|
||||||
.arg("-i")
|
.arg("-i")
|
||||||
@ -65,7 +65,7 @@ fn configure_routes(s_interface: Option<&str>) {
|
|||||||
error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
error!("Failed to forward packets: {:?}", String::from_utf8_lossy(&ip_output.stderr));
|
||||||
}
|
}
|
||||||
|
|
||||||
ip_output = Command::new("iptables")
|
ip_output = std::process::Command::new("iptables")
|
||||||
.arg("-t")
|
.arg("-t")
|
||||||
.arg("nat")
|
.arg("nat")
|
||||||
.arg("-A")
|
.arg("-A")
|
||||||
@ -82,7 +82,7 @@ fn configure_routes(s_interface: Option<&str>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn server_mode(server_config: ServerConfiguration, _s_interface: Option<&str>) {
|
pub async fn server_mode(server_config: ServerConfiguration, s_interface: Option<&str>) {
|
||||||
info!("Starting server...");
|
info!("Starting server...");
|
||||||
|
|
||||||
let mut config = tun2::Configuration::default();
|
let mut config = tun2::Configuration::default();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user