From name to page
On this page
The map in What happens when you open a web page had seven questions and no answers. Clear the saved network state, start one capture on laptop, and open the page. Use that file to tell the story from the first packet to the close.
Before you start
Section titled “Before you start”Finish What TLS adds. Use netlab 1.2 in DNS mode. Exit any machine shells before you reset.
Reset, listen, and ask twice
Section titled “Reset, listen, and ask twice”At the VM prompt run netlab reset. It clears the neighbor tables and restarts the resolver dns with an empty cache.
learner@rootvolt:~$ netlab versionnetlab 1.2 (cast fffd977692d0)learner@rootvolt:~$ netlab reset[sudo] password for learner: Lab is back in its starting state (modes on: dns).learner@rootvolt:~$ Steps (9)
- Type
netlab version - Press Enter
- Output:
netlab 1.2 (cast fffd977692d0) - Type
netlab reset - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
Lab is back in its starting state (modes on: dns).
In terminal 1, enter laptop and save a capture on eth0 to page.pcap. Capture without a filter so it can include the link and lookup rows. Start the listener before opening the page.
In terminal 2, also use laptop. In curl, -o /dev/null discards the page and -w '%{http_code}\n' prints the status code followed by a new line. Ask for the page once. Stop the listener with Ctrl+C after curl prints its status.
learner@rootvolt:~$ netlab shell laptop[sudo] password for learner: learner@laptop:~$ sudo tcpdump -n -i eth0 -w page.pcap[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C24 packets captured
24 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (14)
- Type
netlab shell laptop - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -n -i eth0 -w page.pcap - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Ask for the page in terminal 2, then stop this listener.
- Press Ctrl + C
- Output:
24 packets captured 24 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS -o /dev/null -w '%{http_code}\n' --cacert /usr/local/share/netlab/lab-ca.crt https://web.lab.test/200learner@laptop:~$ Steps (3)
- Type
curl -sS -o /dev/null -w '%{http_code}\n' --cacert /usr/local/share/netlab/lab-ca.crt https://web.lab.test/ - Press Enter
- Output:
200
Keep both terminals on laptop. Start a second listener straight away and save to again.pcap. Make the same request in terminal 2 and stop the second listener. Do both captures before studying either file, so the second request can use the network state left by the first one.
learner@laptop:~$ sudo tcpdump -n -i eth0 -w again.pcaptcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C21 packets captured
21 packets received by filter
0 packets dropped by kernellearner@laptop:~$ Steps (6)
- Type
sudo tcpdump -n -i eth0 -w again.pcap - Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Ask for the page once more in terminal 2, then stop this listener.
- Press Ctrl + C
- Output:
21 packets captured 21 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ curl -sS -o /dev/null -w '%{http_code}\n' --cacert /usr/local/share/netlab/lab-ca.crt https://web.lab.test/200learner@laptop:~$ Steps (3)
- Type
curl -sS -o /dev/null -w '%{http_code}\n' --cacert /usr/local/share/netlab/lab-ca.crt https://web.lab.test/ - Press Enter
- Output:
200
Read the first request in groups
Section titled “Read the first request in groups”Open page.pcap with tshark -r page.pcap. Read the row number, protocol and description. Your row counts and times may differ. Find the start of each group by the work it does, then see what follows. Some TCP rows only acknowledge the bytes that arrived. They belong to the same connection as the rows that carry data.
learner@laptop:~$ tshark -r page.pcap 1 0.000000 02:77:10:00:00:10 ? Broadcast ARP 42 Who has 10.77.10.1? Tell 10.77.10.10
2 0.000035 02:77:10:00:00:01 ? 02:77:10:00:00:10 ARP 42 10.77.10.1 is at 02:77:10:00:00:01
3 0.000037 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0x9a6e A web.lab.test
4 0.000081 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0x866f AAAA web.lab.test
5 0.000375 10.77.20.53 ? 10.77.10.10 DNS 121 Standard query response 0x9a6e A web.lab.test A 10.77.20.80 NS ns.lab.test
6 0.000405 10.77.20.53 ? 10.77.10.10 DNS 133 Standard query response 0x866f AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 NS ns.lab.test
7 0.000612 10.77.10.10 ? 10.77.20.80 TCP 74 40482 ? 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=1576398544 TSecr=0 WS=1024
8 0.000655 10.77.20.80 ? 10.77.10.10 TCP 74 443 ? 40482 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=505452909 TSecr=1576398544 WS=1024
9 0.000671 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=1576398544 TSecr=505452909
10 0.001765 10.77.10.10 ? 10.77.20.80 TLSv1 583 Client Hello (SNI=web.lab.test)
11 0.001812 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 40482 [ACK] Seq=1 Ack=518 Win=65536 Len=0 TSval=505452910 TSecr=1576398545
12 0.002978 10.77.20.80 ? 10.77.10.10 TLSv1.3 1463 Server Hello, Change Cipher Spec, Application Data, Application Data, Application Data, Application Data
13 0.003022 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=518 Ack=1398 Win=67584 Len=0 TSval=1576398547 TSecr=505452912
14 0.003486 10.77.10.10 ? 10.77.20.80 TLSv1.3 146 Change Cipher Spec, Application Data
15 0.003634 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data
16 0.003726 10.77.10.10 ? 10.77.20.80 TLSv1.3 163 Application Data
17 0.003736 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data
18 0.043949 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=695 Ack=1908 Win=73728 Len=0 TSval=1576398588 TSecr=505452912
19 0.044113 10.77.20.80 ? 10.77.10.10 TLSv1.3 577 Application Data, Application Data, Application Data
20 0.044178 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=695 Ack=2419 Win=76800 Len=0 TSval=1576398588 TSecr=505452953
21 0.044387 10.77.10.10 ? 10.77.20.80 TLSv1.3 90 Application Data
22 0.044590 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [FIN, ACK] Seq=719 Ack=2419 Win=76800 Len=0 TSval=1576398588 TSecr=505452953
23 0.044700 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 40482 [FIN, ACK] Seq=2419 Ack=720 Win=65536 Len=0 TSval=505452953 TSecr=1576398588
24 0.044735 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=720 Ack=2420 Win=76800 Len=0 TSval=1576398588 TSecr=505452953learner@laptop:~$ Steps (3)
- Type
tshark -r page.pcap - Press Enter
- Output:
1 0.000000 02:77:10:00:00:10 ? Broadcast ARP 42 Who has 10.77.10.1? Tell 10.77.10.10 2 0.000035 02:77:10:00:00:01 ? 02:77:10:00:00:10 ARP 42 10.77.10.1 is at 02:77:10:00:00:01 3 0.000037 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0x9a6e A web.lab.test 4 0.000081 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0x866f AAAA web.lab.test 5 0.000375 10.77.20.53 ? 10.77.10.10 DNS 121 Standard query response 0x9a6e A web.lab.test A 10.77.20.80 NS ns.lab.test 6 0.000405 10.77.20.53 ? 10.77.10.10 DNS 133 Standard query response 0x866f AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 NS ns.lab.test 7 0.000612 10.77.10.10 ? 10.77.20.80 TCP 74 40482 ? 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=1576398544 TSecr=0 WS=1024 8 0.000655 10.77.20.80 ? 10.77.10.10 TCP 74 443 ? 40482 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=505452909 TSecr=1576398544 WS=1024 9 0.000671 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=1576398544 TSecr=505452909 10 0.001765 10.77.10.10 ? 10.77.20.80 TLSv1 583 Client Hello (SNI=web.lab.test) 11 0.001812 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 40482 [ACK] Seq=1 Ack=518 Win=65536 Len=0 TSval=505452910 TSecr=1576398545 12 0.002978 10.77.20.80 ? 10.77.10.10 TLSv1.3 1463 Server Hello, Change Cipher Spec, Application Data, Application Data, Application Data, Application Data 13 0.003022 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=518 Ack=1398 Win=67584 Len=0 TSval=1576398547 TSecr=505452912 14 0.003486 10.77.10.10 ? 10.77.20.80 TLSv1.3 146 Change Cipher Spec, Application Data 15 0.003634 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data 16 0.003726 10.77.10.10 ? 10.77.20.80 TLSv1.3 163 Application Data 17 0.003736 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data 18 0.043949 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=695 Ack=1908 Win=73728 Len=0 TSval=1576398588 TSecr=505452912 19 0.044113 10.77.20.80 ? 10.77.10.10 TLSv1.3 577 Application Data, Application Data, Application Data 20 0.044178 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=695 Ack=2419 Win=76800 Len=0 TSval=1576398588 TSecr=505452953 21 0.044387 10.77.10.10 ? 10.77.20.80 TLSv1.3 90 Application Data 22 0.044590 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [FIN, ACK] Seq=719 Ack=2419 Win=76800 Len=0 TSval=1576398588 TSecr=505452953 23 0.044700 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 40482 [FIN, ACK] Seq=2419 Ack=720 Win=65536 Len=0 TSval=505452953 TSecr=1576398588 24 0.044735 10.77.10.10 ? 10.77.20.80 TCP 66 40482 ? 443 [ACK] Seq=720 Ack=2420 Win=76800 Len=0 TSval=1576398588 TSecr=505452953
For stations 1 and 5, use a display filter with -Y to keep the DNS and SYN rows. In tshark, -T fields prints only the fields you name with -e. Here they are the row number, the two link addresses, and the two IP addresses. At station 1, the source 10.77.10.10 and resolver 10.77.20.53 show the settings in use. At station 5, rows to site machines carry the router’s link address 02:77:10:00:00:01 so it can forward them.
learner@laptop:~$ tshark -r page.pcap -Y 'dns or tcp.flags.syn == 1' -T fields -e frame.number -e eth.src -e eth.dst -e ip.src -e ip.dst3 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.53
4 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.53
5 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.53 10.77.10.10
6 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.53 10.77.10.10
7 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.80
8 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.80 10.77.10.10learner@laptop:~$ Steps (3)
- Type
tshark -r page.pcap -Y 'dns or tcp.flags.syn == 1' -T fields -e frame.number -e eth.src -e eth.dst -e ip.src -e ip.dst - Press Enter
- Output:
3 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.53 4 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.53 5 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.53 10.77.10.10 6 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.53 10.77.10.10 7 02:77:10:00:00:10 02:77:10:00:00:01 10.77.10.10 10.77.20.80 8 02:77:10:00:00:01 02:77:10:00:00:10 10.77.20.80 10.77.10.10
| Station | Evidence or explanation |
|---|---|
| 1 · Getting Network Settings Automatically | The rows use laptop’s configured source address and send questions to its configured resolver. This file begins after those settings are in place. |
| 2 · How DNS Finds Services | DNS questions and answers for the host. Curl asks for both address types, so you see A and AAAA. |
| 3 · Subnetting Foundations | The question for the next link address goes to the gateway because the resolver and web server are on the site network. |
| 4 · Ethernet and Local Delivery | The ARP request asks for the gateway at 10.77.10.1 and the reply supplies the router’s link address. |
| 5 · Reaching Another Device | The outbound DNS and TCP rows carry the site machine’s IP address and the router’s link address. Replies arrive from the router’s link address. |
| 6 · TCP, UDP, and Ports | Follow the opening to 10.77.20.80 on port 443, then the closing flags after the last protected records. |
| 7 · Everyday Application Traffic | Read the TLS setup and the rows labeled Application Data. Curl’s separate output gives the HTTP status. |
Compare the second request
Section titled “Compare the second request”Predict. On the second request, which groups of rows will be missing?
learner@laptop:~$ tshark -r again.pcap 1 0.000000 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0xbab5 A web.lab.test
2 0.000059 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0xe1b3 AAAA web.lab.test
3 0.000126 10.77.20.53 ? 10.77.10.10 DNS 88 Standard query response 0xbab5 A web.lab.test A 10.77.20.80
4 0.000148 10.77.20.53 ? 10.77.10.10 DNS 100 Standard query response 0xe1b3 AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80
5 0.000406 10.77.10.10 ? 10.77.20.80 TCP 74 46902 ? 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=828309529 TSecr=0 WS=1024
6 0.000441 10.77.20.80 ? 10.77.10.10 TCP 74 443 ? 46902 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=1557938383 TSecr=828309529 WS=1024
7 0.000449 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=828309529 TSecr=1557938383
8 0.001512 10.77.10.10 ? 10.77.20.80 TLSv1 583 Client Hello (SNI=web.lab.test)
9 0.001554 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 46902 [ACK] Seq=1 Ack=518 Win=65536 Len=0 TSval=1557938384 TSecr=828309530
10 0.002228 10.77.20.80 ? 10.77.10.10 TLSv1.3 1463 Server Hello, Change Cipher Spec, Application Data, Application Data, Application Data, Application Data
11 0.002258 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=518 Ack=1398 Win=67584 Len=0 TSval=828309531 TSecr=1557938384
12 0.002686 10.77.10.10 ? 10.77.20.80 TLSv1.3 146 Change Cipher Spec, Application Data
13 0.002811 10.77.10.10 ? 10.77.20.80 TLSv1.3 163 Application Data
14 0.002901 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data
15 0.045363 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=695 Ack=1653 Win=70656 Len=0 TSval=828309574 TSecr=1557938385
16 0.045476 10.77.20.80 ? 10.77.10.10 TLSv1.3 832 Application Data, Application Data, Application Data, Application Data
17 0.045510 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=695 Ack=2419 Win=73728 Len=0 TSval=828309574 TSecr=1557938428
18 0.045789 10.77.10.10 ? 10.77.20.80 TLSv1.3 90 Application Data
19 0.045946 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [FIN, ACK] Seq=719 Ack=2419 Win=73728 Len=0 TSval=828309574 TSecr=1557938428
20 0.046153 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 46902 [FIN, ACK] Seq=2419 Ack=720 Win=65536 Len=0 TSval=1557938428 TSecr=828309574
21 0.046212 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=720 Ack=2420 Win=73728 Len=0 TSval=828309574 TSecr=1557938428learner@laptop:~$ Steps (3)
- Type
tshark -r again.pcap - Press Enter
- Output:
1 0.000000 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0xbab5 A web.lab.test 2 0.000059 10.77.10.10 ? 10.77.20.53 DNS 72 Standard query 0xe1b3 AAAA web.lab.test 3 0.000126 10.77.20.53 ? 10.77.10.10 DNS 88 Standard query response 0xbab5 A web.lab.test A 10.77.20.80 4 0.000148 10.77.20.53 ? 10.77.10.10 DNS 100 Standard query response 0xe1b3 AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 5 0.000406 10.77.10.10 ? 10.77.20.80 TCP 74 46902 ? 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=828309529 TSecr=0 WS=1024 6 0.000441 10.77.20.80 ? 10.77.10.10 TCP 74 443 ? 46902 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=1557938383 TSecr=828309529 WS=1024 7 0.000449 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=828309529 TSecr=1557938383 8 0.001512 10.77.10.10 ? 10.77.20.80 TLSv1 583 Client Hello (SNI=web.lab.test) 9 0.001554 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 46902 [ACK] Seq=1 Ack=518 Win=65536 Len=0 TSval=1557938384 TSecr=828309530 10 0.002228 10.77.20.80 ? 10.77.10.10 TLSv1.3 1463 Server Hello, Change Cipher Spec, Application Data, Application Data, Application Data, Application Data 11 0.002258 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=518 Ack=1398 Win=67584 Len=0 TSval=828309531 TSecr=1557938384 12 0.002686 10.77.10.10 ? 10.77.20.80 TLSv1.3 146 Change Cipher Spec, Application Data 13 0.002811 10.77.10.10 ? 10.77.20.80 TLSv1.3 163 Application Data 14 0.002901 10.77.20.80 ? 10.77.10.10 TLSv1.3 321 Application Data 15 0.045363 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=695 Ack=1653 Win=70656 Len=0 TSval=828309574 TSecr=1557938385 16 0.045476 10.77.20.80 ? 10.77.10.10 TLSv1.3 832 Application Data, Application Data, Application Data, Application Data 17 0.045510 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=695 Ack=2419 Win=73728 Len=0 TSval=828309574 TSecr=1557938428 18 0.045789 10.77.10.10 ? 10.77.20.80 TLSv1.3 90 Application Data 19 0.045946 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [FIN, ACK] Seq=719 Ack=2419 Win=73728 Len=0 TSval=828309574 TSecr=1557938428 20 0.046153 10.77.20.80 ? 10.77.10.10 TCP 66 443 ? 46902 [FIN, ACK] Seq=2419 Ack=720 Win=65536 Len=0 TSval=1557938428 TSecr=828309574 21 0.046212 10.77.10.10 ? 10.77.20.80 TCP 66 46902 ? 443 [ACK] Seq=720 Ack=2420 Win=73728 Len=0 TSval=828309574 TSecr=1557938428
Check your answer
The ARP rows are gone. Laptop still has the router’s link address. The DNS questions are still there because laptop keeps no answers of its own. The replies are shorter. The first pair includes an NS entry, and the replies from the resolver’s store omit it. TCP and TLS open again because the second curl process uses a new connection.
Mistakes to recognize
Section titled “Mistakes to recognize”“It always happens in exactly these steps.” Compare the two sets of rows. The saved neighbor entry removes the ARP exchange, and the resolver’s cache changes the DNS replies. Both requests still reach the page.
Good to know
Section titled “Good to know”Newer web traffic can run over UDP instead of TCP (HTTP/3). The stations stay the same.
Try it yourself
Section titled “Try it yourself”Reset from the VM prompt. Open two terminals on phone. Listen on eth0, save to phone-page.pcap, and request http://web.lab.test/ in terminal 2. Stop the listener and read the rows with tshark. Use the tcpdump option -e to read the link addresses on the ARP rows. List which stations look different and point to a row or line for each one.
Solution
At station 1, the source address is 10.77.10.11. At station 4, the ARP question came from 02:77:10:00:00:11. It still asks for the same router. Station 6 opens TCP to port 80. At station 7, you can read GET / HTTP/1.1 and there is no TLS group.
learner@rootvolt:~$ netlab shell phone[sudo] password for learner: learner@phone:~$ sudo tcpdump -n -i eth0 -w phone-page.pcap[sudo] password for learner: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C18 packets captured
18 packets received by filter
0 packets dropped by kernellearner@phone:~$ Steps (14)
- Type
netlab shell phone - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -n -i eth0 -w phone-page.pcap - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Ask for the page in terminal 2 on phone, then stop this listener.
- Press Ctrl + C
- Output:
18 packets captured 18 packets received by filter 0 packets dropped by kernel
learner@phone:~$ curl -sS -o /dev/null -w '%{http_code}\n' http://web.lab.test/200learner@phone:~$ Steps (3)
- Type
curl -sS -o /dev/null -w '%{http_code}\n' http://web.lab.test/ - Press Enter
- Output:
200
learner@phone:~$ tshark -r phone-page.pcap 1 0.000000 02:77:10:00:00:11 ? Broadcast ARP 42 Who has 10.77.10.1? Tell 10.77.10.11
2 0.000043 02:77:10:00:00:01 ? 02:77:10:00:00:11 ARP 42 10.77.10.1 is at 02:77:10:00:00:01
3 0.000045 10.77.10.11 ? 10.77.20.53 DNS 72 Standard query 0xf497 A web.lab.test
4 0.000084 10.77.10.11 ? 10.77.20.53 DNS 72 Standard query 0xc996 AAAA web.lab.test
5 0.000324 10.77.20.53 ? 10.77.10.11 DNS 121 Standard query response 0xf497 A web.lab.test A 10.77.20.80 NS ns.lab.test
6 0.000394 10.77.20.53 ? 10.77.10.11 DNS 133 Standard query response 0xc996 AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 NS ns.lab.test
7 0.000613 10.77.10.11 ? 10.77.20.80 TCP 74 36376 ? 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=2152482578 TSecr=0 WS=1024
8 0.000658 10.77.20.80 ? 10.77.10.11 TCP 74 80 ? 36376 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=394864293 TSecr=2152482578 WS=1024
9 0.000674 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=2152482578 TSecr=394864293
10 0.000726 10.77.10.11 ? 10.77.20.80 HTTP 141 GET / HTTP/1.1
11 0.000741 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [ACK] Seq=1 Ack=76 Win=65536 Len=0 TSval=394864293 TSecr=2152482578
12 0.002746 10.77.20.80 ? 10.77.10.11 TCP 238 HTTP/1.0 200 OK [TCP segment of a reassembled PDU]
13 0.002781 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=76 Ack=173 Win=64512 Len=0 TSval=2152482580 TSecr=394864295
14 0.002806 10.77.20.80 ? 10.77.10.11 HTTP 337 HTTP/1.0 200 OK (text/html)
15 0.002808 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=76 Ack=444 Win=64512 Len=0 TSval=2152482580 TSecr=394864295
16 0.002838 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [FIN, ACK] Seq=444 Ack=76 Win=65536 Len=0 TSval=394864295 TSecr=2152482580
17 0.002999 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [FIN, ACK] Seq=76 Ack=445 Win=64512 Len=0 TSval=2152482580 TSecr=394864295
18 0.003059 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [ACK] Seq=445 Ack=77 Win=65536 Len=0 TSval=394864295 TSecr=2152482580learner@phone:~$ tcpdump -ne -r phone-page.pcap arpreading from file phone-page.pcap, link-type EN10MB (Ethernet), snapshot length 262144
17:02:39.260197 02:77:10:00:00:11 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.11, length 28
17:02:39.260240 02:77:10:00:00:01 > 02:77:10:00:00:11, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28learner@phone:~$ Steps (6)
- Type
tshark -r phone-page.pcap - Press Enter
- Output:
1 0.000000 02:77:10:00:00:11 ? Broadcast ARP 42 Who has 10.77.10.1? Tell 10.77.10.11 2 0.000043 02:77:10:00:00:01 ? 02:77:10:00:00:11 ARP 42 10.77.10.1 is at 02:77:10:00:00:01 3 0.000045 10.77.10.11 ? 10.77.20.53 DNS 72 Standard query 0xf497 A web.lab.test 4 0.000084 10.77.10.11 ? 10.77.20.53 DNS 72 Standard query 0xc996 AAAA web.lab.test 5 0.000324 10.77.20.53 ? 10.77.10.11 DNS 121 Standard query response 0xf497 A web.lab.test A 10.77.20.80 NS ns.lab.test 6 0.000394 10.77.20.53 ? 10.77.10.11 DNS 133 Standard query response 0xc996 AAAA web.lab.test AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 NS ns.lab.test 7 0.000613 10.77.10.11 ? 10.77.20.80 TCP 74 36376 ? 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=2152482578 TSecr=0 WS=1024 8 0.000658 10.77.20.80 ? 10.77.10.11 TCP 74 80 ? 36376 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=394864293 TSecr=2152482578 WS=1024 9 0.000674 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=2152482578 TSecr=394864293 10 0.000726 10.77.10.11 ? 10.77.20.80 HTTP 141 GET / HTTP/1.1 11 0.000741 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [ACK] Seq=1 Ack=76 Win=65536 Len=0 TSval=394864293 TSecr=2152482578 12 0.002746 10.77.20.80 ? 10.77.10.11 TCP 238 HTTP/1.0 200 OK [TCP segment of a reassembled PDU] 13 0.002781 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=76 Ack=173 Win=64512 Len=0 TSval=2152482580 TSecr=394864295 14 0.002806 10.77.20.80 ? 10.77.10.11 HTTP 337 HTTP/1.0 200 OK (text/html) 15 0.002808 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [ACK] Seq=76 Ack=444 Win=64512 Len=0 TSval=2152482580 TSecr=394864295 16 0.002838 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [FIN, ACK] Seq=444 Ack=76 Win=65536 Len=0 TSval=394864295 TSecr=2152482580 17 0.002999 10.77.10.11 ? 10.77.20.80 TCP 66 36376 ? 80 [FIN, ACK] Seq=76 Ack=445 Win=64512 Len=0 TSval=2152482580 TSecr=394864295 18 0.003059 10.77.20.80 ? 10.77.10.11 TCP 66 80 ? 36376 [ACK] Seq=445 Ack=77 Win=65536 Len=0 TSval=394864295 TSecr=2152482580 - Type
tcpdump -ne -r phone-page.pcap arp - Press Enter
- Output:
reading from file phone-page.pcap, link-type EN10MB (Ethernet), snapshot length 262144 17:02:39.260197 02:77:10:00:00:11 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.11, length 28 17:02:39.260240 02:77:10:00:00:01 > 02:77:10:00:00:11, ethertype ARP (0x0806), length 42: Reply 10.77.10.1 is-at 02:77:10:00:00:01, length 28
- Group the saved rows by link lookup, name lookup, TCP and TLS.
- Read the settings and the next hop from addresses inside those groups.
- Compare two requests to find the work the second request can skip.
Next, Recognizing other services compares the web traffic with remote login, email and time.