Bash's hidden /dev/tcp stack lets you make raw TCP calls without curl or netcat
RealGeneKim · x · 2026-10-16
If you're stuck in a locked-down Linux container without curl, wget, or netcat, Bash's built-in network stack wired to /dev/tcp still works.
The trick:
- exec 3<>/dev/tcp/example.com/80 opens a raw TCP connection
- echo -e "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" >&3 writes a raw HTTP request
- cat <&3 reads the response
A rarely-remembered feature that's handy for debugging or exfiltrating connectivity out of restricted environments.
More from coding & agent
- Hermes: a 4B model with 8K context got worse with more test-time compute, pointing to contextual reasoning — mangahomanga · 2026-10-16
- Flux 3 Klein's Default Templates Are Broken Without Its Prompt Upscaler — StrictMove5839 · 2026-10-16
- 21-person team ships hundreds of PRs weekly with AI writing 97% of the code — rseroter · 2026-10-16
- ClosedMCP: Set Up MCP Servers Once, Share Them Across Your Whole Team — Ok_Sprinkles1301 · 2026-10-16
- Heisentools: let an agent rewrite a mock.py until it mirrors any real tool's API — kieranklaassen · 2026-10-16
- Dev mulls Rust rewrite of agent platform because speed-of-light compile times matter for agents — lucasmeijer · 2026-10-16