modified: frida_cli/src/main.rs

modified:   frida_client/src/client.rs
	modified:   frida_core/src/config.rs
This commit is contained in:
Michael Wain 2025-01-03 00:15:23 +03:00
parent 2e72505cd2
commit 376175f266
3 changed files with 7 additions and 4 deletions

View File

@ -42,10 +42,11 @@ fn generate_peer_config(matches: &ArgMatches, config_path: &str, cfg_raw: &Strin
internal_address = Ipv4Addr::new(internal_address.octets()[0], internal_address.octets()[1], internal_address.octets()[2], internal_address.octets()[3]+1);
let cl_cfg = &ClientConfiguration::default(if grab_endpoint { &config.interface.bind_address } else { endpoint },
let cl_cfg = &ClientConfiguration::default(&config.interface.bind_address.clone(),
keepalive,
&config.interface.public_key,
&internal_address.to_string());
&internal_address.to_string(),
&config.interface.internal_address.clone());
config.peers.push(ServerPeer { public_key: cl_cfg.client.public_key.clone(), ip: internal_address.clone() });

View File

@ -316,7 +316,7 @@ pub mod desktop {
let mtu: u16 = 1400;
config.address(self.client_config.client.address.parse().unwrap())
.netmask(Ipv4Addr::new(255, 255, 255, 255))
.destination(Ipv4Addr::new(10, 66, 66, 1))
.destination(self.client_config.server.internal_gateway.parse().unwrap())
.mtu(mtu)
.tun_name("tun0");

View File

@ -86,6 +86,7 @@ pub struct ClientInterface {
pub struct EndpointInterface {
pub public_key: String,
pub endpoint: String,
pub internal_gateway: String,
pub keepalive: u8
}
@ -96,7 +97,7 @@ pub struct ClientConfiguration {
}
impl ClientConfiguration {
pub fn default(endpoint: &str, keepalive: u8, public_key: &str, internal_address: &str) -> Self {
pub fn default(endpoint: &str, keepalive: u8, public_key: &str, internal_address: &str, internal_gateway: &str) -> Self {
let mut csprng = StdRng::from_entropy();
let secret = StaticSecret::random_from_rng(&mut csprng);
ClientConfiguration {
@ -108,6 +109,7 @@ impl ClientConfiguration {
server: EndpointInterface {
public_key: String::from_str(public_key).unwrap(),
endpoint: String::from_str(endpoint).unwrap(),
internal_gateway: String::from_str(internal_gateway).unwrap(),
keepalive
}
}