modified: frida_cli/src/main.rs
modified: frida_client/src/client.rs modified: frida_core/src/config.rs
This commit is contained in:
parent
2e72505cd2
commit
376175f266
@ -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);
|
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,
|
keepalive,
|
||||||
&config.interface.public_key,
|
&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() });
|
config.peers.push(ServerPeer { public_key: cl_cfg.client.public_key.clone(), ip: internal_address.clone() });
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ pub mod desktop {
|
|||||||
let mtu: u16 = 1400;
|
let mtu: u16 = 1400;
|
||||||
config.address(self.client_config.client.address.parse().unwrap())
|
config.address(self.client_config.client.address.parse().unwrap())
|
||||||
.netmask(Ipv4Addr::new(255, 255, 255, 255))
|
.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)
|
.mtu(mtu)
|
||||||
.tun_name("tun0");
|
.tun_name("tun0");
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ pub struct ClientInterface {
|
|||||||
pub struct EndpointInterface {
|
pub struct EndpointInterface {
|
||||||
pub public_key: String,
|
pub public_key: String,
|
||||||
pub endpoint: String,
|
pub endpoint: String,
|
||||||
|
pub internal_gateway: String,
|
||||||
pub keepalive: u8
|
pub keepalive: u8
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ pub struct ClientConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl 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 mut csprng = StdRng::from_entropy();
|
||||||
let secret = StaticSecret::random_from_rng(&mut csprng);
|
let secret = StaticSecret::random_from_rng(&mut csprng);
|
||||||
ClientConfiguration {
|
ClientConfiguration {
|
||||||
@ -108,6 +109,7 @@ impl ClientConfiguration {
|
|||||||
server: EndpointInterface {
|
server: EndpointInterface {
|
||||||
public_key: String::from_str(public_key).unwrap(),
|
public_key: String::from_str(public_key).unwrap(),
|
||||||
endpoint: String::from_str(endpoint).unwrap(),
|
endpoint: String::from_str(endpoint).unwrap(),
|
||||||
|
internal_gateway: String::from_str(internal_gateway).unwrap(),
|
||||||
keepalive
|
keepalive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user