Exposing SMTP Misconfigurations: STARTTLS and Self-Signed Certs
The mail server on mail.myshpl.com uses a self-signed TLS certificate and does not enforce STARTTLS, which could allow a man-in-the-middle attacker to intercept or downgrade SMTP connections. The author also notes the server runs Exim 4.98.1 and suggests checking for known vulnerabilities.
medium.com
Published on medium.com
In this post, we will analyze and break down a real-world case of SMTP misconfiguration found on mail.myshpl.com. We will walk through step-by-step testing using tools like nmap, openssl, and swaks, and explore what security implications arise from these findings.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the mail server was configured with a self-signed certificate and without enforcing STARTTLS, so clients may connect without encryption or trust verification.
Impact
A man-in-the-middle attacker could intercept or downgrade SMTP connections because the certificate is self-signed and STARTTLS is not enforced, though the text does not confirm that credentials are actually exposed.
What the attacker needed
Network access to the mail server; victim connects without enforcing TLS
The fix
The server should use a certificate from a trusted authority and enforce STARTTLS so that clients cannot send credentials before encryption.
How it was found
- Scan common SMTP ports with nmap to find open services.
- Use openssl to initiate a STARTTLS handshake and inspect the certificate.
- Connect to the SMTP service and issue EHLO to list supported commands.
- Attempt to send mail to an external address without authentication to test for an open relay.
- Run sslscan and testssl.sh to check for weak ciphers and protocols.
- Use swaks to test SMTP capabilities and STARTTLS behaviour.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A mail server should present a certificate signed by a trusted authority so that email clients can verify they are talking to the real server. Here the certificate is self-signed, meaning it vouches for itself, so clients cannot easily tell if an attacker is intercepting the connection. Also, the server does not force encryption before login, so credentials could be sent in the clear if a client does not upgrade.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.