UnixDroid

Lesson 5 of 5 · 8 min

Capture your first packets with Wireshark

Capture real traffic in your lab, filter it, and watch a plain-text password cross the network.

Everything so far has been theory. Wireshark lets you see it: every packet, every header, every handshake. It comes installed on Kali.

Only capture traffic on networks you own or have permission to monitor. Capturing other people's traffic can be illegal.

Step 1: Start a capture

Open Wireshark, then double-click the interface connected to your lab (the host-only adapter, often eth0 or eth1). Packets start scrolling immediately.

Step 2: Make some traffic

In a terminal, request the Metasploitable web page:

curl http://192.168.56.102/

Step 3: Filter the noise

Type a filter in the bar at the top and press Enter:

Useful Wireshark display filters and what each one shows
Useful Wireshark display filters and what each one shows

Try http.request first. You'll see your GET / request. Click it and expand the layers in the middle pane. You'll find Ethernet (MAC addresses), IP, TCP (ports) and HTTP, the same layers from the OSI lesson.

Step 4: See why plain text is dangerous

Now connect to the old Telnet service on Metasploitable:

telnet 192.168.56.102

Log in with msfadmin / msfadmin, then type exit.

Back in Wireshark, filter with telnet, right-click any packet and choose Follow → TCP Stream. You'll see the whole session, including the password, in readable text. Anyone on that network could have seen it too. That's exactly why Telnet was replaced by SSH.

Capture filters vs display filters

Capture filterDisplay filter
WhenBefore capturingAfter capturing
EffectPackets not matching are never savedJust hides packets from view
Examplehost 192.168.56.102ip.addr == 192.168.56.102

Beginners should mostly use display filters, so nothing gets lost.

Save your work

Use File → Save As to keep the capture as a .pcapng file. You can open it again any time, or share it with a teammate.

Try it yourself
  1. Capture while running curl http://192.168.56.102/ and find the HTTP request and the 200 OK response.
  2. Use Follow → TCP Stream on the Telnet session and find the password.
  3. SSH into Metasploitable (ssh msfadmin@192.168.56.102) during a capture, then Follow that stream. Explain in one line why you can't read it. (If your SSH client refuses Metasploitable's old server, add -oHostKeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1 to the command.)
No Linux machine? Practise in the free online terminal

Quick check

Which Wireshark display filter shows only DNS traffic?

Need a hint?

Just the protocol name, in lowercase.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →