On premise user enumeration - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/msmail/onprem_enum metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: On premise user enumeration
Module: auxiliary/scanner/msmail/onprem_enum
Source code: modules/auxiliary/scanner/msmail/onprem_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: -
On premise enumeration of valid exchange users
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/onprem_enum
msf auxiliary(onprem_enum) > show options
... show and set options ...
msf auxiliary(onprem_enum) > set RHOSTS ip-range
msf auxiliary(onprem_enum) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(onprem_enum) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(onprem_enum) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(onprem_enum) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
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 users. It also targets Office 365 for error-based user enumeration.
- Error-based user enumeration for on premise Exchange services
Note: Currently uses RHOSTS which resolves to an IP which is NOT desired, this is currently being fixed
Verification Steps
- Start
msfconsole
use auxiliary/scanner/msmail/onprem_enum
set RHOSTS <target>
set (
USERor
USER_FILE`)run
creds
Results should look something like below if valid users were found:
host origin service public private realm private_type
---- ------ ------- ------ ------- ----- ------------
10.1.1.1 10.1.1.1 443/tcp (owa)
10.1.1.1 10.1.1.1 443/tcp (owa) chris
Go back to menu.
Msfconsole Usage
Here is how the scanner/msmail/onprem_enum auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/msmail/onprem_enum
msf6 auxiliary(scanner/msmail/onprem_enum) > show info
Name: On premise user enumeration
Module: auxiliary/scanner/msmail/onprem_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
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME no Single user name to do identity test against
USER_FILE no Path to file containing list of users
Description:
On premise enumeration of valid exchange users
Module Options
This is a complete list of options available in the scanner/msmail/onprem_enum auxiliary module:
msf6 auxiliary(scanner/msmail/onprem_enum) > show options
Module options (auxiliary/scanner/msmail/onprem_enum):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME no Single user name to do identity test against
USER_FILE no Path to file containing list of users
Advanced Options
Here is a complete list of advanced options supported by the scanner/msmail/onprem_enum auxiliary module:
msf6 auxiliary(scanner/msmail/onprem_enum) > show advanced
Module advanced options (auxiliary/scanner/msmail/onprem_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/onprem_enum module can do:
msf6 auxiliary(scanner/msmail/onprem_enum) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/msmail/onprem_enum auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/msmail/onprem_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:
- Unable to parse 'Threads' value using default (5)
- Expected 'USER_FILE' or 'USERNAME' field to be populated
- Unable to resolve host provided to determine valid users.
- Unable to resolve host provided to determine valid users.
- Error determining whether length of times gathered is even or odd to obtain median value.
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.
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:
34: userFile := params["USER_FILE"].(string)
35: userName := params["USERNAME"].(string)
36: host := params["rhost"].(string)
37: threads, e := strconv.Atoi(params["THREADS"].(string))
38: if e != nil {
39: module.LogError("Unable to parse 'Threads' value using default (5)")
40: threads = 5
41: }
42:
43: if threads > 100 {
44: module.LogInfo("Threads value too large, setting max(100)")
Expected 'USER_FILE' or 'USERNAME' field to be populated
Here is a relevant code snippet related to the "Expected 'USER_FILE' or 'USERNAME' field to be populated" error message:
44: module.LogInfo("Threads value too large, setting max(100)")
45: threads = 100
46: }
47:
48: if userFile == "" && userName == "" {
49: module.LogError("Expected 'USER_FILE' or 'USERNAME' field to be populated")
50: return
51: }
52:
53: var validUsers []string
54: avgResponse := basicAuthAvgTime(host)
Unable to resolve host provided to determine valid users.
Here is a relevant code snippet related to the "Unable to resolve host provided to determine valid users." error message:
81: } else if msmail.WebRequestCodeResponse(url2) == 401 {
82: urlToHarvest = url2
83: } else if msmail.WebRequestCodeResponse(url3) == 401 {
84: urlToHarvest = url3
85: } else {
86: module.LogInfo("Unable to resolve host provided to determine valid users.")
87: return []string{}
88: }
89: var validusers []string
90: tr := &http.Transport{
91: TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
Unable to resolve host provided to determine valid users.
Here is a relevant code snippet related to the "Unable to resolve host provided to determine valid users." error message:
129: } else if msmail.WebRequestCodeResponse(url2) == 401 {
130: urlToHarvest = url2
131: } else if msmail.WebRequestCodeResponse(url3) == 401 {
132: urlToHarvest = url3
133: } else {
134: module.LogInfo("Unable to resolve host provided to determine valid users.")
135: return -1
136: }
137:
138: //We are determining sample auth response time for invalid users, the password used is irrelevant.
139: pass := "Summer201823904"
Error determining whether length of times gathered is even or odd to obtain median value.
Here is a relevant code snippet related to the "Error determining whether length of times gathered is even or odd to obtain median value." error message:
167: medianTime = (sliceOfTimes[positionTwo] + sliceOfTimes[positionOne]) / 2
168: } else if len(sliceOfTimes)%2 != 0 {
169: position := len(sliceOfTimes)/2 - 1
170: medianTime = sliceOfTimes[position]
171: } else {
172: module.LogError("Error determining whether length of times gathered is even or odd to obtain median value.")
173: }
174: module.LogInfo("Avg Response: " + time.Duration(medianTime).String())
175: return time.Duration(medianTime)
176: }
177:
Go back to menu.
Related Pull Requests
- #11066 Merged Pull Request: (GoLang) Centralize logging sync, fix minor logging issues
- #10964 Merged Pull Request: Port msmailprobe(Nick Powers) + Cleanup for GO bridge
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.1.36-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.