Unencrypted Protocols
Inside a company network it is tempting to think "nobody can listen here". Then a laptop is infected, a switch port is mirrored by mistake, an ARP spoofer sits between a workstation and the gateway (ARP Spoofing), and every Telnet session, FTP login, LDAP bind and HTTP form on the segment becomes readable. Unencrypted protocols are the third common weakness: they expose credentials and data to anyone on the path, and they let an attacker change traffic, not only read it. The protocol-by-protocol details are in the "Application Protocols" section of Networking for Security (HTTP, SSH vs Telnet, FTP, mail, SMB, NFS, RDP, LDAP and Kerberos). This lesson is the assessor's version: finding cleartext across a whole network, proving the impact without collecting real secrets, and fixing it.
The cleartext list
| Cleartext | Port | Exposes | Replacement |
|---|---|---|---|
| Telnet | 23 | the whole session, including the password | SSH |
| FTP | 21 | USER/PASS, file contents |
SFTP (over SSH) or FTPS |
| HTTP with logins | 80 | form fields, cookies, Basic auth | HTTPS with HSTS |
| SMTP/IMAP/POP3 without TLS | 25, 143, 110 | mail and AUTH credentials |
implicit TLS (465, 993, 995) or enforced STARTTLS |
| LDAP simple bind | 389 | the bind password | LDAPS (636) or StartTLS, or Kerberos/SASL |
| SNMP v1/v2c | 161/udp | community strings, device data | SNMPv3 authPriv |
| syslog over UDP | 514/udp | logs (sometimes with secrets), spoofable | syslog over TLS (RFC 5425) |
| NFSv3, SMB 1 / unsigned SMB | 2049, 445 | file data, relayable authentication | NFSv4 with Kerberos (krb5p), SMB 3 with signing/encryption |
| VNC without TLS, old RDP security | 5900, 3389 | screens, keystrokes, weak authentication | VNC over SSH/TLS, RDP with NLA and TLS |
| Plain database protocols | 3306, 5432, 1433 | queries, results, sometimes passwords | TLS required on the server (ssl = on + hostssl in PostgreSQL) |
Finding it: from the inventory
The first pass needs no packets: map the open ports of the inventory scan to the table above (the leased printer was excluded from the scan, so its ports here come from its documentation and need confirming by the owner).
CLEAR = {21: "FTP", 23: "Telnet", 80: "HTTP", 110: "POP3", 143: "IMAP (STARTTLS?)", 389: "LDAP",
25: "SMTP (STARTTLS?)", 587: "submission (STARTTLS?)", 5900: "VNC", 2049: "NFS"}
TLS_OK = {22, 443, 465, 636, 993, 995}
scan = {"www.lab.test": {22, 80, 443}, "mail.lab.test": {25, 143, 587},
"files.lab.test": {21, 445}, "prn40.lab.test": {23, 80, 9100}, "db.lab.test": {22, 5432}}
for host, ports in scan.items():
for p in sorted(ports):
if p in CLEAR:
tag = "check" if "?" in CLEAR[p] else "CLEARTEXT"
print(f"{tag:9} {host:15} {p:>4} {CLEAR[p]}")
elif p not in TLS_OK:
print(f"{'verify':9} {host:15} {p:>4} unknown: does it require TLS?")CLEARTEXT www.lab.test 80 HTTP
check mail.lab.test 25 SMTP (STARTTLS?)
check mail.lab.test 143 IMAP (STARTTLS?)
check mail.lab.test 587 submission (STARTTLS?)
CLEARTEXT files.lab.test 21 FTP
verify files.lab.test 445 unknown: does it require TLS?
CLEARTEXT prn40.lab.test 23 Telnet
CLEARTEXT prn40.lab.test 80 HTTP
verify prn40.lab.test 9100 unknown: does it require TLS?
verify db.lab.test 5432 unknown: does it require TLS?
Three classes come out. Cleartext ports (FTP, Telnet, HTTP) are findings unless HTTP only redirects to HTTPS, which you confirm with one request. Check ports may upgrade with STARTTLS; the question is whether the server requires it before authentication (Nmap's smtp-commands and imap-capabilities scripts show whether STARTTLS is offered and whether AUTH/LOGINDISABLED appear before it). Verify ports (SMB, PostgreSQL, the printer's raw 9100) need a protocol-specific look: smb2-security-mode for SMB signing, the database's ssl settings, and 9100 is raw printing, cleartext by design and to be restricted to print servers.
Proving the impact without collecting secrets
An assessment report must show that a cleartext login is readable, but the assessor must not harvest real users' passwords. Two ways keep both goals: capture a test account's login that you made yourself, within scope; and redact any value at the moment you extract it. The session works on the lab capture http.pcap, which contains a test login, and prints the form fields with the value masked: enough evidence for the report, nothing worth stealing in the notes.
tshark -r $SAMPLES/pcap/http.pcap -q -z io,phs | sed -n '5,11p'
echo "--- form fields sent in cleartext:"
tshark -r $SAMPLES/pcap/http.pcap -Y 'http.request.method == "POST"' \
-T fields -E separator=' ' -e frame.number -e ip.src -e http.host -e http.request.uri -e urlencoded-form.key -e urlencoded-form.value |
awk '{ split($6, v, ","); printf "frame %s %s -> http://%s%s fields=%s password=%s\n", $1, $2, $3, $4, $5, (length(v[2]) ? "<" length(v[2]) " chars, redacted>" : "-") }'
eth frames:20 bytes:1595
ip frames:20 bytes:1595
tcp frames:20 bytes:1595
http frames:4 bytes:715
data-text-lines frames:1 bytes:187
urlencoded-form frames:1 bytes:227
--- form fields sent in cleartext:
frame 14 10.10.0.5 -> http://www.lab.test/login fields=user,password password=<12 chars, redacted>
The report line reads: "On 2026-01-15 at 10:00:01 UTC, a login to http://www.lab.test/login from 10.10.0.5 sent the fields user and password in cleartext (frame 14 of the evidence capture; value redacted, 12 characters). Any device on the path can read and replay it."
How cleartext use is detected continuously
- NetFlow/IPFIX or Zeek connection logs by port and protocol: any flow to 21, 23, 389 or 110 is a policy violation worth an alert (Zeek Logs with pandas).
- IDS rules that match
USER/PASSon FTP,AUTH PLAIN/LOGINbefore STARTTLS, or HTTP Basic auth on port 80 (Suricata and Snort Rules). - TLS metadata: Zeek's
ssl.logshows which servers still negotiate old versions.
How it is fixed
- Replace the protocol (Telnet → SSH, FTP → SFTP, HTTP → HTTPS) and turn the old one off; keeping both "for compatibility" keeps the weakness.
- Where STARTTLS exists, require it: Postfix
smtpd_tls_auth_only = yes, Dovecotssl = required(anddisable_plaintext_auth = yesin older versions), LDAP servers that refuse simple binds without TLS. - HSTS (with preload for public sites) so browsers never try HTTP first.
- Where a device can't encrypt (old printers, PLCs), isolate it: its own VLAN, reachable only from the one system that must talk to it, ideally through an encrypted tunnel (Inadequate Segmentation).
Pitfalls
- "Internal only" as an excuse: most intrusions start inside, on a phished laptop.
- STARTTLS offered but not required: an active attacker strips the
STARTTLScapability from the server's greeting and the client continues in cleartext. - An HTTP port that "only redirects" but also serves the login page or sets cookies without
Secure. - Copying real credentials into notes or reports during an assessment. Redact at extraction.
Practice
1. The mail server offers 25, 143 and 587. What exactly do you check on each?
25: server-to-server SMTP, where STARTTLS is opportunistic; check that AUTH isn't offered before STARTTLS. 143: IMAP; check that LOGINDISABLED is advertised before STARTTLS (no cleartext login). 587: submission; STARTTLS must be required before AUTH. Better: offer 993 and 465 (implicit TLS) and close 143.
2. Why does the session print the password's length instead of the value?
Evidence needs to show that a secret crossed the network, not what the secret is. Recording real values creates a new sensitive data store (the assessor's notes) and isn't needed to justify the fix.
3. A legacy PLC speaks only Modbus/TCP (502), cleartext and unauthenticated. What do you recommend?
It can't be fixed in the protocol, so contain it: a dedicated OT network, firewall rules that allow 502 only from the specific HMI/SCADA hosts, no route from office networks, monitoring of all Modbus write commands, and an encrypted tunnel or a vendor-supported secure gateway if traffic must cross other networks.
Test yourself
Which is the secure replacement for FTP in most environments?
- TFTP
- SFTP (over SSH) or FTPS
- Telnet
- HTTP
Why is STARTTLS that is offered but not required still a weakness?
- It is slower
- An active attacker can remove the STARTTLS offer and the client continues in cleartext
- It uses a weak cipher
- It only works on port 25
What did the tshark session report about the POST in http.pcap?
- Nothing
- Fields user and password sent in cleartext to http://www.lab.test/login
- An encrypted TLS session
- A DNS query
A device can't support encryption at all. What is the right fix?
- Accept the risk silently
- Isolate it: its own segment, reachable only from the systems that must talk to it, with monitoring
- Expose it on the Internet
- Change its port