Lion Cipher Lab
Talk to network services by hand with netcat and socat
- Foundations
- Intermediate
- ~40 min
- Free · no account required
Why it matters
Every network service you will ever debug — a web server, a mail server, a database, an API — is, underneath, just bytes travelling over a TCP connection. A browser or a client library dresses that up, but the raw truth is that a program on the other end reads what you send and writes back a reply. The most clarifying thing you can do as a practitioner is to BE the client by hand: open the socket yourself, type the protocol, and watch the bytes come back. Do it once with HTTP and the protocol stops being magic — you can see, character for character, that `GET / HTTP/1.1` plus a Host header…
What you'll learn
- netcat/ncat basics
- socat basics
- speaking HTTP/1.1 by hand
- raw TCP connections
- setting up a TCP listener
- banner grabbing
- TLS-wrapped connections with socat
- choosing nc vs curl vs a scanner
- reading network services as text-over-TCP
Steps in this lab
- A service is just text over a TCP connection
- Install netcat and socat (and the flavor differences, honestly)
- Speak HTTP/1.1 to a web server by hand
- Two terminals, one pipe: a listener and a client
- Banner grabbing: is the port open, and what answers?
- socat: talk to HTTPS (and things nc can't reach)
- When to reach for nc/socat — and when not to