Cred Hunting
First part is big bunch of commands from cmd and powershell. Want more delailed info? Use AI. And second big part is just a lot of different techniques and tools. Happy Hunting)
CMD
POWERsHELL
Powershell History File
Powershell Credentials
They are often used for automation and scripting, and usually protected with DPAPI. But If we have gained command execution in the context of this user or can abuse DPAPI, then we can recover the cleartext credentials from encrypted.xml
.
SAM Registry Hives Copy
If we have local admin access on target, we could copy three registry SAM hives, which would help us to dump and crack hashes
HKLM\sam
Hashes associated with local account passwords
HKLM\system
System bootkey, which is encryption/decryption key for SAM
HKLM\security
Cached credentials for domain accounts, it is not 100% needed, but would help a lot
For dumping hives we would use reg.exe as admin
Running secretsdump.py
Remote Dumping
Dumping LSA Secrets Remotely
Dumping SAM Remotely
Dumping NTDS.dit Remotely
LSASS Dumping
Rundll32.exe & Comsvcs.dll Method
IMPORTANT: Anitivirus would see this as malicious activity. The point of method is that we use rundll32.exe to call an exported function of comsvcs.dll which also calls the MiniDumpWriteDump (MiniDump) function to dump the LSASS process memory to a specified directory (C:\lsass.dmp). But to do this we'll need a LSASS PID. with tasklist /svc
in cmd or Get-Process lsass
in powershell. With PID we could dump LSASS memory.
Shadow Copy of C:
NTDS.dit
Cmdkey Saved Credentials
cmdkey
can be used to create, list, and delete stored usernames and passwords.Credentials stored for Remote Desktop (RDP) or other remote hosts can be exploited.
Listing Saved Credentials:
Saved credentials will be used when connecting via RDP.
Can be exploited using
runas
:
Browser Credentials
Retrieving Saved Credentials from Chrome
Using SharpChrome [LINK] to extract saved passwords:
Chrome credential storage can be found at:
AES state key:
C:\Users\ven17\AppData\Local\Google\Chrome\User Data\Local State
Login data:
C:\Users\ven17\AppData\Local\Google\Chrome\User Data\Default\Login Data
Credentials can be extracted and reused.
Password Managers
Targets include KeePass, 1Password, Thycotic, and CyberArk.
KeePass databases (.kdbx) files can be extracted and cracked.
Extracting KeePass Hash:
Cracking KeePass Hash with Hashcat:
MailSniper [LINK] can be used to search domain-joined email accounts for passwords.
LaZagne
LaZagne [LINK] is versatile tool which retrieves credentials from browsers, chat clients, databases, sysadmin tools, etc.
Run all modules:
SessionGopher
Extracting Remote Access Credentials
Extracts saved
PuTTY
,WinSCP
,FileZilla
, andRDP
credentials.
Running SessionGopher [LINK]
Windows Registry
Windows AutoLogon
Stored in:
Retrieve:
PuTTY Saved Credentials
Stored in:
Retrieve:
WiFi Passwords
Listing Saved Wireless Networks:
Retrieving Saved Wireless Passwords:
COOKIES
Firefox
Copy Firefox Cookies Database
Extract cookies from database
For this we'll be using cookieextractor.py script [LINK]
After this we could use Cookie Editor browser extenstion to paste stolen cookie into our session
Chrome
Chromium-based browsers also use sqlite databases but usually encrypts it with DPAPI, which is commonly used to encrypt data using information from the current user account or computer. To get cookie value we need to decrypt from compromised user session. SharpChromium script [LINK] will help us with it
Invoke-SharpChromium
CLIPBOARD
For this we are using Invoke-ClipboardLogger script [LINK]
INTERESTING FILES
Last updated