UnixDroid

Lesson 03 of 5

Reading Packets in Wireshark: TCP Handshake, DNS, HTTP and TLS

3 min read

Understand what a normal TCP connection, DNS lookup, HTTP request and HTTPS handshake look like.

Before you can spot anything unusual, you need to know what normal looks like. In this lesson we read the four conversations you'll see in almost every capture: the TCP handshake, DNS, HTTP and the TLS handshake behind HTTPS.

The TCP three-way handshake

Every TCP connection starts the same way:

  • SYN – the client asks to open a connection
  • SYN, ACK – the server agrees
  • ACK – the client confirms, and data can flow

Find handshakes with this filter:

tcp.flags.syn == 1

The connection ends with FIN packets (a polite close) or an RST (an abrupt reset). Lots of RSTs can mean a closed port, a firewall, or a crashing app.

Tip: Wireshark shows relative sequence numbers starting at 0, which makes them much easier to read. Each TCP connection also gets a number called tcp.stream, so tcp.stream == 3 shows one whole conversation.

Spot network problems

Wireshark's TCP analysis flags common problems for you:

tcp.analysis.retransmission
tcp.analysis.duplicate_ack
tcp.analysis.zero_window

A few retransmissions are normal. Hundreds of them point to packet loss, a bad cable, weak Wi-Fi or an overloaded link.

DNS: turning names into IPs

Almost every connection starts with a DNS lookup. Useful filters:

dns
dns.qry.name contains "google"
dns.flags.response == 1
dns.flags.rcode != 0

In the details pane, open Queries to see the name asked for and Answers to see the IP addresses that came back. The record type tells you what was asked: A (IPv4), AAAA (IPv6), CNAME (alias) or MX (mail server). A non-zero rcode means the lookup failed, for example the name doesn't exist.

HTTP: plain web traffic

http.request
http.request.method == "POST"
http.response.code == 404
http.host contains "example"

In each request you can read the method (GET or POST), the path, the Host header and the User-Agent. In each response you can read the status code (200 OK, 301 redirect, 404 not found, 500 server error).

Why this matters for security: plain HTTP, FTP and Telnet send everything, including passwords, as readable text. If you find any of them on your own network, that's a finding: switch to HTTPS, SFTP and SSH.

HTTPS: the TLS handshake

Most traffic today is HTTPS, so the content is encrypted. You can still learn a lot from the handshake:

tls.handshake.type == 1

This shows each Client Hello. Inside it, the Server Name Indication (SNI) field tells you which website the browser asked for, even though the page itself is encrypted. You can also see the TLS version and the cipher suites offered.

Simple words mein (Hinglish)

Har TCP connection SYN → SYN/ACK → ACK se shuru hota hai. DNS naam ko IP mein badalta hai, aur dns filter se saare lookups dikhte hain. HTTP mein request aur response saaf padh sakte ho, isliye HTTP, FTP, Telnet jaise protocols unsafe hain. HTTPS mein content encrypted hota hai, lekin Client Hello ke SNI se website ka naam dikh jata hai.

FAQ

How do I see the TCP three-way handshake in Wireshark? Filter with tcp.flags.syn == 1 and look at the SYN, SYN/ACK and ACK packets of one stream.

Why does Wireshark show black packets? Black rows with red text usually mean TCP problems such as retransmissions or duplicate ACKs.

Can I see which websites someone visited over HTTPS? On your own capture, the SNI in the TLS Client Hello and the DNS lookups show the site names, but not the page content.

Practice task

  • Capture while you open one HTTP-only test page and one HTTPS site
  • Find the handshake, the DNS lookup and the first request for each
  • Note the SNI value in the HTTPS Client Hello
  • Check whether anything on your own network still uses plain HTTP, FTP or Telnet

Next lesson: Follow TCP Stream, the Statistics menu and exporting evidence.