A small Rust learning project for experimenting with layer-2 (Ethernet) networking and ARP on Linux using the pnet crate. It discovers hosts on the local subnet and emits ARP packets to them on a loop, with the send thread pinned to a specific CPU core.
⚠️ Authorized use only. This tool sends raw ARP frames on the network you run it on. Only use it on networks you own or are explicitly permitted to test. Sending crafted ARP traffic on networks you don't control may be illegal and can disrupt other devices.
- Host discovery — shells out to
nmap -sn <gateway_ip>/24(the-ggateway,/24) to enumerate live hosts on the subnet, then drops the hard-coded address192.168.1.1from the result. - Interface selection — picks the first active, non-loopback interface that has a MAC and an IPv4 address, and reads its source IP/MAC.
- CPU pinning — spawns a sender thread and pins it to the core given by
-t(default1) viasched_setaffinity(Linux) for more consistent timing; the main thread prints a progress indicator while it runs. - Send loop — for every discovered target IP (skipping its own address), builds an Ethernet + ARP frame and broadcasts it, then sleeps for a configurable interval before repeating.
- Linux (uses
libcCPU-affinity syscalls and raw layer-2 sockets) - Rust toolchain with edition 2024 support
nmapavailable onPATH(used for host discovery)- Elevated privileges (
CAP_NET_RAW/ root) to open a raw datalink channel
cargo build --releaseRaw socket access typically needs root:
sudo ./target/release/pulsar-star| Flag | Description | Default |
|---|---|---|
-s, --sleep <µs> (optional) |
Delay in microseconds between each full sweep of the target list | 200 |
-g, --gateway <ip> (optional) |
arp gateway | 192.168.1.1 |
-t, --thread <num> (optional) |
which thread to pinned the proccess | 1 |
Example:
sudo ./target/release/pulsar-star -s 300 -g 192.168.0.0 -t 1.
├── Cargo.toml # package metadata and dependencies
├── src/
│ └── main.rs # entry point + all logic
└── README.md
pnet(with thepcapfeature) — datalink channels and packet buildingclap/clap_derive— command-line argument parsinglibc— CPU affinity syscalls
Early-stage / experimental personal project.