# LAPS

{% embed url="<https://adsecurity.org/?p=1790>" %}

{% embed url="<https://activedirectorypro.com/microsoft-laps-setup-install-guide/>" %}

### Commands:

```powershell
#Import LAPs module
import-module ADMPwd.ps

#Allow computers 
Set-AdmPwdComputerSelfPermission -OrgUnit "Workstation"

#Set read rights for admin passwords
Set-AdmPwdReadPasswordPermission -Identity "ADPro Computers" -AllowedPrincipals "it_wrk_admins"

#Display users who have rights to read
Find-AdmPwdExtendedRights -Identity "ADPro Computers"

#Show password for host
Get-AdmPwdPassword HOST
```

### Schema Attributes:

* **ms-Mcs-AdmPwd** – This attribute saves the computer’s administrator password.
* **ms-Mcs-AdmPwdExpirationTime** – This attribute saves the password expiration timestamp.

### Display Password:

<figure><img src="https://3278866189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu4e057u3LTRKJEHFetwE%2Fuploads%2Fna2iU4TB6GyF6g75tXAB%2Fimage.png?alt=media&#x26;token=7cb7cf65-0b52-4502-b97e-bb3cc5ff80e0" alt=""><figcaption><p>Can be seen in LAPS UI</p></figcaption></figure>

<figure><img src="https://3278866189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu4e057u3LTRKJEHFetwE%2Fuploads%2F84R05EKHTHeB56NlxI1c%2Fimage.png?alt=media&#x26;token=f79b68c5-7468-4031-a840-2fbf262c84b1" alt=""><figcaption><p>Attribute of Workstation</p></figcaption></figure>

<figure><img src="https://3278866189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu4e057u3LTRKJEHFetwE%2Fuploads%2FqlkVrH7n4aRk9yo2VIrH%2Fimage.png?alt=media&#x26;token=7993f209-6f3f-4275-96fc-88f6e8a1ee8a" alt=""><figcaption><p>Display in PS</p></figcaption></figure>

### Abusing LAPS:

{% embed url="<https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/laps>" %}

### Forensics:

{% embed url="<https://cybersecthreat.com/2020/07/08/laps-logging-and-splunk-integration/>" %}
