fix: fixed weird issues with querying routes
this just involved a better understanding of the data types provided by libnl and some refactoring to make querying as a user of the libnl library easier
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
[package]
|
||||
name = "server"
|
||||
name = "ex-revshell-server"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.70"
|
||||
@@ -1,3 +1,19 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::net::UdpSocket;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let input = UdpSocket::bind("0.0.0.0:54248")?;
|
||||
|
||||
loop {
|
||||
let mut buf = [0u8; 4];
|
||||
|
||||
let Ok((amount, src)) = input.recv_from(&mut buf[..]) else { continue; };
|
||||
|
||||
if amount != 4 {
|
||||
continue;
|
||||
}
|
||||
|
||||
println!("Received packet: {}", i32::from_be_bytes(buf));
|
||||
|
||||
let Ok(_) = input.send_to(&buf, src) else { continue; };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user