Skip to content

Reading traffic that is not encrypted

Module
Everyday Application Traffic
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.5 LTS, netlab 1.2, GNU Bash 5.2.21
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.

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.

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.

Read the form fields
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. Find the fields named user and password on the lab sign-in page.
Steps (3)
  1. Type curl -sS http://web.lab.test/signin.html | grep '<input'
  2. Press Enter
  3. Output: <p><label>Name <input name="user"></label></p> <p><label>Password <input name="password" type="password"></label></p>

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?

Start and stop the listener
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. Start the listener in terminal 1. Return to stop it after the sign-in.
Steps (14)
  1. Type netlab shell router
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Type sudo tcpdump -n -i eth1 -w signin.pcap port 80
  7. Press Enter
  8. Output: [sudo] password for learner:
  9. Type the password (the terminal shows nothing)
  10. Press Enter
  11. Output: tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
  12. Send the form in terminal 2, then return and stop the listener.
  13. Press Ctrl + C
  14. Output: 12 packets captured 12 packets received by filter 0 packets dropped by kernel
Submit the lab form from laptop
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. Terminal 2 on laptop submits the form after the listener starts.
Steps (3)
  1. Type curl -sS -d 'user=visitor&password=not-a-secret' http://web.lab.test/signin
  2. Press Enter
  3. 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>
Follow the saved sign-in
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. Follow the saved conversation in terminal 1.
Steps (3)
  1. Type tshark -r signin.pcap -qz follow,tcp,ascii,0
  2. Press Enter
  3. 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>
router
router
eth1
Request · ApplicationPOST /signin HTTP/1.1
Name · Applicationuser=visitor
Password · Applicationpassword=not-a-secret
Reply · ApplicationSigned in as visitor.

Reading the output

Pick a step to match a marked part of the output to the picture.

Step-by-step reading of a captured output · Output of tshark -r signin.pcap -qz follow,tcp,ascii,0 on router, on Ubuntu 24.04.5 LTS, netlab 1.2. The values are the capture's. Read the form fields and answer as recorded at router.
Steps (4)
  1. 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.
  2. 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.
  3. 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.
  4. 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.

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.

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.

“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.

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..

Start and stop the listener
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. In terminal 1, record the rejected sign-in.
Steps (14)
  1. Type netlab shell router
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Type sudo tcpdump -n -i eth1 -w denied.pcap port 80
  7. Press Enter
  8. Output: [sudo] password for learner:
  9. Type the password (the terminal shows nothing)
  10. Press Enter
  11. Output: tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
  12. Submit the incorrect password in terminal 2, then stop the listener here.
  13. Press Ctrl + C
  14. Output: 12 packets captured 12 packets received by filter 0 packets dropped by kernel
Submit the lab form with an incorrect password
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. In terminal 2, submit the form with the deliberately incorrect password.
Steps (3)
  1. Type curl -sS -d 'user=visitor&password=not-the-password' http://web.lab.test/signin
  2. Press Enter
  3. 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>
Follow the saved sign-in
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:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.2), GNU Bash 5.2.21. Read the submitted fields and the server's refusal.
Steps (3)
  1. Type tshark -r denied.pcap -qz follow,tcp,ascii,0
  2. Press Enter
  3. 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.