Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 37 ยท Security Analysis

TLS Handshakes and Finding Cleartext Exposure

Read a TLS handshake in Wireshark, check versions and ciphers, and audit your own network for cleartext protocols that expose passwords. Defensive guide.

Encryption protects data on the wire, but only when it is actually used. A common security finding is not "the attacker broke TLS" but "the application sent the password over plain HTTP". Wireshark shows both: how a TLS session starts, and which protocols still travel in the open.

This lesson is for auditing your own networks and applications. Reading other people's traffic without permission is illegal and unethical. When you find cleartext secrets in your own captures, the fix is to change the application, not to hide the evidence. Examples below use made-up data.

The TLS handshake at a glance

sequenceDiagram
    participant C as Client
    participant S as Server
    C->>S: Client Hello (versions, ciphers, SNI)
    S->>C: Server Hello (chosen version and cipher)
    S->>C: Certificate chain
    S->>C: Finished (TLS 1.3: encrypted from here)
    C->>S: Finished
    C->>S: Application data (encrypted)

TLS 1.3 shortens the exchange: most messages after the Server Hello are encrypted.

Useful filters:

TEXT
tls.handshake                                  # all handshake messages
tls.handshake.type == 1                        # Client Hello
tls.handshake.type == 2                        # Server Hello
tls.handshake.extensions_server_name           # SNI value (hostname requested)
tls.record.version == 0x0301                   # TLS 1.0 records
tls.alert_message                              # TLS alerts (errors)

In the Server Hello, check the negotiated version and cipher suite. Secure setups today use TLS 1.2 or 1.3. SSL 3.0, TLS 1.0 and TLS 1.1 are deprecated, as are ciphers using RC4, 3DES or export-grade keys.

TLS alerts as troubleshooting clues

A TLS alert is a short message explaining a failure. handshake_failure often means no shared cipher or version, certificate_unknown or bad_certificate means the client did not accept the certificate, and protocol_version means a version mismatch. Filter with tls.alert_message.desc.

Python Grade negotiated TLS versions

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

What stays visible even with TLS

Encryption hides the content, but a capture still reveals metadata:

  • The IP addresses and ports of both ends.
  • The SNI hostname in the Client Hello (unless Encrypted Client Hello is used).
  • Certificate details in TLS 1.2 handshakes (in TLS 1.3 they are encrypted).
  • Sizes and timing of records, which can leak which page was visited.

This is why privacy advice recommends DNS over HTTPS/TLS and Encrypted Client Hello, and why a network administrator can still see which services a host uses.

Hunting cleartext protocols

Cleartext protocols send everything, including logins, readable by anyone who can see the traffic. On your own network, list which of them appear:

Protocol Filter Better replacement
HTTP http HTTPS
FTP ftp SFTP or FTPS
Telnet telnet SSH
SMTP/POP3/IMAP without TLS smtp || pop || imap Same protocols with TLS
SNMP v1/v2c snmp SNMPv3
LDAP simple bind ldap LDAPS
NetBIOS/LLMNR nbns || llmnr Disable if not needed

Open Statistics, then Protocol Hierarchy, in a capture of a segment you manage. Any of those names in the list is a finding to investigate.

If you find a real password in a capture, treat the capture as sensitive, change that password, and share the file only with people who need it. Delete captures when the investigation ends.

Detecting credentials in your own test traffic

Developers can check that a test application does not send secrets in the clear. The scan below works on made-up payload strings, the sort you would see in the "Follow TCP Stream" view of a test server on your own machine.

Python Flag likely cleartext secrets in sample payloads

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Note that HTTP Basic authentication is only Base64 encoded, not encrypted: anyone can decode ZGVtbzpkZW1v. Use it only inside TLS.

Fixing what you find

  • Redirect HTTP to HTTPS and send the Strict-Transport-Security header.
  • Disable old protocol versions and weak ciphers on servers.
  • Turn on TLS for mail, directory and database connections.
  • Replace Telnet and FTP with SSH and SFTP.
  • Capture again after the fix to confirm the cleartext is gone.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which TLS versions are considered secure to use today?

    TLS 1.2 and 1.3 are current; earlier versions are deprecated.
  2. 2. What part of a TLS session usually remains visible in a capture?

    SNI is sent unencrypted in most cases, along with IPs, ports and record sizes.
  3. 3. HTTP Basic authentication over plain HTTP is a problem because:

    The credentials are readable by anyone who can see the traffic.
  4. 4. You find a real password in a capture of your own network. What should you do first?

    The password is exposed, so rotate it, restrict the capture file, and fix the cleartext cause.

Summary

  • A TLS handshake negotiates version and cipher; check both for deprecated values.
  • TLS alerts explain handshake failures.
  • Even encrypted sessions leak metadata such as IPs, SNI and timing.
  • Audit your own network for HTTP, FTP, Telnet and similar protocols, then replace them with encrypted versions.

Next: Statistics: Conversations, Endpoints and I/O Graphs