← Back to all lessons

02 / Networks / 30 min READ + PRACTICE

Packet captures and analysis.

Read traffic from your own loopback lab with Wireshark or tcpdump and understand protocol layers.

Practice boundaryUse your own devices, your isolated practice VM or 127.0.0.1. Get explicit authorization for any other system.

Know the layers

An IP packet identifies source and destination addresses; TCP adds ports, sequence numbers and connection state. A capture shows traffic, not the intent behind it. Learn to distinguish a SYN handshake from application data and a retransmission from a second request.

Capture a local request

Choose the loopback interface in Wireshark and filter on tcp.port == 8000 while requesting your own test server. Alternatively capture a short localhost-only trace with tcpdump. Capturing may require elevated privileges; use only the interface you control.

LAB TERMINAL / EXAMPLE
sudo tcpdump -i lo -c 20 'tcp port 8000'
# In another terminal: curl http://127.0.0.1:8000/

Protect your capture

Even local traces can contain cookies or form values. Keep practice captures private and delete those containing unexpected secrets. For HTTPS, the payload is encrypted; you can still observe endpoints and timing without assuming you can read the content.

HANDS-ON EXERCISE

Try it in your lab

Capture a single localhost request and identify source port, destination port and TCP flags. Summarize what you can and cannot infer.

CHECKPOINT

Make sure it clicks

What is the difference between a capture filter and a display filter?

TRY WITH OPENCODE

A prompt you can adapt

Explain this sanitized loopback pcap summary and help me write a protocol-layer diagram; do not infer credentials.
How to set up OpenCode ↗
Your progress stays in this browser only.