Skip to main content

IMAP / POP3

If SMTP is how mail gets sent, IMAP and POP3 are how it gets read. Crack one set of employee credentials and these protocols let you log straight into their mailbox — where confidential data, password reset links, and internal correspondence are waiting.
Protocol: TCP · Ports: IMAP 143 / 993 (TLS) · POP3 110 / 995 (TLS)

IMAP vs POP3

Both IMAP (Internet Message Access Protocol) and POP3 (Post Office Protocol) provide access to email on a mail server, but they work differently: IMAP keeps a consistent database across every device — sent mail copied into an IMAP folder is visible from any client. POP3 is the older, simpler model that just pulls mail down. Without extra measures, both run unencrypted, transmitting commands, mail, usernames, and passwords in plain text. That’s why most servers require an encrypted (TLS) session — and why the TLS ports (993, 995) are the ones you’ll usually be authenticating against.

Default Configuration

A common Linux mail server providing IMAP/POP3 is Dovecot. Both protocols have many configuration options, but for footprinting what matters is the command set you can drive from the command line. IMAP commands: POP3 commands:

Dangerous Settings

Most companies use third-party providers (Google, Microsoft), but some still run their own mail servers — and that’s where misconfigurations let you read every email sent and received, sensitive ones included. Configuration options worth scrutinizing:
The real prize here is credential reuse. If you’ve recovered an employee’s password anywhere else on the engagement, try it against IMAP/POP3 — a successful login gives you their entire mailbox: internal documents, password reset emails, and often credentials for other systems.

Footprinting the Service

Nmap

Scan the four IMAP/POP3 ports. If the server uses an embedded SSL certificate, the scan reveals organisational detail:
From the certificate you can read the common name (mail1.inlanefreight.htb), the organization (InlaneFreight), and location (California) — all useful for building username lists and understanding the target.

cURL

curl can list a mailbox directly. Adding verbose (-v) shows the TLS version, SSL certificate details, and the banner — which often discloses the mail server version:

Netcat — Plaintext Ports

You can talk to the plaintext ports (143 / 110) directly with nc. Connect to IMAP:
And POP3:
In both cases the server refuses plaintext auth — which tells you to switch to openssl against the TLS ports.

OpenSSL — TLS-Encrypted Interaction

Connect over TLS to authenticate properly. IMAP over SSL:
POP3 over SSL:

Reading Mail Over IMAP

Once authenticated over TLS, list mailboxes, select one, and read messages:
Use BODY.PEEK[] instead of FETCH ... all when reading mail — PEEK retrieves the message without setting the \Seen flag, so the mailbox owner doesn’t notice their unread mail suddenly being marked read. It’s the quiet way to read someone’s inbox.

Quick Reference

The footprinting flow: nmap for ports + cert intel → curl/openssl for banner and version → authenticate over TLS with found credentials → list mailboxes → read mail with BODY.PEEK[].
Next: SNMP — community strings and walking the MIB for credentials and config.