Skip to content

Recognizing other services

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

Finish From name to page. Use netlab 1.2 in DNS mode and open two terminals in the Ubuntu VM.

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.

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

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 first and stop it once the remote command returns.
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 ssh.pcap port 22
  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. Sign in and leave web from terminal 2, then stop this listener.
  13. Press Ctrl + C
  14. Output: 41 packets captured 41 packets received by filter 0 packets dropped by kernel
Read the IPv4 address on web over SSH
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:~$ 

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. Run one command on the remote machine from laptop.
Steps (9)
  1. Type ssh learner@web.lab.test ip -4 -br address show eth0
  2. Press Enter
  3. 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])?
  4. Type yes into the running program
  5. Press Enter
  6. Output: Warning: Permanently added 'web.lab.test' (ED25519) to the list of known hosts. learner@web.lab.test's password:
  7. Type the password (the terminal shows nothing)
  8. Press Enter
  9. 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.

Search for the remote output and read the banners
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:~$ 

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. Search for the remote command's output and read the two banners.
Steps (6)
  1. Type tcpdump -n -A -r ssh.pcap | grep -c 10.77.20.80/24
  2. Press Enter
  3. Output: reading from file ssh.pcap, link-type EN10MB (Ethernet), snapshot length 262144 0
  4. Type tshark -r ssh.pcap -Y ssh.protocol
  5. Press Enter
  6. 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.

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.

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

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

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.

Check the request for the index file
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:~$ 

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 HTTP request line even though the lab uses an alternate port.
Steps (3)
  1. Type curl -v http://web.lab.test:8080/index.html 2>&1 | grep '^>'
  2. Press Enter
  3. 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.