A lightweight TCP tarpit that traps port scanners and wastes their time — without the overhead of a full honeypot.
Most honeypots try to emulate entire OS environments or specific services. Scanners fingerprint those instantly, log them, and move on.
AsyncTarpit takes a different approach: it grabs an incoming TCP connection and refuses to let go. No dropped connections. No standard banners. It feeds the scanner absolute garbage — one random byte every 10 seconds — dragging out their scans until the tool gives up.
Python's asyncio runs the show. Thousands of sockets locked up on a single thread, barely touching RAM or CPU.
- Python 3.7+
- Zero external dependencies
python asynctarpit.pyBinds to 0.0.0.0:2222 by default. Edit the config at the top of the script to change the port or delay:
HOST = "0.0.0.0"
PORT = 2222
DELAY = 10 # Seconds between sending bytesStart the tarpit, then in a second terminal:
nc -v 127.0.0.1 2222The socket connects immediately. After that — dead silence. Just random characters dropping in every 10 seconds. Ctrl+C to disconnect.
A test suite is included:
python test_asynctarpit.pyThis verifies connection handling, byte drip-feeding, concurrent connections, and clean disconnects — all without needing external tools.
- Listens on a TCP port (default
2222) - Accepts any incoming connection
- Sends 1 random byte every N seconds (default
10) - Never closes the connection — the scanner has to give up first
- Handles thousands of concurrent connections via
asyncio
MIT