Exchange email enumeration - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/msmail/exchange_enum metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Exchange email enumeration
Module: auxiliary/scanner/msmail/exchange_enum
Source code: modules/auxiliary/scanner/msmail/exchange_enum.go
Disclosure date: 2018-11-06
Last modification time: 2018-12-07 13:29:56 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -

Error-based user enumeration for Office 365 integrated email addresses

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/msmail/exchange_enum
msf auxiliary(exchange_enum) > show options
    ... show and set options ...
msf auxiliary(exchange_enum) > set RHOSTS ip-range
msf auxiliary(exchange_enum) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(exchange_enum) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(exchange_enum) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(exchange_enum) > set RHOSTS file:/tmp/ip_list.txt

Knowledge Base


OWA (Outlook Webapp) is vulnerable to time-based user enumeration attacks. This module leverages all known, and even some lesser-known services exposed by default Exchange installations to enumerate email.

Error-based user enumeration for Office 365 integrated email addresses

Verification Steps


  • Start msfconsole
  • use auxiliary/scanner/msmail/exchange_enum
  • set (EMAILorEMAIL_FILE)
  • run
  • creds

Results should look something like below if valid users were found:

host      origin    service        public  private  realm  private_type
----      ------    -------        ------  -------  -----  ------------
            443/tcp (owa)  [email protected]

Go back to menu.

Msfconsole Usage


Here is how the scanner/msmail/exchange_enum auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/msmail/exchange_enum

msf6 auxiliary(scanner/msmail/exchange_enum) > show info

       Name: Exchange email enumeration
     Module: auxiliary/scanner/msmail/exchange_enum
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2018-11-06

Provided by:
  poptart
  jlarose
  Vincent Yiu
  grimhacker
  Nate Power
  Nick Powers
  clee-r7

Check supported:
  No

Basic options:
  Name        Current Setting        Required  Description
  ----        ---------------        --------  -----------
  EMAIL                              no        Single email address to do identity test against
  EMAIL_FILE                         no        Path to file containing list of email addresses
  RHOSTS      outlook.office365.com  yes       Target endpoint
  THREADS     1                      yes       The number of concurrent threads (max one per host)

Description:
  Error-based user enumeration for Office 365 integrated email 
  addresses

Module Options


This is a complete list of options available in the scanner/msmail/exchange_enum auxiliary module:

msf6 auxiliary(scanner/msmail/exchange_enum) > show options

Module options (auxiliary/scanner/msmail/exchange_enum):

   Name        Current Setting        Required  Description
   ----        ---------------        --------  -----------
   EMAIL                              no        Single email address to do identity test against
   EMAIL_FILE                         no        Path to file containing list of email addresses
   RHOSTS      outlook.office365.com  yes       Target endpoint
   THREADS     1                      yes       The number of concurrent threads (max one per host)

Advanced Options


Here is a complete list of advanced options supported by the scanner/msmail/exchange_enum auxiliary module:

msf6 auxiliary(scanner/msmail/exchange_enum) > show advanced

Module advanced options (auxiliary/scanner/msmail/exchange_enum):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   ShowProgress         true             yes       Display progress messages during a scan
   ShowProgressPercent  10               yes       The interval in percent that progress should be shown
   VERBOSE              false            no        Enable detailed status messages
   WORKSPACE                             no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/msmail/exchange_enum module can do:

msf6 auxiliary(scanner/msmail/exchange_enum) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the scanner/msmail/exchange_enum auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/msmail/exchange_enum) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Error-based user enumeration for Office 365 integrated email addresses


Here is a relevant code snippet related to the "Error-based user enumeration for Office 365 integrated email addresses" error message:

14:	)
15:	
16:	func main() {
17:		metadata := &module.Metadata{
18:			Name:        "Exchange email enumeration",
19:			Description: "Error-based user enumeration for Office 365 integrated email addresses",
20:			Authors:     []string{"poptart", "jlarose", "Vincent Yiu", "grimhacker", "Nate Power", "Nick Powers", "clee-r7"},
21:			Date:        "2018-11-06",
22:			Type:        "single_scanner",
23:			Privileged:  false,
24:			References:  []module.Reference{},

Unable to parse 'Threads' value using default (5)


Here is a relevant code snippet related to the "Unable to parse 'Threads' value using default (5)" error message:

36:		emailFile := params["EMAIL_FILE"].(string)
37:		threads, e := strconv.Atoi(params["THREADS"].(string))
38:		ip := params["rhost"].(string)
39:	
40:		if e != nil {
41:			module.LogError("Unable to parse 'Threads' value using default (5)")
42:			threads = 5
43:		}
44:	
45:		if threads > 100 {
46:			module.LogInfo("Threads value too large, setting max(100)")

Expected 'EMAIL' or 'EMAIL_FILE' field to be populated


Here is a relevant code snippet related to the "Expected 'EMAIL' or 'EMAIL_FILE' field to be populated" error message:

46:			module.LogInfo("Threads value too large, setting max(100)")
47:			threads = 100
48:		}
49:	
50:		if email == "" && emailFile == "" {
51:			module.LogError("Expected 'EMAIL' or 'EMAIL_FILE' field to be populated")
52:			return
53:		}
54:	
55:		var validUsers []string
56:		if email != "" {

%s - %d


Here is a relevant code snippet related to the "%s - %d" error message:

90:					responseCode := msmail.WebRequestBasicAuth(URI, email, pass, tr)
91:					if strings.Contains(email, "@") && responseCode == 401 {
92:						module.LogGood(email + " - 401")
93:						validemails = append(validemails, email)
94:					} else if strings.Contains(email, "@") && responseCode == 404 {
95:						module.LogError(fmt.Sprintf("%s - %d", email, responseCode))
96:					} else {
97:						module.LogError(fmt.Sprintf("Unusual Response: %s - %d", email, responseCode))
98:					}
99:				}
100:			}(i)

Unusual Response: %s - %d


Here is a relevant code snippet related to the "Unusual Response: %s - %d" error message:

92:						module.LogGood(email + " - 401")
93:						validemails = append(validemails, email)
94:					} else if strings.Contains(email, "@") && responseCode == 404 {
95:						module.LogError(fmt.Sprintf("%s - %d", email, responseCode))
96:					} else {
97:						module.LogError(fmt.Sprintf("Unusual Response: %s - %d", email, responseCode))
98:					}
99:				}
100:			}(i)
101:		}
102:	

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • poptart
  • jlarose
  • Vincent Yiu
  • grimhacker
  • Nate Power
  • Nick Powers
  • clee-r7

Version


This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.