Recognizing other services
On this page
A capture from a real network can contain mostly traffic unrelated to web pages. One machine might look up a name, send mail, or set its clock while another opens a page. Start with a service you can watch in the lab: signing in to another machine to run a command.
Before you start
Section titled “Before you start”Finish From name to page. Use netlab 1.2 in DNS mode and open two terminals in the Ubuntu VM.
Watch a remote login
Section titled “Watch a remote login”SSH, or Secure Shell, lets you sign in to a remote machine and run commands over a protected connection. In terminal 1, use router:eth1 again. Save to ssh.pcap and filter for port 22, the usual port for SSH.
In terminal 2 on laptop, run ssh learner@web.lab.test ip -4 -br address show eth0. SSH can run a single command on the remote machine and return. The -4 -br options give a short listing of IPv4 addresses.
The first connection asks you to confirm the server’s identity before remembering it for future connections. In this lab, answer yes if asked. Use your own Ubuntu password because the lab machines share the VM’s accounts. Stop the listener when SSH returns you to the prompt.
learner@rootvolt:~$ netlab shell router[sudo] password for learner: learner@router:~$ sudo tcpdump -n -i eth1 -w ssh.pcap port 22[sudo] password for learner: tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C41 packets captured
41 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 ssh.pcap port 22 - 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 - Sign in and leave web from terminal 2, then stop this listener.
- Press Ctrl + C
- Output:
41 packets captured 41 packets received by filter 0 packets dropped by kernel
learner@laptop:~$ ssh learner@web.lab.test ip -4 -br address show eth0The authenticity of host 'web.lab.test (10.77.20.80)' can't be established.
ED25519 key fingerprint is SHA256:yEyn/geBiP8SmhMjfhozxbwtpsW9l2b5jh9U1/UkVHo.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yesWarning: Permanently added 'web.lab.test' (ED25519) to the list of known hosts.
learner@web.lab.test's password: eth0@if11 UP 10.77.20.80/24 learner@laptop:~$ Steps (9)
- Type
ssh learner@web.lab.test ip -4 -br address show eth0 - Press Enter
- Output:
The authenticity of host 'web.lab.test (10.77.20.80)' can't be established. ED25519 key fingerprint is SHA256:yEyn/geBiP8SmhMjfhozxbwtpsW9l2b5jh9U1/UkVHo. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? - Type
yesinto the running program - Press Enter
- Output:
Warning: Permanently added 'web.lab.test' (ED25519) to the list of known hosts. learner@web.lab.test's password: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
eth0@if11 UP 10.77.20.80/24
The address 10.77.20.80 shows that the command ran on web.
The command and its output travel inside the protected session. Search the saved packet text for 10.77.20.80/24, which you can read in the client terminal. The search on the router gives zero matches.
SSH sends a banner, a line that identifies the protocol and the software, at the beginning of each direction. The ssh.protocol filter shows the rows with a banner. Both begin with SSH-2.0-OpenSSH_9.6p1 in this run. Your software version may differ.
learner@router:~$ tcpdump -n -A -r ssh.pcap | grep -c 10.77.20.80/24reading from file ssh.pcap, link-type EN10MB (Ethernet), snapshot length 262144
0learner@router:~$ tshark -r ssh.pcap -Y ssh.protocol 4 0.000144 10.77.10.10 ? 10.77.20.80 SSH 109 Client: Protocol (SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20)
6 0.004585 10.77.20.80 ? 10.77.10.10 SSHv2 109 Server: Protocol (SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20)learner@router:~$ Steps (6)
- Type
tcpdump -n -A -r ssh.pcap | grep -c 10.77.20.80/24 - Press Enter
- Output:
reading from file ssh.pcap, link-type EN10MB (Ethernet), snapshot length 262144 0 - Type
tshark -r ssh.pcap -Y ssh.protocol - Press Enter
- Output:
4 0.000144 10.77.10.10 ? 10.77.20.80 SSH 109 Client: Protocol (SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20) 6 0.004585 10.77.20.80 ? 10.77.10.10 SSHv2 109 Server: Protocol (SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20)
Secure Remote Connectivity (Intermediate) returns to how you check the identity of an SSH server.
Identify mail and time by their jobs
Section titled “Identify mail and time by their jobs”There is no mail service in this lab. The following descriptions come from the standards and have no capture here.
SMTP (Simple Mail Transfer Protocol) transfers outgoing mail. A mail app can submit a message to its provider on port 587. Mail servers pass it to other servers on port 25. These are different jobs even though both use SMTP.
IMAP (Internet Message Access Protocol) lets a mail app read and manage messages in folders on a server. POP3 (Post Office Protocol version 3) is used to retrieve messages from a mailbox. A mail app can use one protocol to send and another to read. A capture from the two jobs can therefore show different ports from the same app.
NTP (Network Time Protocol) helps devices keep their clocks in step. A device can ask for time repeatedly so it can adjust for changes in its own clock. We have no lab time service, so there is no NTP capture here.
Compare the usual ports
Section titled “Compare the usual ports”For each service, start with what the two programs are doing. The transport and port narrow down what to look for. For mail, whether a session starts protected or switches to protection depends on the port and the setup.
| Service | Purpose | Transport | Usual port | Normally encrypted |
|---|---|---|---|---|
| HTTP (captured) | Request web content | TCP | 80 | No |
| HTTPS (captured) | Request protected web content | TCP in this lab | 443 | Yes |
| DNS (captured) | Look up names | UDP or TCP | 53 | No for ordinary DNS on this port |
| SSH (captured) | Remote login | TCP | 22 | Yes, after setup |
| SMTP (not captured) | Relay or submit mail | TCP | 25 for relay, 587 for submission | Relay depends on setup, submission normally uses TLS |
| IMAP (not captured) | Read and manage mail | TCP | 143 or 993 | Starts protected on 993, depends on setup on 143 |
| POP3 (not captured) | Retrieve mail | TCP | 110 or 995 | Starts protected on 995, depends on setup on 110 |
| NTP (not captured) | Set clocks | UDP | 123 | Normally no |
Mistakes to recognize
Section titled “Mistakes to recognize”“Everything is web traffic now.” Compare the captures in this module. The web request fetches a page on port 443. DNS looks up the name on port 53. SSH runs a remote command on port 22. Each exchange does a different job.
“A known port tells you the service.” TCP, UDP, and Ports shows the lab web server on port 8080. The number gives you a clue. The request and response can identify the service.
Try it yourself
Section titled “Try it yourself”On laptop, check the lab’s index page on port 8080 again with curl. Compare the first readable request line with the first line from each side of the SSH exchange. How can you identify which exchange used HTTP if the port column is hidden? Write down one line from each protocol.
Solution
The web server receives a line that names an HTTP method and a path. The SSH lines identify the protocol and software before the remote session becomes protected.
learner@laptop:~$ curl -v http://web.lab.test:8080/index.html 2>&1 | grep '^>'> GET /index.html HTTP/1.1
> Host: web.lab.test:8080
> User-Agent: curl/8.5.0
> Accept: */*
> learner@laptop:~$ Steps (3)
- Type
curl -v http://web.lab.test:8080/index.html 2>&1 | grep '^>' - Press Enter
- Output:
> GET /index.html HTTP/1.1 > Host: web.lab.test:8080 > User-Agent: curl/8.5.0 > Accept: */* >
- Read the SSH banners and find where the protected exchange follows.
- Use a service’s purpose to distinguish web requests, remote login, mail and time.
- Treat a usual port as a convention and use message evidence to identify the service.
Next, Practice: Everyday Application Traffic asks you to find where a page request fails.