IPTrap 2
A fast, stateless TCP sinkhole implemented in Rust. Performs TCP handshakes on all ports and logs the initial payload.
Uses SYN cookies to remain completely stateless - no per-connection memory is allocated, making it immune to SYN flood attacks.
Dependencies
- libpcap-dev
- libzmq3-dev or libzmq4-dev
- Rust
Building
The binary will be at target/release/iptrap.
Usage
IPTrap implements its own TCP/IP stack. The network interface must not have a kernel IP address configured.
IPTrap does not respond to ARP requests. Use a tool like fakearpd for that purpose.
Requires root privileges to open the network interface, but immediately drops to the specified uid/gid.
Excluded Ports
- Port 22 (SSH)
- Port 9922 (ZeroMQ output)
Output
Logs are published as JSON on a ZeroMQ PUB socket on port 9922.
Example output:
Subscribe with any ZeroMQ SUB client:
# Using Python