If authenticated: enumerate mailboxes (A1 LIST "" "*")
Read mails for credentials, internal info: A1 FETCH 1 BODY[]
Check POP3: USER [user] / PASS [pass] / LIST / RETR 1
Test for known mail server CVEs (SLmail, IMail, etc.)
π― Operational Context
Think Dumber First: Check for cleartext authentication on ports 143/110 before attempting brute-force. Capture credentials with tcpdump -i [IFACE] -w capture.pcap 'port 143 or 110' if on the same segment. IMAP login attempts donβt typically lockout β try top 20 common corporate passwords against discovered usernames before running full Hydra.
When you land here: Ports 143, 110, 993, or 995 open. Banner grab reveals Dovecot/Courier/Exchange IMAP. Test LOGIN then AUTHENTICATE PLAIN. If TLS required, wrap with openssl. Valid usernames from SMTP VRFY/RCPT TO are your target list.
β‘ Tactical Cheatsheet
Command
Tactical Outcome
sudo nmap -sV -p110,143,993,995 -sC [TARGET_IP]
Detect versions and grab SSL certificate info
openssl s_client -connect [TARGET_IP]:993
Connect to IMAPS β view certificate and interact
Connect directly to port 993 (IMAPS) with openssl s_client -connect [TARGET]:993
AUTH LOGIN returns β535 Authentication failedβ with valid credentials
Account policy lockout or wrong auth mechanism
Try AUTH PLAIN with base64(userpass); verify account not locked via LDAP
Telnet session drops immediately on connect
Service requires TLS from the first byte
Use openssl s_client -connect [TARGET]:993 -quiet for IMAPS interactive session
Hydra IMAP brute-force returns all attempts as failed
Rate limiting or connection reset
Reduce threads -t 2; add delay -W 5; verify correct login format with -e ns
π Reporting Trigger
Finding Title: Cleartext IMAP/POP3 Authentication Permitted
Impact: Credentials transmitted in plaintext β interceptable on any shared network segment. Valid email account credentials may enable lateral movement if credentials are reused.
Root Cause: Plaintext IMAP (143) and POP3 (110) ports active without STARTTLS enforcement. No TLS requirement enforced by server configuration.
Recommendation: Disable plaintext ports 143 and 110. Enforce IMAPS (993) and POP3S (995) exclusively. Configure disable_plaintext_auth = yes (Dovecot) or equivalent. Implement multi-factor authentication for email access.