diff --git a/.gitignore b/.gitignore index 7be846b..25cffb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target -.vscode \ No newline at end of file +.vscode +.cargo \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index beac500..d3da6f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1552,7 +1552,7 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "frida_vpn" -version = "0.1.6" +version = "0.1.7" dependencies = [ "aes-gcm", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index ed8ba92..2a062a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "frida_vpn" -version = "0.1.6" +version = "0.1.7" edition = "2021" license = "Apache-2.0" authors = ["alterdekim"] @@ -22,7 +22,6 @@ path = "src/main.rs" name = "frida-gui" path = "src/gui/mod.rs" - [dependencies] clap = "2.33" aes-gcm = "0.10.3" diff --git a/build.rs b/build.rs index 1a6c28f..f4995e5 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,6 @@ extern crate embed_resource; fn main() { + #[cfg(target_os = "windows")] embed_resource::compile("tray.rc", embed_resource::NONE); } \ No newline at end of file diff --git a/src/client.rs b/src/client.rs index e4c7e8d..39f18da 100644 --- a/src/client.rs +++ b/src/client.rs @@ -291,7 +291,7 @@ pub mod desktop { 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("route") .arg("del") @@ -303,7 +303,7 @@ pub mod desktop { 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("-4") .arg("route") @@ -315,10 +315,10 @@ pub mod desktop { .expect("Failed to execute ip route command."); 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 - ip_output = Command::new("sudo") + ip_output = std::process::Command::new("sudo") .arg("ip") .arg("route") .arg("add") @@ -331,7 +331,7 @@ pub mod desktop { .expect("Failed to make exception for vpns endpoint."); 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")] { - 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()); } diff --git a/src/server.rs b/src/server.rs index 71131a0..56b6c94 100644 --- a/src/server.rs +++ b/src/server.rs @@ -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 mut ip_output = Command::new("iptables") + let mut ip_output = std::process::Command::new("iptables") .arg("-A") .arg("FORWARD") .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)); } - ip_output = Command::new("iptables") + ip_output = std::process::Command::new("iptables") .arg("-A") .arg("FORWARD") .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)); } - ip_output = Command::new("iptables") + ip_output = std::process::Command::new("iptables") .arg("-t") .arg("nat") .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..."); let mut config = tun2::Configuration::default();