AcademyTerminal Tactics: Survival in the ShellPhase 4: Deep Net (Networking)

Lesson 4: The Wire Inspector (Ports & HTTP)

Every server has thousands of ports — think of them as numbered doors. A web server listens on port 80 (HTTP) or 443 (HTTPS). A database might use port 5432 (PostgreSQL). As a DevOps engineer, you must know which doors are open.

Understanding Ports

  • Port 22 — SSH (remote login)
  • Port 80 — HTTP (web traffic)
  • Port 443 — HTTPS (secure web traffic)
  • Port 3000 — Common for development servers (Node.js, etc.)
  • Port 5432 — PostgreSQL database

Inspecting Open Ports: ss

The ss command (Socket Statistics) replaced the older netstat. It shows which ports are open and which programs are using them.

ss -tlnp
  • -t — Show TCP connections.
  • -l — Show only listening (open) ports.
  • -n — Show port numbers (not service names).
  • -p — Show which process is using each port.

Deep Dive with curl

curl is the Swiss Army knife of HTTP. You can use it to test APIs, download files, and debug web services.

curl -s https://httpbin.org/ip       # Simple GET request
curl -I https://google.com           # View response headers only
curl -X POST -d '{"key":"value"}'    # Send POST data

DNS Lookup: nslookup

Every domain name (like google.com) maps to an IP address. nslookup reveals this mapping.

booting...

Mission Objective

A deployment just happened. Verify the server is properly configured:

  1. Check the doors: Run ss -tlnp to see which ports are open.
  2. Test the web: Use curl -s https://httpbin.org/ip to verify internet access and see your public IP.
  3. Resolve a domain: Run nslookup google.com to check DNS resolution.

Mission Control

List all listening ports

Expected Command

ss -tlnp

Fetch data from a web API

Look up a domain's IP address