githubEdit

Local Administrator Password Solution (LAPS)

ENUMERATION

dir "C:\Program\LAPS\CSE"

Get-ChildItem 'c:\program files\LAPS\CSE\Admpwd.dll'

Get-FileHash 'c:\program files\LAPS\CSE\Admpwd.dll'

Get-AuthenticodeSignature 'c:\program files\LAPS\CSE\Admpwd.dll'

reg query "HKLM\Software\Policies\Microsoft Services\AdmPwd" /v AdmPwdEnabled

Get-ADObject 'CN=ms-mcs-admpwd,CN=Schema,CN=Configuration,DC=DC01,DC=Security,CN=Local'

If admpwd.dll exists, then enumeration is successful.

LAPS PASSWORD EXTRACTION

The "ms-mcs-AdmPwd" is a "confidential" computer attribute that stores the clear-text LAPS password. Confidential attributes can only be viewed by Domain Admins by default, and unlike other attributes, is not accessible by Authenticated Users

1)

2)

3)

4)

Possible tools: LAPSToolkit, Crackmapexec, ldapsearch

If a user has access to view the LAPS password, we can use crackmapexec or ldapsearch to dump password:

1) CrackMapExec

2) ldapsearch

3) LAPSToolkit

4) adsisearcher (native binary on Windows 8+)

  • ([adsisearcher]"(&(objectCategory=computer)(ms-MCS-AdmPwd=)(sAMAccountName=))"

  • ([adsisearcher]"(&(objectCategory=computer)(ms-MCS-AdmPwd=*)(sAMAccountName=MACHINE

5) Powerview

6) pyLAPS (Linux)

Read the password of all computers

Write a random password to a specific computer

7) LAPSDumper (Linux)

8) AdmPwd.PS

9) Metasploit

10) Impacket

GRANT LAPS ACCESS

The members of the group "Account Operator" can add and modify all the non admin users and groups. Since LAPS ADM and LAPS READ are considered as non admin groups, it's possible to add an user to them, and read the LAPS admin password

LAPS Persistence

LAPS may be configured to automatically update a computers password on a regular basis. If we have compromised a computer and elevated to SYSTEM we can update the value to never expire for 10 years as a means of persistence.

PowerView

Last updated