Windows Credential Hunting
Application Configuration Files
Dictionary Files
Chrome Dictionary Files
Unattended Installation Files
Unattended installation files may define auto-logon settings or additional accounts to be created as part of the installation.
Passwords in the
unattend.xml
are stored in plaintext or base64 encoded.
Although these files should be automatically deleted as part of the installation, sysadmins may have created copies of the file in other folders during the development of the image and answer file.
PowerShell History File
Confirming PowerShell History Save Path
Reading PowerShell History File
We can also use this one-liner to retrieve the contents of all Powershell history files that we can access as our current user.
PowerShell Credentials
PowerShell credentials are often used for scripting and automation tasks as a way to store encrypted credentials conveniently.
Take, for example, the following script
Connect-VC.ps1
, which a sysadmin has created to connect to a vCenter server easily.
Decrypting PowerShell Credentials
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
.The example below assumes the former.
Manually Searching the File System for Credentials
Search File Contents with PowerShell
Search for File Extensions - Example 1
Search for File Extensions - Example 2
Search for File Extensions Using PowerShell
Sticky Notes Passwords
located here
Viewing Sticky Notes Data Using PowerShell
Strings to View DB File Contents
We can also copy them over to our attack box and search through the data using the
strings
command, which may be less efficient depending on the size of the database.
Other Files of Interest
Other Interesting Files
Some other files we may find credentials in include the following:
Further Credential Theft
Cmdkey Saved Credentials
Browser Credentials
Retrieving Saved Credentials from Chrome
Retrieving Saved Credentials from Chrome windows
Copy Firefox Cookies Database
Password Managers
Extracting KeePass Hash
Cracking Hash Offline
Email
If we gain access to a domain-joined system in the context of a domain user with a Microsoft Exchange inbox,
When all else fails
Wifi Passwords
Extracting windows wifi password
Citrix Breakout
Traffic Capture
if wireshark or tcpdump is there you can use it to capture packets from another user
Monitoring for Process Command Lines
It captures process command lines every two seconds and compares the current state with the previous state, outputting any differences.
procmon.ps1
Search Windows Registry for key
Get Installed Programs via PowerShell & Registry Keys
Capturing Hashes with a Malicious .lnk File
Using SCFs no longer works on Server 2019 hosts,
We can also make one using a few lines of PowerShell:
Generating a Malicious .lnk File
Pillaging
Pillaging is the process of obtaining information from a compromised system.
It can be personal information, corporate blueprints, credit card data, server information, infrastructure and network details, passwords, or other types of credentials, and anything relevant to the company or security assessment we are working on.
Below are some of the sources from which we can obtain information from compromised systems:
Installed applications
Installed services
Websites
File Shares
Databases
Directory Services (such as Active Directory, Azure AD, etc.)
Name Servers
Deployment Services
Certificate Authority
Source Code Management Server
Virtualization
Messaging
Monitoring and Logging Systems
Backups
Sensitive Data
Keylogging
Screen Capture
Network Traffic Capture
Previous Audit reports
User Information
History files, interesting documents (.doc/x,.xls/x,password./pass., etc)
Roles and Privileges
Web Browsers
IM Clients
Extracting Clipboard data
Extracting Clipboard data Windows
Search entire windows for a file
cd to the directory you want to search in
Last updated