Skip to content

Commit a1e3a23

Browse files
authored
Merge pull request rapid7#20262 from bwatters-r7/fix/vcenter_vmdir_gather
Fix references to LDAP Datastore Options
2 parents 56dbd91 + 02a9eb3 commit a1e3a23

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

documentation/modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module uses an anonymous-bind LDAP connection to dump data from
66
the vmdir service in VMware vCenter Server version 6.7 prior to the
77
6.7U3f update, only if upgraded from a previous release line, such as
88
6.0 or 6.5.
9-
If the bind username and password are provided (BIND_DN and BIND_PW
9+
If the bind username and password are provided (BIND_DN and LDAPPassword
1010
options), these credentials will be used instead of attempting an
1111
anonymous bind.
1212

@@ -36,18 +36,33 @@ If you already have the LDAP base DN, you may set it in this option.
3636
### VMware vCenter Server 6.7 virtual appliance on ESXi
3737

3838
```
39-
msf5 > use auxiliary/gather/vmware_vcenter_vmdir_ldap
40-
msf5 auxiliary(gather/vmware_vcenter_vmdir_ldap) > options
39+
msf6 auxiliary(gather/vmware_vcenter_vmdir_ldap) > show options
4140
42-
Name Current Setting Required Description
43-
---- --------------- -------- -----------
44-
BASE_DN no LDAP base DN if you already have it
45-
DOMAIN no The domain to authenticate to
46-
PASSWORD no The password to authenticate with
47-
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
48-
RPORT 636 yes The target port
49-
SSL true no Enable SSL on the LDAP connection
50-
USERNAME no The username to authenticate with
41+
Module options (auxiliary/gather/vmware_vcenter_vmdir_ldap):
42+
43+
Name Current Setting Required Description
44+
---- --------------- -------- -----------
45+
BASE_DN no LDAP base DN if you already have it
46+
SSL true no Enable SSL on the LDAP connection
47+
48+
49+
Used when connecting via an existing SESSION:
50+
51+
Name Current Setting Required Description
52+
---- --------------- -------- -----------
53+
SESSION no The session to run this module on
54+
55+
56+
Used when making a new connection via RHOSTS:
57+
58+
Name Current Setting Required Description
59+
---- --------------- -------- -----------
60+
LDAPDomain no The domain to authenticate to
61+
LDAPPassword no The password to authenticate with
62+
LDAPUsername no The username to authenticate with
63+
RHOSTS no The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-
64+
metasploit.html
65+
RPORT 636 no The target port
5166
5267
5368
Auxiliary action:
@@ -57,6 +72,8 @@ Auxiliary action:
5772
Dump Dump all LDAP data
5873
5974
75+
76+
View the full module info with the info, or info -d command.
6077
msf5 auxiliary(gather/vmware_vcenter_vmdir_ldap) > set rhosts [redacted]
6178
rhosts => [redacted]
6279
msf5 auxiliary(gather/vmware_vcenter_vmdir_ldap) > run

modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(info = {})
1919
the vmdir service in VMware vCenter Server version 6.7 prior to the
2020
6.7U3f update, only if upgraded from a previous release line, such as
2121
6.0 or 6.5.
22-
If the bind username and password are provided (BIND_DN and BIND_PW
22+
If the bind username and password are provided (BIND_DN and LDAPPassword
2323
options), these credentials will be used instead of attempting an
2424
anonymous bind.
2525
},
@@ -91,20 +91,27 @@ def run
9191

9292
# Look for an entry with a non-empty vmwSTSPrivateKey attribute
9393
unless entries&.find { |entry| entry[:vmwstsprivatekey].any? }
94-
print_error("#{ldap.peerinfo} is NOT vulnerable to CVE-2020-3952") unless datastore['BIND_PW'].present?
94+
print_error("#{ldap.peerinfo} is NOT vulnerable to CVE-2020-3952") unless datastore['LDAPPassword'].present?
9595
print_error('Dump failed')
9696
return Exploit::CheckCode::Safe
9797
end
9898

99-
print_good("#{ldap.peerinfo} is vulnerable to CVE-2020-3952") unless datastore['BIND_PW'].present?
99+
print_good("#{ldap.peerinfo} is vulnerable to CVE-2020-3952") unless datastore['LDAPPassword'].present?
100100
pillage(entries)
101101

102102
# HACK: Stash discovered base DN in CheckCode reason
103103
Exploit::CheckCode::Vulnerable(base_dn)
104104
end
105+
rescue Errno::ECONNRESET
106+
fail_with(Failure::Disconnected, 'The connection was reset.')
107+
rescue Rex::ConnectionError => e
108+
fail_with(Failure::Unreachable, e.message)
109+
rescue Rex::Proto::Kerberos::Model::Error::KerberosError => e
110+
fail_with(Failure::NoAccess, e.message)
111+
rescue Rex::Proto::LDAP::LdapException => e
112+
fail_with(Failure::NoAccess, e.message)
105113
rescue Net::LDAP::Error => e
106-
print_error("#{e.class}: #{e.message}")
107-
Exploit::CheckCode::Unknown
114+
fail_with(Failure::Unknown, "#{e.class}: #{e.message}")
108115
end
109116

110117
def pillage(entries)

0 commit comments

Comments
 (0)