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
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
target
|
||||
.vscode
|
||||
.vscode
|
||||
.cargo
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"
|
||||
|
1
build.rs
1
build.rs
@ -1,5 +1,6 @@
|
||||
extern crate embed_resource;
|
||||
|
||||
fn main() {
|
||||
#[cfg(target_os = "windows")]
|
||||
embed_resource::compile("tray.rc", embed_resource::NONE);
|
||||
}
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user