Reading traffic that is not encrypted
On this page
Since Your First Packet Capture, you have been able to read the requests you sent in the lab. So can a device that carries those requests. Put a capture on the router while you sign in to a page. See what the router learns even though the form was sent to the web server.
Before you start
Section titled “Before you start”Finish URLs and HTTP messages. Keep netlab 1.2 in DNS mode on your Ubuntu VM. Open two terminals. Use only the lab form’s account: visitor with the password not-a-secret.
Read the two form fields
Section titled “Read the two form fields”On laptop, fetch http://web.lab.test/signin.html. The page is written in HTML, the text a browser turns into a page. The two lines below describe its fields. One is named user and the other password. The password field normally shows dots as you type to hide the characters from someone looking at your screen.
With curl, -sS hides the transfer meter but still shows errors. The pipe sends the page to grep, which keeps the input field lines for this example.
learner@laptop:~$ curl -sS http://web.lab.test/signin.html | grep '<input'<p><label>Name <input name="user"></label></p>
<p><label>Password <input name="password" type="password"></label></p>learner@laptop:~$ Steps (3)
- Type
curl -sS http://web.lab.test/signin.html | grep '<input' - Press Enter
- Output:
<p><label>Name <input name="user"></label></p> <p><label>Password <input name="password" type="password"></label></p>
Submit the form while the router listens
Section titled “Submit the form while the router listens”In terminal 1, start at the VM prompt and enter router. Capture on eth1, the router’s link to the site network. The filter port 80 keeps the plain HTTP traffic, and -w signin.pcap saves it to a file. If sudo asks for a password, use your Ubuntu password.
In terminal 2, enter laptop and send the form with curl. The -d option sends form fields, as clicking the form’s button would. The & joins the two fields in the request content. After curl receives its answer, return to terminal 1 and press Ctrl+C.
Use tshark -r signin.pcap -qz follow,tcp,ascii,0 to read the conversation. The -r option opens the saved file. The -qz follow,tcp,ascii,0 options show the first TCP conversation as text. The display names the two ends before showing their messages. See Following an exchange for the earlier file request.
Predict. The capture is taken on the router, not on laptop or web. Will the password be readable?
learner@rootvolt:~$ netlab shell router[sudo] password for learner: learner@router:~$ sudo tcpdump -n -i eth1 -w signin.pcap port 80[sudo] password for learner: tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@router:~$ Steps (14)
- Type
netlab shell router - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -n -i eth1 -w signin.pcap port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Send the form in terminal 2, then return and stop the listener.
- Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS -d 'user=visitor&password=not-a-secret' http://web.lab.test/signin<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Signed in</title></head>
<body><p>Signed in as visitor.</p></body></html>learner@laptop:~$ Steps (3)
- Type
curl -sS -d 'user=visitor&password=not-a-secret' http://web.lab.test/signin - Press Enter
- Output:
<!doctype html> <html lang="en"><head><meta charset="utf-8"><title>Signed in</title></head> <body><p>Signed in as visitor.</p></body></html>
learner@router:~$ tshark -r signin.pcap -qz follow,tcp,ascii,0
===================================================================
Follow: tcp,ascii
Filter: tcp.stream eq 0
Node 0: 10.77.10.10:55212
Node 1: 10.77.20.80:80
185
POST /signin HTTP/1.1
Host: web.lab.test
User-Agent: curl/8.5.0
Accept: */*
Content-Length: 34
Content-Type: application/x-www-form-urlencoded
user=visitor&password=not-a-secret
141
HTTP/1.0 200 OK
Server: netlab-web/1.0
Date: Wed, 02 Dec 2026 16:59:49 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 141
141
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Signed in</title></head>
<body><p>Signed in as visitor.</p></body></html>
===================================================================learner@router:~$ Steps (3)
- Type
tshark -r signin.pcap -qz follow,tcp,ascii,0 - Press Enter
- Output:
=================================================================== Follow: tcp,ascii Filter: tcp.stream eq 0 Node 0: 10.77.10.10:55212 Node 1: 10.77.20.80:80 185 POST /signin HTTP/1.1 Host: web.lab.test User-Agent: curl/8.5.0 Accept: */* Content-Length: 34 Content-Type: application/x-www-form-urlencoded user=visitor&password=not-a-secret 141 HTTP/1.0 200 OK Server: netlab-web/1.0 Date: Wed, 02 Dec 2026 16:59:49 GMT Content-Type: text/html; charset=utf-8 Content-Length: 141 141 <!doctype html> <html lang="en"><head><meta charset="utf-8"><title>Signed in</title></head> <body><p>Signed in as visitor.</p></body></html> ===================================================================
Read the HTTP sign-in at router
POST /signin HTTP/1.1
Host: web.lab.test
Content-Type: application/x-www-form-urlencoded
user=visitor&password=not-a-secret
HTTP/1.0 200 OK
<body><p>Signed in as visitor.</p></body></html>POST /signin HTTP/1.1user=visitorpassword=not-a-secretSigned in as visitor.Reading the output
Pick a step to match a marked part of the output to the picture.
Steps (4)
- Request. Request: POST /signin HTTP/1.1. Application layer. Shown on router's eth1 as: Request. The client sends a form to the sign-in path.
- Name. Name: user=visitor. Application layer. Shown on router's eth1 as: Name. The first field of the form carries the account name as text.
- Password. Password: password=not-a-secret. Application layer. Shown on router's eth1 as: Password. The second field is readable on the same captured line.
- Reply. Reply: Signed in as visitor.. Application layer. Shown on router's eth1 as: Reply. The server accepts the form and sends this text back.
Check your answer
The router can read password=not-a-secret. Look on the same line for user=visitor.
The first mark is the request line, POST /signin HTTP/1.1. Here POST asks the server to process the submitted form. The next two marks pick out the name and password from one body line. The Content-Type: application/x-www-form-urlencoded header tells the server how those form fields are written. The final mark is the reply text, Signed in as visitor. The server’s status line above it says HTTP/1.0 200 OK.
Read what a device on the path can see
Section titled “Read what a device on the path can see”The client sends the form to web. The router forwards it because it is on the path. The file from that router carries the same readable text that the client sent. Another device able to capture those same packets can read that text too.
A device on the path could change the page on its way back. Plain HTTP gives the browser no way to notice that change. Three protections are missing.
- Secrecy.
- A check against changes.
- Proof of who the server is.
Keep secrets off plain HTTP
Section titled “Keep secrets off plain HTTP”The capture on the router shows password=not-a-secret in the request. Never send a secret over an unencrypted connection. In a lab, never use a real password.
Mistakes to recognize
Section titled “Mistakes to recognize”“Only the two ends can read a connection.” The saved file was made on router. It includes the same form fields that the client sent to web.
“A password field that shows dots is protected on the network.” The dots affect what the browser draws. The followed request still contains the password’s characters.
Try it yourself
Section titled “Try it yourself”Repeat the two-terminal capture, saving to denied.pcap this time. Keep user=visitor but send the deliberately incorrect value not-the-password in the password field. Stop the listener, follow the first TCP conversation in your file, and write down what the router can read and what result the server returned.
Solution
The router can read both the name and the incorrect password. The reply contains 403 Forbidden and Wrong name or password..
learner@rootvolt:~$ netlab shell router[sudo] password for learner: learner@router:~$ sudo tcpdump -n -i eth1 -w denied.pcap port 80[sudo] password for learner: tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C12 packets captured
12 packets received by filter
0 packets dropped by kernellearner@router:~$ Steps (14)
- Type
netlab shell router - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -n -i eth1 -w denied.pcap port 80 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Submit the incorrect password in terminal 2, then stop the listener here.
- Press Ctrl + C
- Output:
12 packets captured 12 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS -d 'user=visitor&password=not-the-password' http://web.lab.test/signin<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Not signed in</title></head>
<body><p>Wrong name or password.</p></body></html>learner@laptop:~$ Steps (3)
- Type
curl -sS -d 'user=visitor&password=not-the-password' http://web.lab.test/signin - Press Enter
- Output:
<!doctype html> <html lang="en"><head><meta charset="utf-8"><title>Not signed in</title></head> <body><p>Wrong name or password.</p></body></html>
learner@router:~$ tshark -r denied.pcap -qz follow,tcp,ascii,0
===================================================================
Follow: tcp,ascii
Filter: tcp.stream eq 0
Node 0: 10.77.10.10:43440
Node 1: 10.77.20.80:80
189
POST /signin HTTP/1.1
Host: web.lab.test
User-Agent: curl/8.5.0
Accept: */*
Content-Length: 38
Content-Type: application/x-www-form-urlencoded
user=visitor&password=not-the-password
148
HTTP/1.0 403 Forbidden
Server: netlab-web/1.0
Date: Wed, 02 Dec 2026 16:59:06 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 147
147
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Not signed in</title></head>
<body><p>Wrong name or password.</p></body></html>
===================================================================learner@router:~$ Steps (3)
- Type
tshark -r denied.pcap -qz follow,tcp,ascii,0 - Press Enter
- Output:
=================================================================== Follow: tcp,ascii Filter: tcp.stream eq 0 Node 0: 10.77.10.10:43440 Node 1: 10.77.20.80:80 189 POST /signin HTTP/1.1 Host: web.lab.test User-Agent: curl/8.5.0 Accept: */* Content-Length: 38 Content-Type: application/x-www-form-urlencoded user=visitor&password=not-the-password 148 HTTP/1.0 403 Forbidden Server: netlab-web/1.0 Date: Wed, 02 Dec 2026 16:59:06 GMT Content-Type: text/html; charset=utf-8 Content-Length: 147 147 <!doctype html> <html lang="en"><head><meta charset="utf-8"><title>Not signed in</title></head> <body><p>Wrong name or password.</p></body></html> ===================================================================
- Capture at a named point on the path and say which traffic passes there.
- Follow the conversation to find the submitted fields and the reply.
- A device on the path can read a password sent over plain HTTP.
Next, What TLS adds repeats the sign-in with protection.