Retrieving the capabilities of an IMAP mail server

IMAP servers may support different capabilities. There is a command named CAPABILITY that allows clients to list these supported mail server capabilities, and we can use Nmap to automate this task.

This recipe shows you how to list the capabilities of an IMAP server by using Nmap.

How to do it...

Open your favorite terminal and enter the following Nmap command:

$ nmap -p143,993 --script imap-capabilities <target>

The results will be included under the script output section:

993/tcp  open     ssl/imap Dovecot imapd 
|_imap-capabilities: LOGIN-REFERRALS completed AUTH=PLAIN OK Capability UNSELECT THREAD=REFERENCES AUTH=LOGINA0001 IMAP4rev1 NAMESPACE SORT CHILDREN LITERAL+ IDLE SASL-IR MULTIAPPEND 

How it works...

The script imap-capabilities was submitted by Brandon Enright, and it attempts to list the supported functionality of IMAP servers by using the command CAPABILITY defined in the RFC 3501.

The argument -p143,993 --script imap-capabilities tells Nmap to launch the NSE script imap-capabilities if an IMAP server is found running on port 143 or 993.

There's more...

For cases where the IMAP server is running on a non-standard port you can use the port selection flag -p, or enable Nmap's service detection:

#nmap -sV --script imap-capabilities <target>

Debugging NSE scripts

If something unexpected happens when you run any of the NSE scripts, turn on debugging to get additional information. Nmap uses the flag -d for debugging and you can set any integer between 0 and 9:

$ nmap -p80 --script http-google-email -d4 <target>

See also

  • The Brute forcing SMTP passwords recipe
  • The Enumerating users in an SMTP server recipe
  • The Detecting backdoor SMTP servers recipe
  • The Brute forcing IMAP passwords recipe
  • The Retrieving the capabilities of an IMAP mail server recipe
  • The Brute forcing POP3 passwords recipe
  • The Retrieving the capabilities of a POP3 mail server recipe
  • The Detecting vulnerable Exim SMTP servers version 4.70 through 4.75 recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.24