Lion Cipher Lab

Talk to network services by hand with netcat and socat

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

Steps in this lab

  1. A service is just text over a TCP connection
  2. Install netcat and socat (and the flavor differences, honestly)
  3. Speak HTTP/1.1 to a web server by hand
  4. Two terminals, one pipe: a listener and a client
  5. Banner grabbing: is the port open, and what answers?
  6. socat: talk to HTTPS (and things nc can't reach)
  7. When to reach for nc/socat — and when not to

Open the full interactive lab →