Weaknesses in service protocols
Every network service fails in three different ways, and it pays to keep them apart because they are tested and fixed differently. Design flaws: the protocol never encrypted or authenticated (Telnet, FTP, SNMPv1/v2c, Modbus) and no patch is possible, only replacement. Configuration flaws: the software is sound, but it is installed with default credentials, anonymous access or listening on every interface (Redis, MongoDB, NFS, SMB with null sessions). Implementation flaws: a specific CVE in a specific version (EternalBlue, BlueKeep, regreSSHion, RediShell). Enumeration tells you what is there; this page tells you what is usually wrong with each thing.
flowchart LR
S["Exposed service"] --> D["Design<br/>cleartext / no auth"]
S --> C["Configuration<br/>defaults / anonymous"]
S --> I["Implementation<br/>CVE by version"]
D --> R["Replace"]
C --> R2["Configure"]
I --> R3["Patch"]
Threat model
Section titled “Threat model”On an authorized engagement the order follows the least risk for the client: first what can be checked without credentials and without exploiting (anonymous access, versions, encryption), then credentials (with the lockout policy in hand, see spraying), and only at the end the exploitation of a CVE, with explicit authorization for that host, because many service exploits are memory corruption and can knock it over. A cleartext service on an internal network is a finding even if nothing is ever captured: the evidence is a capture of your own login, not someone else’s.
Anatomy: the three classes of flaw
Section titled “Anatomy: the three classes of flaw”| Class | Example | How it is demonstrated | How it is fixed |
|---|---|---|---|
| Design | Telnet, FTP, POP3/IMAP without TLS, SNMP v1/v2c, a panel over HTTP, LLMNR | capture of your own session with tcpdump/Wireshark (see sniffing) |
replace with the encrypted version (SSH, SFTP/FTPS, SNMPv3, TLS) or switch off |
| Configuration | Redis without requirepass, MongoDB without auth, NFS to *, SMB with null session, sa without password |
connection without credentials and one harmless read (INFO, listDatabases, showmount) |
enable authentication, bind to the internal interface, ACLs |
| Implementation | MS17-010, CVE-2019-0708, CVE-2024-6387, CVE-2025-49844 | banner version + non-destructive check (NSE vuln, vendor script) |
patch; mitigate meanwhile (disable the feature, filter) |
Variants: service by service
Section titled “Variants: service by service”SMB (445)
Section titled “SMB (445)”The protocol with the longest history of critical implementation flaws and the most valuable one on Windows networks, because it carries NTLM authentication and gives access to files and RPC.
- Design and version: SMBv1 (no mandatory signing, no encryption, vulnerable to
MS17-010) has been disabled by default since Windows 10 and its service was removed in
later releases; any
SMB1: Trueinnxcoutput is a finding. - Signing: without mandatory SMB signing, traffic can be relayed (see NTLM relay). Since Windows 11 24H2 and Server 2025, signing is required by default on the client, and NTLMv1 has been removed from both.
- Configuration: null sessions, shares with
Everyone,SYSVOLwith passwords in GPP (see GPP). - Live CVEs: MS17-010 (EternalBlue, CVE-2017-0144) still shows up on industrial and healthcare networks; CVE-2020-0796 (SMBGhost) on unpatched Windows 10 1903/1909.
nxc smb 10.0.0.0/24 # OS, signing, SMBv1 per hostnmap --script smb-protocols,smb2-security-mode -p 445 10.0.0.5nmap --script smb-vuln-ms17-010 -p 445 10.0.0.5 # safe check, does not exploitSSH (22)
Section titled “SSH (22)”A well-designed protocol; the flaws are configuration (passwords, old algorithms, reused keys) and, now and then, implementation.
- Algorithms:
ssh-auditlists weak ciphers, MACs and kex. Terrapin (CVE-2023-48795, Dec 2023) lets a man-in-the-middle truncate messages at the start of the session and downgrade the negotiated security whenchacha20-poly1305@openssh.comor CBC ciphers with-etmare in use; the strict kex countermeasure must be on both ends. - regreSSHion (CVE-2024-6387, Jul 2024): race condition in
sshdthat allows unauthenticated remote code execution as root; affects portable OpenSSH 8.5p1–9.7p1 on glibc Linux, fixed in 9.8 (Jul 1, 2024). Winning the race takes hours and is unreliable, but the version in the banner is enough for the finding. - Configuration:
PermitRootLogin yes,PasswordAuthentication yeswith weak passwords,authorized_keyswith keys of former employees,AllowAgentForwardingon jump hosts (agent hijacking). - User enumeration: CVE-2018-15473 (OpenSSH < 7.7) by timing difference.
ssh-audit 10.0.0.5 # algorithms and known CVEs by versionnmap --script ssh2-enum-algos,ssh-auth-methods -p 22 10.0.0.5FTP (21), Telnet (23), POP3/IMAP (110/143)
Section titled “FTP (21), Telnet (23), POP3/IMAP (110/143)”Design flaws: credentials and data in the clear. Anonymous FTP access is a configuration flaw and is still common on file-exchange servers shared with customers.
- FTP:
anonymouswith listing and, worse, with write access; if the directory is the webroot of a web server, uploading an executable file is RCE (see file upload). FTP bounce (nmap -b) on very old servers. - Telnet: on network gear and embedded systems with factory credentials; its mere presence on a corporate network is a finding.
- POP3/IMAP without TLS: the mail client sends
USER/PASSorLOGINin the clear; an optionalSTARTTLSis useless if the client does not require it.
nmap --script ftp-anon,ftp-syst -p 21 10.0.0.5openssl s_client -starttls imap -connect 10.0.0.5:143 </dev/null | head # is there STARTTLS?SNMP (161/udp)
Section titled “SNMP (161/udp)”v1 and v2c do not encrypt and the community travels in the clear; v3 encrypts and
authenticates. The flaw is design in v1/v2c and configuration when the community is
public/private or exposed to the user network. With private (write) configuration can
be changed; on Cisco, the CISCO-CONFIG-COPY MIB allows dumping the whole configuration to
a TFTP server of your own.
onesixtyone -c wordlist.txt 10.0.0.0/24 # communities by brute force (UDP, fast)snmpwalk -v2c -c public 10.0.0.5 1.3.6.1.2.1.1 # system; if it answers, so does the rest of the MIBSMTP (25/587)
Section titled “SMTP (25/587)”- Open relay (configuration): the server accepts
RCPT TOfor foreign domains from outside; useful for phishing with the company’s sender.nmap --script smtp-open-relay. - User enumeration (design/configuration):
VRFY,EXPN,RCPT TOwith different replies for valid and invalid users. - No TLS (
STARTTLSmissing):AUTH LOGINcredentials in the clear. - No SPF/DKIM/DMARC on the domain: not a server flaw, but checked on the same engagement (see phishing).
RDP (3389)
Section titled “RDP (3389)”- NLA disabled (configuration): the server shows the login screen before authenticating, exposes version and user, and is the precondition for BlueKeep.
- BlueKeep (CVE-2019-0708): unauthenticated RCE on unpatched Windows 7/2008/2008 R2; the public exploit is unstable (BSOD), so on an engagement it is demonstrated with the Nmap or Metasploit check, not with the exploit.
- Self-signed certificate: allows a man-in-the-middle with
seth/pyrdpon networks where users click through the warning (see MITM). - Passwords: Internet-exposed RDP with local users is the most common ransomware entry vector through brute force.
nmap --script rdp-ntlm-info,rdp-enum-encryption -p 3389 10.0.0.5 # NLA, version, hostnamenmap --script rdp-vuln-ms12-020 -p 3389 10.0.0.5Databases
Section titled “Databases”Almost everything is configuration: listening on 0.0.0.0 without authentication, or with
the default administration account.
| Service | Typical flaw | Harmless check | Consequence |
|---|---|---|---|
| Redis (6379) | no requirepass/ACL, bind 0.0.0.0, protected mode disabled |
redis-cli -h H INFO server |
read and write keys; CONFIG SET dir writes arbitrary files; RediShell (CVE-2025-49844, Oct 2025, CVSS 9.9) escapes the Lua sandbox with authenticated access (or none, if there is no auth) |
| MongoDB (27017) | no authentication (old versions listened on all interfaces) | mongosh --host H --eval 'db.adminCommand("listDatabases")' |
full dump; MongoBleed (CVE-2025-14847, Dec 2025) reads server memory without authentication on 3.6–8.2.2, actively exploited and in CISA’s KEV catalog |
| MySQL/MariaDB (3306) | root without password, root@'%' |
mysql -h H -u root -e 'SELECT VERSION()' |
read files (LOAD DATA LOCAL), write (INTO OUTFILE) if secure_file_priv allows it |
| PostgreSQL (5432) | trust for postgres in pg_hba.conf |
psql -h H -U postgres -c 'SELECT version()' |
COPY ... TO PROGRAM runs commands as the service user |
| MSSQL (1433) | sa with a weak password; mixed authentication |
nxc mssql H -u sa -p '' --local-auth |
xp_cmdshell, linked servers, hash theft via UNC (see MSSQL) |
| Elasticsearch (9200) | no authentication by default on versions < 8 | curl H:9200/_cat/indices |
read every index |
Redis only enters protected mode (answers loopback only) when it starts with the default
configuration, with no bind and no password; as soon as the administrator sets
bind 0.0.0.0 without requirepass, it is open. Censys counted around 39,000
unauthenticated Redis instances exposed to the Internet in 2022.
Red Team
Section titled “Red Team”Researcher workflow
Section titled “Researcher workflow”- For each service, classify the flaw: design, configuration or implementation. That decides the test and the report’s recommendation.
- Design: capture your own session (
tcpdump -i eth0 port 23 -A) as evidence; do not capture other people’s traffic without explicit authorization. - Configuration: one connection without credentials and one harmless read as evidence; no writing, no deleting.
- Implementation: banner version + non-destructive check (NSE
vuln, vendor script). The exploit only with authorization for that host and with the client warned it may go down. - Default and weak credentials with the lockout policy known.
- Every finding with host, port, version, evidence and the reference (CVE, vendor advisory).
nxcfor SMB/LDAP/MSSQL/SSH/FTP/RDP/WinRM/NFS;ssh-audit;onesixtyoneandsnmpwalk;redis-cli,mongosh,mysql,psql.- NSE:
smb-vuln-*,rdp-*,ssh2-enum-algos,ftp-anon,smtp-open-relay. searchsploit, NVD and vendor advisories for the exact version; CISA KEV to know what is actively exploited.
Impact and chaining
Section titled “Impact and chaining”A cleartext service yields credentials (see sniffing and MITM); an open database yields data and, often, command execution on the host; an SMB or RDP CVE yields SYSTEM directly. On Windows everything ends in lateral movement; on Linux, in local enumeration to escalate.
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”- Connections to database services from hosts that are not the application servers (Zeek
conn.logby destination port and source). - Telnet/FTP/SNMP v1-v2c sessions on the network: Zeek and Suricata identify them by protocol; their existence is already an alert.
- Bursts of authentication failures on SSH, RDP, SMB and databases (EID 4625,
sshdinauth.log, MySQL/PostgreSQL logs). sshdwith many consecutiveTimeout before authenticationfrom one source: the pattern of a regreSSHion attempt.- Redis with
CONFIG SET,SLAVEOF/REPLICAOForEVALcommands from unknown clients; MongoDB with malformed compressed messages after MongoBleed.
Telemetry and sources
Section titled “Telemetry and sources”Authentication logs of each service, Zeek (conn, ssh, rdp, smb_*, ftp, snmp),
Suricata with the ET ruleset, and the version inventory (which gives away the CVE before the
attacker does).
Hardening
Section titled “Hardening”- Design: replace Telnet with SSH, FTP with SFTP, POP3/IMAP/SMTP with mandatory TLS
(
STARTTLSrequired by the client), SNMPv3 withauthPriv. - Configuration: mandatory authentication on every database,
bindto the internal interface, default accounts renamed or disabled, SMB null sessions disabled, SMB signing required, NLA on RDP,PermitRootLogin noand keys on SSH. - Implementation: patching prioritized by KEV and by exposure; SMBv1 gone; OpenSSH, Redis and MongoDB above the fixed versions (9.8, the October 2025 release, and 8.2.3/8.0.17/7.0.28 respectively).
- Network: databases and management never reachable from the Internet or from the user network; RDP only through VPN or a gateway.
Response
Section titled “Response”A cleartext service with captured credentials forces rotating all of them; an open database is treated as a data breach until proven otherwise (Shadowserver assumes compromise for any exposed unauthenticated Redis); an exploited SMB or RDP CVE is full host compromise and the host is rebuilt.
CVEs and real cases
Section titled “CVEs and real cases”- MS17-010 / EternalBlue (CVE-2017-0144, 2017): SMBv1; WannaCry and NotPetya. Still found on OT networks and hospitals.
- BlueKeep (CVE-2019-0708, 2019): RDP without NLA on Windows 7/2008; unauthenticated RCE.
- Terrapin (CVE-2023-48795, Dec 2023): prefix truncation in SSH; mitigated with strict kex in OpenSSH 9.6 and other implementations.
- regreSSHion (CVE-2024-6387, Jul 2024): race in
sshd, OpenSSH 8.5p1–9.7p1; Qualys estimated more than 14 million exposed instances. - RediShell (CVE-2025-49844, Oct 2025): 13-year-old use-after-free in Redis’s Lua interpreter; RCE from a Lua script.
- MongoBleed (CVE-2025-14847, Dec 2025): unauthenticated memory read on MongoDB 3.6–8.2.2; exploited within days of publication, ~79,000 exposed instances according to Shadowserver.
Testing checklist
Section titled “Testing checklist”- Each service classified: design / configuration / implementation.
- Cleartext services demonstrated with a capture of your own session.
- Databases tried without credentials with a harmless read.
- SMB: SMBv1, signing and null sessions checked on every host.
- SSH:
ssh-auditand version against 8.5p1–9.7p1 and Terrapin. - RDP: NLA and version; BlueKeep only with the check, not the exploit.
- Versions cross-checked with NVD and KEV; exploits only with per-host authorization.
- Report recommendation matched to the class of flaw (replace / configure / patch).
References
Section titled “References”- Microsoft Learn, SMB security hardening in Windows Server 2025 and Windows 11: https://learn.microsoft.com/en-us/windows-server/storage/file-server/smb-security-hardening
- Microsoft Learn, Features removed or deprecated in Windows Server (NTLMv1, SMB1): https://learn.microsoft.com/en-us/windows-server/get-started/deprecated-features
- OpenSSH 9.8 release notes (Jul 1, 2024): https://www.openssh.org/txt/release-9.8
- Qualys, regreSSHion: RCE in OpenSSH’s server (CVE-2024-6387): https://www.qualys.com/regresshion-cve-2024-6387
- Terrapin Attack (CVE-2023-48795), advisory on oss-security (Dec 18, 2023): https://seclists.org/oss-sec/2023/q4/292
- Redis, Security (protected mode, ACLs,
requirepass): https://redis.io/docs/latest/operate/oss_and_stack/management/security/ - Redis, advisory GHSA-4789-qfc9-5f9q (CVE-2025-49844): https://github.com/redis/redis/security/advisories/GHSA-4789-qfc9-5f9q
- MongoDB, SERVER-115508 (CVE-2025-14847, fixed versions): https://jira.mongodb.org/browse/SERVER-115508
- Censys, Databases Exposed, Part 1: Redis (2022): https://censys.com/blog/databases-exposed-redis/
- Shadowserver, Open Redis Report: https://www.shadowserver.org/what-we-do/network-reporting/open-redis-report/
- Microsoft, MS17-010: https://learn.microsoft.com/en-us/security-updates/securitybulletins/2017/ms17-010
- NVD, CVE-2019-0708 (BlueKeep): https://nvd.nist.gov/vuln/detail/CVE-2019-0708