2.5 KiB
Vulnerable Application
This post-exploitation module is to attack Active Directory integration solutions on UNIX. Specifically, it obtains all cached AD hashes on the targeted UNIX machine. These can be cracked with John the Ripper (JtR).
More detail about the underlying research from which these modules were derived can be found at:
This post contains both links to the Black Hat Europe 2018 presentation where the research was publicly disclosed as well as the Portcullis Labs GitHub repo from which this post-exploitation module is derived.
Verification Steps
- Install the application
- Start msfconsole
- Establish a valid Meterpreter session
- Do:
use post/multi/gather/unix_cached_ad_hashes - Do:
run - You should get the cached hashes
- Additional tools need to be run to extract the hashes in a crackable format
Files will be retrieved and placed into the Metasploit loot sub-system as unix_cached_ad_hashes_*.
There are no CVEs aligned to these post-exploitation modules because no specific vulnerabilities are being exploited in gathering these files. The post-exploitation module is intended to operate on sessions where root (or appropriate user) privileges has already been obtained.
Scenarios
Samba (smbd)
On a system running Samba (smbd), the modules will gather:
- /var/lib/samba/private/secrets.tdb
- /var/lib/samba/passdb.tdb
Use tdbdump to extract structured data from these files (tdbdump #{filename}), and search for the phrase
cachedPassword. The hash should be in the same format as hashes in /etc/shadow (e.g. $6$...).
JtR can natively crack these hashes.
SSS (sssd)
On a system running SSS (sssd), the modules will gather:
- /var/lib/sss/db/cache_*
Use tdbdump to extract structured data from these files (tdbdump #{filename}), and search for the phrase
cachedPassword. The hash should be in the same format as hashes in /etc/shadow (e.g. $6$...).
JtR can natively crack these hashes.
One Identity Vintela Authentication Services (vasd)
On a system running One Identity's Vintela Authentication Services (vasd), the modules will gather:
- /var/opt/quest/vas/authcache/vas_auth.vdb
JtR can crack the cached hashes extracted from this database using sqlite3 using the dynamic.conf rules located in our GitHub repo: