ShellSpells
  • 🧙‍♂️Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • 🪟Windows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • ⛓️Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • 🛩️Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • 🪄REGEX
    • Examples
Powered by GitBook
On this page
  • Commands
  • LSA Secrets
  • Copy SAM and System Hive

Was this helpful?

  1. Windows
  2. System Ops
  3. Security

Stored Credentials

Commands

cmdkey /list

Lists credentials stored in Windows Credential Manager.

Get-StoredCredential

Lists credentials stored in Windows Credential Manager.

Get-StoredCredential -Target "TargetName"

Lists credentials for a specific target in Windows Credential Manager.

$cred = Get-StoredCredential -Target "TargetName"

Retrieves credentials for a specific target from Windows Credential Manager.

$cred.GetNetworkCredential().Password

Retrieves and decrypts the password for a specific target from Windows Credential Manager.

wmic path Win32_VaultCredential

Lists credentials stored in Windows Vault using WMI (may not work on all systems).

reg.exe save hklm\sam C:\temp\sam.save

Copies SAM. The SAM can be decrypted using secretsdump.py from Impacket.

reg.exe save hklm\system C:\temp\system.save

Copies System Registry.

Lists credentials stored in Windows Vault using CIM-Instance (may not work on all systems):

Get-CimInstance -Namespace "Root\Microsoft\Windows\Security\*" -ClassName Win32_VaultCredential

Lists usernames used for Remote Desktop connections from the registry using PowerShell:

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Terminal Server Client\Default"

Decrypts and retrieves the username for a specific RDP server from the registry using PowerShell:

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Terminal Server Client\Servers\ServerName" -Name "UsernameHint"

Lists Wi-Fi network profiles and their passwords using PowerShell (requires admin privileges):

(netsh wlan show profiles) | ForEach-Object { $_; (netsh wlan show profile name="$($_.Trim())" key=clear) }

LSA Secrets

LSA Secrets is used by the Local Security Authority (LSA) as storage, and oftentimes information such as auto-login service accounts or VPN credentials may be stored here:

To extract LSA secrets you need SYSTEM privs:

reg.exe save hklm\security C:\temp\security.save
reg.exe save hklm\system C:\temp\system.save

LSA Secrets is stored within the Security Registry.

We still need the Syskey from the System hive so we can decrypt the contents of LSA Secrets.

We can then extract the LSA Secrets using secretsdump from Impacket with the command:

python3 secretsdump.py -security security.save -system system.save LOCAL

Copy SAM and System Hive

To backup the SAM and SYSTEM hashes, we can use the following commands:

reg save hklm\system C:\Users\backup\system.hive
reg save hklm\sam C:\Users\backup\sam.hive
PreviousRegistry LocationsNextRemote Command Execution

Last updated 1 year ago

Was this helpful?

🪟