Ports 110, 143, 993, 995 IMAP POP3
A mail server
(sometimes also referred to as an email server) is a server that handles and delivers email over a network, usually over the Internet. When we download emails to our email application, it will connect to a POP3
or IMAP4
server on the Internet, which allows the user to save messages in a server mailbox and download them periodically.
- By default,
POP3
clients remove downloaded messages from the email server. - On the other hand, by default,
IMAP4
clients do not remove downloaded messages from the email server.
IMAP allows online management of emails directly on the server and supports folder structures. Therefore, protocols such as IMAP must be used for additional functionalities such as hierarchical mailboxes directly at the mail server, access to multiple mailboxes during a session, and preselection of emails. IMAP is text-based and has extended functions, such as browsing emails directly on the server. It is also possible for several users to access the email server simultaneously. IMAP works unencrypted and transmits commands, emails, or usernames and passwords in plain text. Depending on the method and implementation used, the encrypted connection uses the standard port 143
or an alternative port such as 993
.
POP3 only provides listing, retrieving, and deleting emails as functions at the email server. Depending on the method and implementation used, the encrypted connection uses the standard port 110
or an alternative port such as 995
.
Footprinting IMAP / POP3
Port | Service |
---|---|
TCP/25 |
SMTP Unencrypted |
TCP/143 |
IMAP4 Unencrypted |
TCP/110 |
POP3 Unencrypted |
TCP/465 |
SMTP Encrypted |
TCP/587 |
SMTP Encrypted/STARTTLS |
TCP/993 |
IMAP4 Encrypted |
TCP/995 |
POP3 Encrypted |
We can use the Mail eXchanger
(MX
) DNS record to identify a mail server. The MX record specifies the mail server responsible for accepting email messages on behalf of a domain name. I
Connect to an IMAP /POP3 server
To interact with the IMAP or POP3 server over SSL, we can use openssl
, as well as ncat
. The commands for this would look like this:
Basic IMAP commands
Basic POP3 commands
Misconfigurations in an email server
Setting | Description |
---|---|
auth_debug |
Enables all authentication debug logging. |
auth_debug_passwords |
This setting adjusts log verbosity, the submitted passwords, and the scheme gets logged. |
auth_verbose |
Logs unsuccessful authentication attempts and their reasons. |
auth_verbose_passwords |
Passwords used for authentication are logged and can also be truncated. |
auth_anonymous_username |
This specifies the username to be used when logging in with the ANONYMOUS SASL mechanism. |