Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Local privilege/Windows escalation
← All windows escalation tasks

Recover Windows application, history and stored-credential artifacts

CommandsIf → thenExplanation & examples

Needs: Artifact read permission and exact protecting identity/context for saved or DPAPI material

Stored credentials and PowerShell trails

REM Stored credentials and PowerShell trails
cmdkey /list
vaultcmd /list
vaultcmd /listcreds:"Windows Credentials" /all

Stored credentials and PowerShell trails

# Stored credentials and PowerShell trails
$history = (Get-PSReadLineOption).HistorySavePath
$history
Get-Content -LiteralPath $history -ErrorAction SilentlyContinue
Get-ItemProperty 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell\Transcription' -ErrorAction SilentlyContinue
Get-ItemProperty 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell\Transcription' -ErrorAction SilentlyContinue
Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational' -ErrorAction SilentlyContinue |
  Where-Object Id -in 4103,4104 | Select-Object -First 50 TimeCreated,Id,Message

Targeted application/file/registry search

REM Targeted application/file/registry search
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword
reg query "HKCU\Software\SimonTatham\PuTTY\Sessions" /s
dir /s /b C:\Windows\Panther\*unattend*.xml C:\Windows\System32\Sysprep\*.xml 2>nul
dir /s /b C:\Users\*.kdbx C:\Users\*.rdp C:\Users\id_rsa C:\Users\*.ppk 2>nul

Targeted application/file/registry search

# Targeted application/file/registry search
Get-ChildItem C:\inetpub,C:\ProgramData,C:\Users -Recurse -File -ErrorAction SilentlyContinue |
  Where-Object { $_.Extension -in '.config','.xml','.ini','.txt','.ps1','.bat','.cmd','.yml','.yaml','.json' } |
  Select-String -Pattern 'password|passwd|secret|token|connectionString|user id=' -CaseSensitive:$false

Search from observed applications first. Classify every value by identity, format, scope and compatible service, then use the credential procedure.

Saved credential consumer

REM Saved credential consumer
runas /savecred /user:DOMAIN\USER cmd.exe

Use only when cmdkey/context supports that identity and logon type. runas does not inherently bypass UAC; verify the resulting token with whoami /all.

LaZagne — recover application credentials in the current user's context

Use a reviewed Windows build after identifying the current user and installed applications. Start with the relevant family; run broader collection only when useful. User-protected stores depend on that user's profile/decryption context; system-protected stores can need an elevated token.

REM LaZagne — recover application credentials in the current user's context
REM Browser-store leads for the current user
laZagne.exe browsers

REM Broader recovery, with a local text report
laZagne.exe all -oN

Read: preserve the reported application/account/source with each recovered value. Test a matching service using the credential procedure; a recovered application password is not automatically a domain password. Empty output can mean no supported store, inaccessible profile or failed decryption. Follow manual history/config/vault checks instead of assuming there are no credentials.

LaZagne — recover application credentials in the current user's context

# LaZagne — recover application credentials in the current user's context
Get-ChildItem C:\Users,C:\ProgramData,C:\inetpub -File -Recurse -ErrorAction SilentlyContinue |
  Where-Object { $_.Name -match 'pass|cred|config|backup|unattend|\.env' }

# LaZagne — recover application credentials in the current user's context
Get-ChildItem C:\Users,C:\ProgramData,C:\inetpub -File -Recurse -ErrorAction SilentlyContinue |
  Where-Object { $_.Extension -in '.config','.xml','.ini','.txt','.ps1','.bat','.cmd' } |
  Select-String -Pattern 'password|passwd|secret|token|connectionString' -CaseSensitive:$false

Verify → Tie each value to a source/account/service and verify any new token with whoami /all.

If it fails → Protected blobs, stale history and saved credentials for a different target require their own keys/context or a different route. More detail ↓

If → then

  • A secret-like value, key file, stored hash, challenge response or ticket → Classify the artifact and its identity context

    Needs: Artifact provenance and format; possible local/domain/application identity and compatible protocol

  • A password tied to a plausible user and service → Validate known passwords and context-specific reuse

    Needs: Correct local/domain/application identity, reachable compatible service, accepted authentication and account state

  • Saved credentials or protected application blobs/master keys → Use Credential Manager and DPAPI with the protecting context

    Needs: Access to the protected data plus matching user/machine context, master-key material or an appropriate recovery factor

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

Explanation & examples

Recover Windows application, history and stored-credential artifacts

USE WHEN
Readable application configuration, unattended setup, PowerShell trails or Credential Manager entries
STARTING ACCESS
A verified Windows foothold with a known token, integrity level and groups
RESULT
Typed secret material or a verified saved-credential consumer transition

Recognize the clue

Follow actual application/configuration paths, PSReadLine history and saved-credential targets under the current readable user context.

cmdkey /list
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName
SYNTHETIC EXAMPLE OUTPUT
cmdkey target: Domain:target=TARGET_HOST
User: DOMAIN\USER
Password: not displayed

Means: A target-bound saved credential is a possible consumer capability, not a plaintext password.

Confirm: Establish protecting user/context, intended logon type and an actually permitted saved-credential or decryption route.

After validation
The matching consumer accepts the credential and the resulting token is checked: use that access.
Ruled out in this context
The stored entry belongs to another context/target and cannot be used here: reject that transition.
Still inconclusive
A protected blob/listing without keys or consumer evidence leaves usable credentials unproved.

Troubleshooting: Protected blobs, stale history and saved credentials for a different target require their own keys/context or a different route.

Additional prerequisite checks

cmdkey /list
whoami /all
Stored credentials and PowerShell trails

A cmdkey entry is target/context-bound and does not reveal a password. DPAPI-protected data needs the protecting user/machine context and keys. Clear-History does not necessarily clear PSReadLine's saved file.

Targeted application/file/registry search

Search from observed applications first. Classify every value by identity, format, scope and compatible service, then use the credential procedure.

Saved credential consumer

Use only when cmdkey/context supports that identity and logon type. runas does not inherently bypass UAC; verify the resulting token with whoami /all.

LaZagne — recover application credentials in the current user's context

Use a reviewed Windows build after identifying the current user and installed applications. Start with the relevant family; run broader collection only when useful. User-protected stores depend on that user's profile/decryption context; system-protected stores can need an elevated token.

Read: preserve the reported application/account/source with each recovered value. Test a matching service using the credential procedure; a recovered application password is not automatically a domain password. Empty output can mean no supported store, inaccessible profile or failed decryption. Follow manual history/config/vault checks instead of assuming there are no credentials.

LaZagne upstream.

Avoid searching the entire filesystem without a reason; scope reduces noise, access errors and sensitive-data overcollection.

Why it works

A cmdkey entry proves a target-bound stored credential, not plaintext disclosure. Saved-credential use and DPAPI decryption require matching contexts; runas does not inherently bypass UAC.

Worked example · hypothetical

Observation: a history file contains a service password. Test: identify its account scope and compatible service. Illustrative output: the password grants a remote share but not local elevation. Interpretation: re-enumerate that share and preserve identity context.

New identity, privilege, host or route? Re-enumerate → All topic tasks →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8