.. | ||
acl-persistence-abuse | ||
ad-certificates | ||
abusing-ad-mssql.md | ||
ad-certificates.md | ||
ad-dns-records.md | ||
ad-information-in-printers.md | ||
asreproast.md | ||
bloodhound.md | ||
constrained-delegation.md | ||
custom-ssp.md | ||
dcshadow.md | ||
dcsync.md | ||
diamond-ticket.md | ||
dsrm-credentials.md | ||
external-forest-domain-one-way-outbound.md | ||
external-forest-domain-oneway-inbound.md | ||
golden-ticket.md | ||
kerberoast.md | ||
kerberos-authentication.md | ||
kerberos-double-hop-problem.md | ||
laps.md | ||
over-pass-the-hash-pass-the-key.md | ||
pass-the-ticket.md | ||
password-spraying.md | ||
printers-spooler-service-abuse.md | ||
printnightmare.md | ||
privileged-groups-and-token-privileges.md | ||
rdp-sessions-abuse.md | ||
README.md | ||
resource-based-constrained-delegation.md | ||
security-descriptors.md | ||
sid-history-injection.md | ||
silver-ticket.md | ||
skeleton-key.md | ||
unconstrained-delegation.md |
Active Directory Methodology
AWSãããã³ã°ããŒãããããŒããŒãŸã§åŠã¶ htARTE (HackTricks AWS Red Team Expert)ïŒ
HackTricksããµããŒãããä»ã®æ¹æ³:
- HackTricksã«ããªãã®äŒç€ŸãåºåãããããŸãã¯HackTricksãPDFã§ããŠã³ããŒããããå Žåã¯ããµãã¹ã¯ãªãã·ã§ã³ãã©ã³ããã§ãã¯ããŠãã ããïŒ
- å ¬åŒPEASS & HackTricksã°ããºãå ¥æãã
- PEASSãã¡ããªãŒãçºèŠãããç§ãã¡ã®ç¬å çãªNFTsã®ã³ã¬ã¯ã·ã§ã³
- ð¬ Discordã°ã«ãŒãã«åå ãããããã¬ã°ã©ã ã°ã«ãŒãã«åå ããããTwitter ðŠ @carlospolopmããã©ããŒããŠãã ããã
- HackTricksãšHackTricks Cloudã®githubãªããžããªã«PRãæåºããŠãããªãã®ãããã³ã°ã®ã³ããå ±æããŠãã ããã
åºæ¬æŠèŠ
Active Directoryã¯ããããã¯ãŒã¯ç®¡çè ããã¡ã€ã³ããŠãŒã¶ãŒãããã³ãããã¯ãŒã¯å ã®ãªããžã§ã¯ããäœæããã³ç®¡çããããšãå¯èœã«ããŸããäŸãã°ã管çè ã¯ãŠãŒã¶ãŒã°ã«ãŒããäœæãããµãŒããŒäžã®ç¹å®ã®ãã£ã¬ã¯ããªãžã®ç¹å®ã®ã¢ã¯ã»ã¹æš©ãäžããããšãã§ããŸãããããã¯ãŒã¯ãæé·ããã«ã€ããŠãActive Directoryã¯å€æ°ã®ãŠãŒã¶ãŒãè«ççãªã°ã«ãŒããšãµãã°ã«ãŒãã«ç·šæããåã¬ãã«ã§ã¢ã¯ã»ã¹å¶åŸ¡ãæäŸããæ¹æ³ãæäŸããŸãã
Active Directoryã®æ§é ã«ã¯ã1) ãã¡ã€ã³ã2) ããªãŒã3) ãã©ã¬ã¹ãã®3ã€ã®äž»èŠãªéå±€ãå«ãŸããŠããŸããåãããŒã¿ããŒã¹ã䜿çšããè€æ°ã®ãªããžã§ã¯ãïŒãŠãŒã¶ãŒãŸãã¯ããã€ã¹ïŒã¯ãåäžã®ãã¡ã€ã³ã«ã°ã«ãŒãåãããããšããããŸããè€æ°ã®ãã¡ã€ã³ã¯ãããªãŒãšåŒã°ããåäžã®ã°ã«ãŒãã«çµã¿åãããããšãã§ããŸããè€æ°ã®ããªãŒã¯ããã©ã¬ã¹ããšåŒã°ããã³ã¬ã¯ã·ã§ã³ã«ã°ã«ãŒãåãããããšããããŸãããããã®åã¬ãã«ã«ã¯ãç¹å®ã®ã¢ã¯ã»ã¹æš©ãšéä¿¡æš©éãå²ãåœãŠãããããšããããŸãã
Active Directoryã®äž»èŠãªæŠå¿µ:
- ãã£ã¬ã¯ã㪠â Active Directoryã®ãªããžã§ã¯ãã«é¢ãããã¹ãŠã®æ å ±ãå«ã
- ãªããžã§ã¯ã â ãã£ã¬ã¯ããªå ã®ã»ãŒãã¹ãŠã®ãã®ïŒãŠãŒã¶ãŒãã°ã«ãŒããå ±æãã©ã«ããŒãªã©ïŒãåç §ãã
- ãã¡ã€ã³ â ãã£ã¬ã¯ããªã®ãªããžã§ã¯ãã¯ãã¡ã€ã³å ã«å«ãŸããã"ãã©ã¬ã¹ã"å ã«ã¯è€æ°ã®ãã¡ã€ã³ãååšããããããã«ç¬èªã®ãªããžã§ã¯ãã³ã¬ã¯ã·ã§ã³ãããã
- ããªãŒ â åãã«ãŒããæã€ãã¡ã€ã³ã®ã°ã«ãŒããäŸ: dom.local, email.dom.local, www.dom.local
- ãã©ã¬ã¹ã â ãã©ã¬ã¹ãã¯çµç¹éå±€ã®æäžäœã¬ãã«ã§ãããããªãŒã®ã°ã«ãŒãã§æ§æããããããªãŒã¯ä¿¡é Œé¢ä¿ã«ãã£ãŠæ¥ç¶ãããã
Active Directoryã¯ããã€ãã®ç°ãªããµãŒãã¹ãæäŸãããããã¯"Active Directory Domain Services"ããŸãã¯AD DSã®åäžã«ãããŸãããããã®ãµãŒãã¹ã«ã¯ä»¥äžãå«ãŸããŸã:
- ãã¡ã€ã³ãµãŒãã¹ â äžå€®éæš©çãªããŒã¿ãä¿åãããŠãŒã¶ãŒãšãã¡ã€ã³éã®éä¿¡ã管çãã; ãã°ã€ã³èªèšŒãšæ€çŽ¢æ©èœãå«ã
- 蚌ææžãµãŒãã¹ â å®å šãªèšŒææžãäœæãé åžãããã³ç®¡çãã
- 軜éãã£ã¬ã¯ããªãµãŒãã¹ â éæŸçãª(LDAP)ãããã³ã«ã䜿çšãããã£ã¬ã¯ããªå¯Ÿå¿ã¢ããªã±ãŒã·ã§ã³ããµããŒããã
- ãã£ã¬ã¯ããªé£æºãµãŒãã¹ â åäžã»ãã·ã§ã³ã§è€æ°ã®Webã¢ããªã±ãŒã·ã§ã³ã«ãŠãŒã¶ãŒãèªèšŒããã·ã³ã°ã«ãµã€ã³ãªã³(SSO)ãæäŸãã
- æš©å©ç®¡ç â èäœæš©æ å ±ãä¿è·ããããžã¿ã«ã³ã³ãã³ãã®äžæ£äœ¿çšãšæµéãé²ã
- DNSãµãŒãã¹ â ãã¡ã€ã³åã解決ããããã«äœ¿çšãããã
AD DSã¯Windows ServerïŒWindows Server 10ãå«ãïŒã«å«ãŸããŠãããã¯ã©ã€ã¢ã³ãã·ã¹ãã ã管çããããã«èšèšãããŠããŸããéåžžã®ããŒãžã§ã³ã®Windowsãå®è¡ããŠããã·ã¹ãã ã¯AD DSã®ç®¡çæ©èœãæã£ãŠããŸããããActive DirectoryããµããŒãããŠããŸããããã¯ãæ£ãããã°ã€ã³è³æ Œæ
å ±ãæã£ãŠãããŠãŒã¶ãŒã§ããã°ãä»»æã®Windowsã³ã³ãã¥ãŒã¿ãŒãWindowsã¯ãŒã¯ã°ã«ãŒãã«æ¥ç¶ã§ããããšãæå³ããŸãã
åºå
ž: https://techterms.com/definition/active_directory
KerberosèªèšŒ
ADãæ»æããæ¹æ³ãåŠã¶ã«ã¯ãKerberosèªèšŒããã»ã¹ãéåžžã«ããç解ããå¿
èŠããããŸãã
ãŸã ãã®ä»çµã¿ãç¥ããªãå Žåã¯ããã®ããŒãžãèªãã§ãã ããã
ããŒãã·ãŒã
https://wadcoms.github.io/ã«ã¢ã¯ã»ã¹ããŠãADãåæ/æªçšããããã«å®è¡ã§ããã³ãã³ãã®ã¯ã€ãã¯ãã¥ãŒã確èªã§ããŸãã
Recon Active Directory (No creds/sessions)
è³æ Œæ å ±/ã»ãã·ã§ã³ããªãå Žåã§ããADç°å¢ã«ã¢ã¯ã»ã¹ã§ããå ŽåããããŸã:
- ãããã¯ãŒã¯ã®ãããã¬ãŒã·ã§ã³ãã¹ã:
- ãããã¯ãŒã¯ãã¹ãã£ã³ãããã·ã³ãšãªãŒãã³ããŒããèŠã€ããŠãè匱æ§ãæªçšãããããããããè³æ Œæ å ±ãæœåºããïŒäŸãã°ãããªã³ã¿ãŒã¯éåžžã«èå³æ·±ãã¿ãŒã²ããã«ãªãå¯èœæ§ããããŸãã
- DNSãåæãããšããã¡ã€ã³å ã®éèŠãªãµãŒããŒïŒWebãããªã³ã¿ãŒãå ±æãVPNãã¡ãã£ã¢ãªã©ïŒã«é¢ããæ å ±ãåŸãããå¯èœæ§ããããŸãã
gobuster dns -d domain.local -t 25 -w /opt/Seclist/Discovery/DNS/subdomain-top2000.txt
- ãããè¡ãæ¹æ³ã«ã€ããŠã®è©³çŽ°ã¯ãäžè¬çãªãããã¬ãŒã·ã§ã³ãã¹ãæ¹æ³è«ãåç §ããŠãã ããã
- smbãµãŒãã¹ã§nullããã³Guestã¢ã¯ã»ã¹ããã§ãã¯ããïŒããã¯çŸä»£ã®WindowsããŒãžã§ã³ã§ã¯æ©èœããŸããïŒ:
enum4linux -a -u "" -p "" <DC IP> && enum4linux -a -u "guest" -p "" <DC IP>
smbmap -u "" -p "" -P 445 -H <DC IP> && smbmap -u "guest" -p "" -P 445 -H <DC IP>
smbclient -U '%' -L //<DC IP> && smbclient -U 'guest%' -L //
- SMBãµãŒããŒãåæããæ¹æ³ã«ã€ããŠã®è©³çŽ°ãªã¬ã€ãã¯ãã¡ãã§ãïŒ
{% content-ref url="../../network-services-pentesting/pentesting-smb.md" %} pentesting-smb.md {% endcontent-ref %}
- Ldapãåæãã
nmap -n -sV --script "ldap* and not brute" -p 389 <DC IP>
- LDAPãåæããæ¹æ³ã«ã€ããŠã®è©³çŽ°ãªã¬ã€ãã¯ãã¡ãã§ãïŒå¿åã¢ã¯ã»ã¹ã«ç¹ã«æ³šæããŠãã ããïŒïŒ
{% content-ref url="../../network-services-pentesting/pentesting-ldap.md" %} pentesting-ldap.md {% endcontent-ref %}
- ãããã¯ãŒã¯ããã€ãºãã³ã°ãã
- Responderã䜿çšããŠãµãŒãã¹ãåœè£ ããè³æ Œæ å ±ãåéãã
- ãªã¬ãŒã¢ã¿ãã¯ãæªçšããŠãã¹ãã«ã¢ã¯ã»ã¹ãã
- evil-SSDPã䜿çšããŠåœã®UPnPãµãŒãã¹ãå ¬éããè³æ Œæ å ±ãåéãã
- OSINT:
- å éšææžããœãŒã·ã£ã«ã¡ãã£ã¢ããã¡ã€ã³ç°å¢å ã®ãµãŒãã¹ïŒäž»ã«WebïŒãããã³å ¬éãããŠããæ å ±ãããŠãŒã¶ãŒå/ååãæœåºããã
- äŒç€Ÿã®åŸæ¥å¡ã®ãã«ããŒã ãèŠã€ãã£ãå Žåãç°ãªãAD ãŠãŒã¶ãŒåã®èŠåïŒãããèªãïŒãè©Šãããšãã§ããŸããæãäžè¬çãªèŠåã¯: NameSurname, Name.Surname, NamSurïŒããããã®3æåïŒ, Nam.Sur, NSurname, N.Surname, SurnameName, Surname.Name, SurnameN, Surname.N, 3 ã©ã³ãã ãªæåãš3ã€ã®ã©ã³ãã ãªæ°å (abc123)ã
- ããŒã«:
- w0Tx/generate-ad-username
- urbanadventurer/username-anarchy
ãŠãŒã¶ãŒåæ
- å¿åSMB/LDAP enum: ãããã¬ãŒã·ã§ã³ãã¹ã SMB ãš ãããã¬ãŒã·ã§ã³ãã¹ã LDAP ã®ããŒãžããã§ãã¯ããŠãã ããã
- Kerbrute enum: ç¡å¹ãªãŠãŒã¶ãŒåãèŠæ±ãããå ŽåããµãŒããŒã¯ Kerberosãšã©ãŒ ã³ãŒã KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN ã䜿çšããŠå¿çãããŠãŒã¶ãŒåãç¡å¹ã§ããããšãå€æã§ããŸããæå¹ãªãŠãŒã¶ãŒåã¯ãTGT in a AS-REP å¿çãŸãã¯ãšã©ãŒ KRB5KDC_ERR_PREAUTH_REQUIRED ãåŒãåºãããŠãŒã¶ãŒãäºåèªèšŒãè¡ãå¿ èŠãããããšã瀺ããŸãã
./kerbrute_linux_amd64 userenum -d lab.ropnop.com --dc 10.10.10.10 usernames.txt #From https://github.com/ropnop/kerbrute/releases
nmap -p 88 --script=krb5-enum-users --script-args="krb5-enum-users.realm='DOMAIN'" <IP>
Nmap -p 88 --script=krb5-enum-users --script-args krb5-enum-users.realm='<domain>',userdb=/root/Desktop/usernames.txt <IP>
msf> use auxiliary/gather/kerberos_enumusers
crackmapexec smb dominio.es -u '' -p '' --users | awk '{print $4}' | uniq
- OWA (Outlook Web Access) ãµãŒããŒ
ãããã¯ãŒã¯å ã§ãããã®ãµãŒããŒãèŠã€ããå ŽåããŠãŒã¶ãŒåæãå®è¡ããããšãã§ããŸããäŸãã°ãããŒã« MailSniper ã䜿çšã§ããŸãïŒ
ipmo C:\Tools\MailSniper\MailSniper.ps1
# Get info about the domain
Invoke-DomainHarvestOWA -ExchHostname [ip]
# Enumerate valid users from a list of potential usernames
Invoke-UsernameHarvestOWA -ExchHostname [ip] -Domain [domain] -UserList .\possible-usernames.txt -OutFile valid.txt
# Password spraying
Invoke-PasswordSprayOWA -ExchHostname [ip] -UserList .\valid.txt -Password Summer2021
# Get addresses list from the compromised mail
Get-GlobalAddressList -ExchHostname [ip] -UserName [domain]\[username] -Password Summer2021 -OutFile gal.txt
{% hint style="warning" %} ãã®GitHubãªããžããªã§ãŠãŒã¶ãŒåã®ãªã¹ããèŠã€ããããšãã§ããŸãããã®githubãªããžã㪠ãšãã®ãªããžã㪠(statistically-likely-usernames)ã
ãããããã®ã¹ãããã®åã«å®æœããã¯ãã®ãªã³ã³ã¹ããããããäŒç€Ÿã§åããŠãã人ã ã®ååãæã£ãŠããã¹ãã§ããååãšå§ã䜿ã£ãŠãã¹ã¯ãªãã namemash.py ã䜿çšããŠãæå¹ãªå¯èœæ§ã®ãããŠãŒã¶ãŒåãçæã§ããŸãã {% endhint %}
äžã€ãŸãã¯è€æ°ã®ãŠãŒã¶ãŒåãç¥ã£ãŠãã
æå¹ãªãŠãŒã¶ãŒåããã§ã«ç¥ã£ãŠãããããã¹ã¯ãŒãã¯ãªãå Žåã¯ä»¥äžãè©ŠããŠã¿ãŠãã ããã
- ASREPRoast: ãŠãŒã¶ãŒã DONT_REQ_PREAUTH å±æ§ã æã£ãŠããªã å Žåããã®ãŠãŒã¶ãŒã® AS_REPã¡ãã»ãŒãžãèŠæ± ã§ããããã«ã¯ãŠãŒã¶ãŒã®ãã¹ã¯ãŒãã®æŽŸçã«ãã£ãŠæå·åãããããŒã¿ãå«ãŸããŸãã
- Password Spraying: çºèŠãããåãŠãŒã¶ãŒã§æã äžè¬çãªãã¹ã¯ãŒã ãè©ŠããŠã¿ãŸããããããããããšãäœäººãã®ãŠãŒã¶ãŒãæªããã¹ã¯ãŒãã䜿çšããŠãããããããŸããïŒãã¹ã¯ãŒãããªã·ãŒã念é ã«çœ®ããŠãã ããïŒïŒã
- OWAãµãŒããŒã«å¯ŸããŠã ã¹ãã¬ãŒ ãè¡ãããŠãŒã¶ãŒã®ã¡ãŒã«ãµãŒããŒãžã®ã¢ã¯ã»ã¹ãè©Šã¿ãããšãã§ããŸãã
{% content-ref url="password-spraying.md" %} password-spraying.md {% endcontent-ref %}
LLMNR/NBT-NSãã€ãºãã³ã°
ãããã¯ãŒã¯ã®ãããã³ã«ã ãã€ãºãã³ã° ããããšã§ãã¯ã©ãã¯ããããã®ãã£ã¬ã³ãž ããã·ã¥ ã ååŸ ããããšãã§ãããããããŸããã
{% content-ref url="../../generic-methodologies-and-resources/pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md" %} spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md {% endcontent-ref %}
NTMLãªã¬ãŒ
ã¢ã¯ãã£ããã£ã¬ã¯ããªãåæããããšãã§ããã°ãããå€ãã®ã¡ãŒã«ã¢ãã¬ã¹ãšãããã¯ãŒã¯ã®ããè¯ãç解 ãåŸãããšãã§ããŸããNTML ãªã¬ãŒæ»æ ã匷å¶ããŠãADç°å¢ãžã®ã¢ã¯ã»ã¹ãåŸãããšãã§ãããããããŸããã
NTLMã¯ã¬ãã³ã·ã£ã«ã®çé£
nullãŸãã¯ã²ã¹ããŠãŒã¶ãŒ ã§ä»ã®PCãå ±æã« ã¢ã¯ã»ã¹ ã§ããå ŽåãSCFãã¡ã€ã«ã®ãã㪠ãã¡ã€ã«ãé 眮 ããŠãäœããã®æ¹æ³ã§ã¢ã¯ã»ã¹ãããå Žåã« NTMLèªèšŒãããªã¬ãŒ ããã¯ã©ãã¯ããããã® NTLMãã£ã¬ã³ãž ã çã ããšãã§ããŸãã
{% content-ref url="../ntlm/places-to-steal-ntlm-creds.md" %} places-to-steal-ntlm-creds.md {% endcontent-ref %}
ã¯ã¬ãã³ã·ã£ã«/ã»ãã·ã§ã³ãæã€ã¢ã¯ãã£ããã£ã¬ã¯ããªã®åæ
ãã®ãã§ãŒãºã§ã¯ãæå¹ãªãã¡ã€ã³ã¢ã«ãŠã³ãã®ã¯ã¬ãã³ã·ã£ã«ãŸãã¯ã»ãã·ã§ã³ã 䟵害ããŠããå¿ èŠããããŸããæå¹ãªã¯ã¬ãã³ã·ã£ã«ãæã£ãŠãããããã¡ã€ã³ãŠãŒã¶ãŒãšããŠã·ã§ã«ãæã£ãŠããå Žåã以åã«æäŸããããªãã·ã§ã³ãä»ã®ãŠãŒã¶ãŒã䟵害ããããã®ãªãã·ã§ã³ã§ããããšãèŠããŠããã¹ãã§ãã
èªèšŒãããåæãéå§ããåã«ãKerberosããã«ãããåé¡ ã«ã€ããŠç¥ã£ãŠããã¹ãã§ãã
{% content-ref url="kerberos-double-hop-problem.md" %} kerberos-double-hop-problem.md {% endcontent-ref %}
åæ
ã¢ã«ãŠã³ãã䟵害ããããšã¯ããã¡ã€ã³å šäœã䟵害ããããã®å€§ããªã¹ããã ã§ãããªããªããã¢ã¯ãã£ããã£ã¬ã¯ããªã®åæ ãéå§ããããšãã§ããããã§ãã
ASREPRoast ã«é¢ããŠã¯ããã¹ãŠã®å¯èœæ§ã®ããè匱ãªãŠãŒã¶ãŒãèŠã€ããããšãã§ããPassword Spraying ã«é¢ããŠã¯ããã¹ãŠã®ãŠãŒã¶ãŒåã®ãªã¹ããååŸãã䟵害ãããã¢ã«ãŠã³ãã®ãã¹ã¯ãŒãã空ã®ãã¹ã¯ãŒããæ°ããææãªãã¹ã¯ãŒããè©Šãããšãã§ããŸãã
- åºæ¬çãªãªã³ã³ãå®è¡ããããã« CMDãäœ¿çš ããããšãã§ããŸãã
- ããã¹ãã«ã¹æ§ã®é«ã powershellããªã³ã³ã«äœ¿çš ããããšãã§ããŸãã
- ãã詳现ãªæ å ±ãæœåºããããã« powerviewãäœ¿çš ããããšãã§ããŸãã
- ã¢ã¯ãã£ããã£ã¬ã¯ããªã§ã®ãªã³ã³ã«ã¯ BloodHound ãšããçŽ æŽãããããŒã«ããããŸãããã㯠ããŸãã¹ãã«ã¹æ§ããããŸããïŒäœ¿çšããåéæ¹æ³ã«ãããŸããïŒããããããããæ°ã«ãªããªãå Žåã¯ããã²è©ŠããŠã¿ãã¹ãã§ããRDPã§ãããŠãŒã¶ãŒãèŠã€ããããä»ã®ã°ã«ãŒããžã®ãã¹ãèŠã€ãããããããšãã§ããŸãã
- ä»ã®èªååãããADåæããŒã«ã«ã¯: AD Explorer, ADRecon, Group3r, PingCastle** ããããŸãã**
- ADã® DNSã¬ã³ãŒã ã«ã¯èå³æ·±ãæ å ±ãå«ãŸããŠããå¯èœæ§ããããŸãã
- ãã£ã¬ã¯ããªãåæããããã«äœ¿çšã§ãã GUIããŒã« ã«ã¯ãSysInternal ã¹ã€ãŒãã® AdExplorer.exe ããããŸãã
- ldapsearch ã䜿çšããŠLDAPããŒã¿ããŒã¹ãæ€çŽ¢ããuserPassword ããã³ unixUserPasswordããŸã㯠Description ã®ãã£ãŒã«ãã§ã¯ã¬ãã³ã·ã£ã«ãæ¢ãããšãã§ããŸããä»ã®æ¹æ³ã«ã€ããŠã¯ãPayloadsAllTheThingsã®ADãŠãŒã¶ãŒã³ã¡ã³ãã®ãã¹ã¯ãŒã ãåç §ããŠãã ããã
- Linuxã䜿çšããŠããå Žåãpywerview ã䜿çšããŠãã¡ã€ã³ãåæããããšãã§ããŸãã
- èªååãããããŒã«ãšããŠä»¥äžãè©ŠããŠã¿ãããšãã§ããŸã:
- tomcarver16/ADSearch
- 61106960/adPEAS
- ãã¹ãŠã®ãã¡ã€ã³ãŠãŒã¶ãŒã®æœåº
Windowsãããã¹ãŠã®ãã¡ã€ã³ãŠãŒã¶ãŒåãååŸããã®ã¯éåžžã«ç°¡åã§ãïŒnet user /domain
,Get-DomainUser
ãŸã㯠wmic useraccount get name,sid
ïŒãLinuxã§ã¯ã以äžã䜿çšã§ããŸã: GetADUsers.py -all -dc-ip 10.10.10.110 domain.com/username
ãŸã㯠enum4linux -a -u "user" -p "password" <DC IP>
ãã®åæã»ã¯ã·ã§ã³ãå°ããèŠãããããããŸããããããããã¹ãŠã®äžã§æãéèŠãªéšåã§ãããªã³ã¯ïŒç¹ã«cmdãpowershellãpowerviewãBloodHoundã®ãªã³ã¯ïŒã«ã¢ã¯ã»ã¹ãããã¡ã€ã³ãåæããæ¹æ³ãåŠã³ãå¿«é©ã«æãããŸã§ç·Žç¿ããŠãã ãããè©äŸ¡äžã«ã¯ãDAãžã®éãèŠã€ããããäœãã§ããªããšå€æããããã®éµãšãªãç¬éã§ãã
Kerberoast
Kerberoastingã®ç®çã¯ããã¡ã€ã³ãŠãŒã¶ãŒã¢ã«ãŠã³ãã代衚ããŠå®è¡ããããµãŒãã¹ã®TGSãã±ãããåç©«ããããšã§ãããããã®TGSãã±ããã®äžéšã¯ããŠãŒã¶ãŒãã¹ã¯ãŒããã掟çããããŒã§ æå·åãããŠããŸãããã®çµæããã®ã¯ã¬ãã³ã·ã£ã«ã¯ ãªãã©ã€ã³ã§ã¯ã©ãã¯ãããå¯èœæ§ããããŸãã
詳现ã¯ä»¥äžã§:
{% content-ref url="kerberoast.md" %} kerberoast.md {% endcontent-ref %}
ãªã¢ãŒãæ¥ç¶ (RDP, SSH, FTP, Win-RMãªã©)
ããã€ãã®ã¯ã¬ãã³ã·ã£ã«ãååŸããããä»»æã® ãã·ã³ ã«ã¢ã¯ã»ã¹ã§ãããã©ããã確èªã§ããŸãããã®ããã«ã¯ãããŒãã¹ãã£ã³ã«å¿ããŠãCrackMapExec ã䜿çšããŠãããŸããŸãªãµãŒããŒã§ç°ãªããããã³ã«ã§æ¥ç¶ãè©Šã¿ãããšãã§ããŸãã
ããŒã«ã«ç¹æš©ææ Œ
éåžžã®ãã¡ã€ã³ãŠãŒã¶ãŒãšããŠã®ã¯ã¬ãã³ã·ã£ã«ãŸãã¯ã»ãã·ã§ã³ã䟵害ãããã®ãŠãŒã¶ãŒã§ ãã¡ã€ã³å ã®ä»»æã®ãã·ã³ã«ã¢ã¯ã»ã¹ ã§ããå Žåã¯ãããŒã«ã«ã§ç¹æš©ãææ Œãããã¯ã¬ãã³ã·ã£ã«ãç¥å¥ªããæ¹æ³ãèŠã€ãã ã¹ãã§ããããã¯ãä»ã®ãŠãŒã¶ãŒã®ããã·ã¥ãã¡ã¢ãªïŒLSASSïŒããã³ããŒã«ã«ïŒSAMïŒãã ãã³ãããã«ã¯ãããŒã«ã«ç®¡çè æš©éãå¿ èŠ ã ããã§ãã
ãã®æ¬ã«ã¯ Windowsã§ã®ããŒã«ã«ç¹æš©ææ Œ ã«ã€ããŠã®å®å šãªããŒãžãš ãã§ãã¯ãªã¹ã ããããŸãããŸããWinPEAS ã®äœ¿çšãå¿ããªãã§ãã ããã
çŸåšã®ã»ãã·ã§ã³ãã±ãã
çŸåšã®ãŠãŒã¶ãŒã« ã¢ã¯ã»ã¹èš±å¯ãäžãããã±ãã ãèŠã€ããããšã¯éåžžã« ãŸã ã§ããã確èªããããšãã§ããŸãïŒ
## List all tickets (if not admin, only current user tickets)
.\Rubeus.exe triage
## Dump the interesting one by luid
.\Rubeus.exe dump /service:krbtgt /luid:<luid> /nowrap
[IO.File]::WriteAllBytes("ticket.kirbi", [Convert]::FromBase64String("<BASE64_TICKET>"))
NTMLãªã¬ãŒ
ã¢ã¯ãã£ããã£ã¬ã¯ããªãåæããããšã«æåããå Žåãããå€ãã®ã¡ãŒã«ã¢ãã¬ã¹ãšãããã¯ãŒã¯ã®ç解ãæ·±ãŸããŸããNTMLã®ãªã¬ãŒæ»æã匷å¶ããããšãã§ãããããããŸããã
ã³ã³ãã¥ãŒã¿å ±æã§è³æ Œæ å ±ãæ¢ã
åºæ¬çãªè³æ Œæ å ±ãæã«å ¥ããããADå ã§å ±æãããŠããèå³æ·±ããã¡ã€ã«ãæ¢ãã¹ãã§ããæåã§è¡ãããšãã§ããŸãããããã¯éåžžã«éå±ã§ç¹°ãè¿ãã®äœæ¥ã§ãïŒç¹ã«ã確èªããå¿ èŠãããæ°çŸã®ããã¥ã¡ã³ããèŠã€ãã£ãå ŽåïŒã
ãã®ãªã³ã¯ããã©ããŒããŠã䜿çšã§ããããŒã«ã«ã€ããŠåŠã³ãŸãããã
NTLMè³æ Œæ å ±ãçã
ä»ã®PCãå ±æã«ã¢ã¯ã»ã¹ã§ããå ŽåãSCFãã¡ã€ã«ã®ãããªãã¡ã€ã«ãé 眮ããŠãäœããã®æ¹æ³ã§ã¢ã¯ã»ã¹ãããå Žåã«ããªãã«å¯ŸããŠNTMLèªèšŒãããªã¬ãŒããNTLMãã£ã¬ã³ãžãçãããšãã§ããŸãïŒ
{% content-ref url="../ntlm/places-to-steal-ntlm-creds.md" %} places-to-steal-ntlm-creds.md {% endcontent-ref %}
CVE-2021-1675/CVE-2021-34527 PrintNightmare
ãã®è匱æ§ã«ãããä»»æã®èªèšŒæžã¿ãŠãŒã¶ãŒããã¡ã€ã³ã³ã³ãããŒã©ãŒã䟵害ããããšãã§ããŸããã
{% content-ref url="printnightmare.md" %} printnightmare.md {% endcontent-ref %}
ç¹æš©è³æ Œæ å ±/ã»ãã·ã§ã³ãæã€Active Directoryã§ã®æš©éææ Œ
以äžã®æè¡ã«ã¯ãéåžžã®ãã¡ã€ã³ãŠãŒã¶ãŒã§ã¯äžååã§ããããã®æ»æãå®è¡ããããã«ç¹å¥ãªæš©é/è³æ Œæ å ±ãå¿ èŠã§ãã
ããã·ã¥æœåº
AsRepRoastãPassword SprayingãKerberoastãResponderïŒãªã¬ãŒãå«ãïŒãEvilSSDPãããŒã«ã«ã§ã®æš©éææ Œã䜿çšããŠãäœããã®ããŒã«ã«ç®¡çè
ã¢ã«ãŠã³ãã䟵害ããããšã«æåããããšãé¡ããŸãã
次ã«ãã¡ã¢ãªãšããŒã«ã«ã«ãããã¹ãŠã®ããã·ã¥ããã³ãããæã§ãã
ããã·ã¥ãååŸããããŸããŸãªæ¹æ³ã«ã€ããŠã¯ããã®ããŒãžãèªãã§ãã ããã
ãã¹ã»ã¶ã»ããã·ã¥
ãŠãŒã¶ãŒã®ããã·ã¥ãæã«å
¥ããããããã䜿çšããŠãªãããŸããè¡ãããšãã§ããŸãã
NTLMèªèšŒããã®ããã·ã¥ã䜿çšããŠå®è¡ããäœããã®ããŒã«ã䜿çšããããæ°ããsessionlogonãäœæããŠãã®ããã·ã¥ãLSASSã«æ³šå
¥ããNTLMèªèšŒãå®è¡ããããšãã«ãã®ããã·ã¥ã䜿çšãããããã«ããå¿
èŠããããŸããæåŸã®ãªãã·ã§ã³ã¯mimikatzãè¡ãããšã§ãã
詳现ã«ã€ããŠã¯ããã®ããŒãžãèªãã§ãã ããã
Over Pass the Hash/Pass the Key
ãã®æ»æã¯ããŠãŒã¶ãŒã®NTLMããã·ã¥ã䜿çšããŠKerberosãã±ãããèŠæ±ããããšãç®çãšããŠããŸãããããã£ãŠãããã¯ç¹ã«NTLMãããã³ã«ãç¡å¹ã«ãªã£ãŠãããããã¯ãŒã¯ã§æçšã§ãããèªèšŒãããã³ã«ãšããŠKerberosã®ã¿ãèš±å¯ãããŠããå Žåã«ç¹ã«æçšã§ãã
{% content-ref url="over-pass-the-hash-pass-the-key.md" %} over-pass-the-hash-pass-the-key.md {% endcontent-ref %}
ãã¹ã»ã¶ã»ãã±ãã
ãã®æ»æã¯Pass the Keyã«äŒŒãŠããŸãããããã·ã¥ã䜿çšããŠãã±ãããèŠæ±ãã代ããã«ããã±ããèªäœãçãŸãããã®ææè ãšããŠèªèšŒã«äœ¿çšãããŸãã
{% content-ref url="pass-the-ticket.md" %} pass-the-ticket.md {% endcontent-ref %}
è³æ Œæ å ±ã®åå©çš
ããŒã«ã«ç®¡çè ã®ããã·ã¥ãŸãã¯ãã¹ã¯ãŒããæã£ãŠããå Žåãããã䜿çšããŠä»ã®PCã«ããŒã«ã«ã§ãã°ã€ã³ããããšãè©Šã¿ãã¹ãã§ãã
# Local Auth Spray (once you found some local admin pass or hash)
## --local-auth flag indicate to only try 1 time per machine
crackmapexec smb --local-auth 10.10.10.10/23 -u administrator -H 10298e182387f9cab376ecd08491764a0 | grep +
{% hint style="warning" %} ãã®æ¹æ³ã¯ããªãéšã ãããã®ã§ãããLAPSãããã軜æžããã§ãããã {% endhint %}
MSSQL Abuse & Trusted Links
ãŠãŒã¶ãŒãMSSQLã€ã³ã¹ã¿ã³ã¹ã«ã¢ã¯ã»ã¹ããæš©éãæã£ãŠããå ŽåãMSSQLãã¹ãã§ã³ãã³ããå®è¡ããããNetNTLMã®ããã·ã¥ãçãã ããããã«ã¯ãªã¬ãŒæ»æãè¡ãããšãã§ãããããããŸããã
ãŸããç°ãªãMSSQLã€ã³ã¹ã¿ã³ã¹ã«ä¿¡é ŒãããŠããïŒããŒã¿ããŒã¹ãªã³ã¯ãããŠããïŒMSSQLã€ã³ã¹ã¿ã³ã¹ãããå ŽåããŠãŒã¶ãŒãä¿¡é ŒãããããŒã¿ããŒã¹ã«å¯Ÿããæš©éãæã£ãŠããã°ãä¿¡é Œé¢ä¿ãå©çšããŠä»ã®ã€ã³ã¹ã¿ã³ã¹ã§ãã¯ãšãªãå®è¡ããããšãã§ããŸãããããã®ä¿¡é Œã¯é£éçã«ãªãããŠãŒã¶ãŒã¯ã³ãã³ããå®è¡ã§ãã誀èšå®ãããããŒã¿ããŒã¹ãèŠã€ãããããããŸããã
ããŒã¿ããŒã¹éã®ãªã³ã¯ã¯ããã©ã¬ã¹ããã©ã¹ããè¶ããŠãæ©èœããŸãã
{% content-ref url="abusing-ad-mssql.md" %} abusing-ad-mssql.md {% endcontent-ref %}
Unconstrained Delegation
ADS_UF_TRUSTED_FOR_DELEGATIONå±æ§ãæã€ã³ã³ãã¥ãŒã¿ãªããžã§ã¯ããèŠã€ãããã®ã³ã³ãã¥ãŒã¿ã®ãã¡ã€ã³æš©éãæã£ãŠããå Žåããã®ã³ã³ãã¥ãŒã¿ã«ãã°ã€ã³ãããã¹ãŠã®ãŠãŒã¶ãŒã®TGTãã¡ã¢ãªãããã³ãããããšãã§ããŸãã
ãããã£ãŠããã¡ã€ã³ç®¡çè
ããã®ã³ã³ãã¥ãŒã¿ã«ãã°ã€ã³ãããšããã®TGTããã³ãããŠPass the Ticketã䜿çšããŠåœŒãåœè£
ããããšãã§ããŸãã
å¶çŽä»ãå§ä»»ãå©çšãããšãããªã³ããµãŒããŒãèªåçã«äŸµå®³ããããšãã§ããŸãïŒã§ããã°DCã«ãªãã§ãããïŒã
{% content-ref url="unconstrained-delegation.md" %} unconstrained-delegation.md {% endcontent-ref %}
Constrained Delegation
ãŠãŒã¶ãŒãã³ã³ãã¥ãŒã¿ããå¶çŽä»ãå§ä»»ããèš±å¯ãããŠããå Žåãä»»æã®ãŠãŒã¶ãŒã«ãªãããŸããŠç¹å®ã®ã³ã³ãã¥ãŒã¿ã®ãµãŒãã¹ã«ã¢ã¯ã»ã¹ããããšãã§ããŸãã
ãã®åŸããã®ãŠãŒã¶ãŒ/ã³ã³ãã¥ãŒã¿ã®ããã·ã¥ã䟵害ãããšãä»»æã®ãŠãŒã¶ãŒïŒãã¡ã€ã³ç®¡çè
ã§ããïŒã«ãªãããŸããŠäžéšã®ãµãŒãã¹ã«ã¢ã¯ã»ã¹ããããšãã§ããŸãã
{% content-ref url="constrained-delegation.md" %} constrained-delegation.md {% endcontent-ref %}
Resource-based Constrained Delegation
ãã®ã³ã³ãã¥ãŒã¿ã®ADãªããžã§ã¯ãã«æžã蟌ã¿æš©éãæã£ãŠããå Žåããªã¢ãŒãã³ã³ãã¥ãŒã¿ã§ç¹æš©ãæã€ã³ãŒãå®è¡ãç²åŸããããšãå¯èœã§ãã
{% content-ref url="resource-based-constrained-delegation.md" %} resource-based-constrained-delegation.md {% endcontent-ref %}
ACLs Abuse
䟵害ããããŠãŒã¶ãŒã¯ã暪移åãæš©éææ Œãå¯èœã«ãããã¡ã€ã³ãªããžã§ã¯ãã«å¯Ÿããèå³æ·±ãæš©éãæã£ãŠãããããããŸããã
{% content-ref url="acl-persistence-abuse/" %} acl-persistence-abuse {% endcontent-ref %}
Printer Spooler service abuse
ãã¡ã€ã³å
ã§SpoolãµãŒãã¹ããªã¹ãã³ã°ããŠããã®ãèŠã€ããããšãã§ããã°ããããæªçšããŠæ°ããè³æ Œæ
å ±ãååŸããæš©éãææ Œããããšãã§ããŸãã
SpoolerãµãŒãã¹ã®æªçšæ¹æ³ã«ã€ããŠã®è©³çŽ°ã¯ãã¡ãã
Third party sessions abuse
ä»ã®ãŠãŒã¶ãŒã䟵害ããããã·ã³ã«ã¢ã¯ã»ã¹ããå Žåãã¡ã¢ãªããè³æ Œæ
å ±ãåéãããã圌ãã®ããã»ã¹ã«ããŒã³ã³ã泚å
¥ããŠåœè£
ããããšãå¯èœã§ãã
éåžžããŠãŒã¶ãŒã¯RDPãä»ããŠã·ã¹ãã ã«ã¢ã¯ã»ã¹ãããããããã§ã¯ç¬¬äžè
ã®RDPã»ãã·ã§ã³ã«å¯ŸããŠæ»æãè¡ãæ¹æ³ãããã€ã玹ä»ããŸãïŒ
{% content-ref url="rdp-sessions-abuse.md" %} rdp-sessions-abuse.md {% endcontent-ref %}
LAPS
LAPSã¯ããã¡ã€ã³ã«åå ããŠããã³ã³ãã¥ãŒã¿ã®ããŒã«ã«ç®¡çè ãã¹ã¯ãŒãïŒã©ã³ãã åããããŠããŒã¯ã§ãå®æçã«å€æŽãããïŒã管çããããšãå¯èœã«ããŸãããããã®ãã¹ã¯ãŒãã¯Active Directoryã«äžå€®éäžçã«ä¿åãããACLã䜿çšããŠæ¿èªããããŠãŒã¶ãŒã«å¶éãããŸãããããã®ãã¹ã¯ãŒããèªãååãªæš©éãæã£ãŠããã°ãä»ã®ã³ã³ãã¥ãŒã¿ã«ç§»åããããšãã§ããŸãã
{% content-ref url="laps.md" %} laps.md {% endcontent-ref %}
Certificate Theft
䟵害ããããã·ã³ãã蚌ææžãåéããããšã¯ãç°å¢å ã§æš©éãææ Œããæ¹æ³ã®äžã€ã§ãïŒ
{% content-ref url="ad-certificates/certificate-theft.md" %} certificate-theft.md {% endcontent-ref %}
Certificate Templates Abuse
è匱ãªãã³ãã¬ãŒããèšå®ãããŠããå ŽåãããããæªçšããŠæš©éãææ Œããããšãå¯èœã§ãïŒ
{% content-ref url="ad-certificates/domain-escalation.md" %} domain-escalation.md {% endcontent-ref %}
é«æš©éã¢ã«ãŠã³ãã䜿çšãã䟵害åŸã®æŽ»å
Dumping Domain Credentials
ãã¡ã€ã³ç®¡çè ãŸãã¯ããã«è¯ããšã³ã¿ãŒãã©ã€ãºç®¡çè ã®æš©éãåŸããããã¡ã€ã³ããŒã¿ããŒã¹ïŒ_ntds.dit_ããã³ãããããšãã§ããŸãã
DCSyncæ»æã«é¢ãã詳现æ å ±ã¯ãã¡ãã
NTDS.ditãçãæ¹æ³ã«é¢ãã詳现æ å ±ã¯ãã¡ã
Privesc as Persistence
以åã«è°è«ããæè¡ã®ããã€ãã¯ãæ°žç¶æ§ã®ããã«äœ¿çšããããšãã§ããŸãã
äŸãã°ã以äžã®ããã«ããããšãã§ããŸãïŒ
- Kerberoastã«å¯ŸããŠãŠãŒã¶ãŒãè匱ã«ãã
Set-DomainObject -Identity <username> -Set @{serviceprincipalname="fake/NOTHING"}r
- ASREPRoastã«å¯ŸããŠãŠãŒã¶ãŒãè匱ã«ãã
Set-DomainObject -Identity <username> -XOR @{UserAccountControl=4194304}
- ãŠãŒã¶ãŒã«DCSyncæš©éãä»äžãã
Add-DomainObjectAcl -TargetIdentity "DC=SUB,DC=DOMAIN,DC=LOCAL" -PrincipalIdentity bfarmer -Rights DCSync
Silver Ticket
Silver ticketæ»æã¯ããµãŒãã¹ã®NTLMããã·ã¥ïŒäŸãã°PCã¢ã«ãŠã³ãããã·ã¥ïŒãææããŠããå Žåã«ããã®ãµãŒãã¹ã®æå¹ãªTGSãäœæããããšã«åºã¥ããŠããŸããããã«ãããã«ã¹ã¿ã TGSãåœé ããŠä»»æã®ãŠãŒã¶ãŒãšããŠãã®ãµãŒãã¹ã«ã¢ã¯ã»ã¹ããããšãå¯èœã§ãïŒç¹æš©ã¢ã¯ã»ã¹ãã³ã³ãã¥ãŒã¿ã«ïŒã
{% content-ref url="silver-ticket.md" %} silver-ticket.md {% endcontent-ref %}
Golden Ticket
krbtgt ADã¢ã«ãŠã³ãã®NTLMããã·ã¥ã䜿çšããŠãä»»æã®ãŠãŒã¶ãŒãšããŠæå¹ãªTGTãäœæããããšãã§ããŸããTGSã®ä»£ããã«TGTãåœé ããå©ç¹ã¯ãåœè£ ãããŠãŒã¶ãŒãšããŠãã¡ã€ã³å ã®ä»»æã®ãµãŒãã¹ïŒãŸãã¯ãã·ã³ïŒã«ã¢ã¯ã»ã¹ã§ããããšã§ãã
{% content-ref url="golden-ticket.md" %} golden-ticket.md {% endcontent-ref %}
Diamond Ticket
ãããã¯ãäžè¬çãªgolden ticketsæ€åºã¡ã«ããºã ãåé¿ããæ¹æ³ã§åœé ãããgolden ticketsã§ãã
{% content-ref url="diamond-ticket.md" %} diamond-ticket.md {% endcontent-ref %}
Certificates Account Persistence
ã¢ã«ãŠã³ãã®èšŒææžãæã£ãŠãããããããããªã¯ãšã¹ãããããšãã§ãããšããŠãŒã¶ãŒã¢ã«ãŠã³ãã«æ°žç¶çã«çãŸãããšãã§ããŸãïŒããšããã¹ã¯ãŒããå€æŽããããšããŠãïŒïŒ
{% content-ref url="ad-certificates/account-persistence.md" %} account-persistence.md {% endcontent-ref %}
Certificates Domain Persistence
蚌ææžã䜿çšããŠããã¡ã€ã³å ã§é«æš©éã§æ°žç¶çã«çãŸãããšãå¯èœã§ãïŒ
{% content-ref url="ad-certificates/domain-persistence.md" %} domain-persistence.md {% endcontent-ref %}
AdminSDHolder Group
AdminSDHolderãªããžã§ã¯ãã®ã¢ã¯ã»ã¹å¶åŸ¡ãªã¹ãïŒACLïŒã¯ãActive Directoryå
ã®ãã¹ãŠã®ãä¿è·ãããã°ã«ãŒãããšãã®ã¡ã³ããŒã«æš©éãã³ããŒããããã®ãã³ãã¬ãŒããšããŠäœ¿çšãããŸããä¿è·ãããã°ã«ãŒãã«ã¯ããã¡ã€ã³ç®¡çè
ã管çè
ããšã³ã¿ãŒãã©ã€ãºç®¡çè
ãã¹ããŒã管çè
ãããã¯ã¢ãããªãã¬ãŒã¿ãŒãkrbtgtãªã©ã®ç¹æš©ã°ã«ãŒããå«ãŸããŸãã
ããã©ã«ãã§ã¯ããã®ã°ã«ãŒãã®ACLã¯ãã¹ãŠã®ãä¿è·ãããã°ã«ãŒããå
ã«ã³ããŒãããŸããããã¯ããããã®éèŠãªã°ã«ãŒãã«æå³çãŸãã¯å¶çºçãªå€æŽãå ããããã®ãé²ãããã§ããããããæ»æè
ãããšãã°ãéåžžã®ãŠãŒã¶ãŒã«å®å
šãªæš©éãäžããããšã§ã°ã«ãŒãAdminSDHolderã®ACLãå€æŽãããšããã®ãŠãŒã¶ãŒã¯ä¿è·ãããã°ã«ãŒãå
ã®ãã¹ãŠã®ã°ã«ãŒãã«å®å
šãªæš©éãæã€ããšã«ãªããŸãïŒ1æé以å
ã«ïŒã
ãããŠã誰ãããã®ãŠãŒã¶ãŒããã¡ã€ã³ç®¡çè
ïŒäŸãã°ïŒããåé€ããããšããŠãã1æé以å
ã«ãŠãŒã¶ãŒã¯ã°ã«ãŒãã«æ»ããŸãã
AdminDSHolder Groupã«é¢ãã詳现æ
å ±ã¯ãã¡ãã
DSRM Credentials
åDCå ã«ã¯ããŒã«ã«ç®¡çè ã¢ã«ãŠã³ãããããŸãããã®ãã·ã³ã§ç®¡çè æš©éãæã£ãŠããå Žåãmimikatzã䜿çšããŠããŒã«ã«ç®¡çè ã®ããã·ã¥ããã³ãããããšãã§ããŸãããã®åŸãã¬ãžã¹ããªãå€æŽããŠãã®ãã¹ã¯ãŒããã¢ã¯ãã£ãã«ãããã®ããŒã«ã«ç®¡çè ãŠãŒã¶ãŒã«ãªã¢ãŒãã¢ã¯ã»ã¹ã§ããããã«ããŸãã
{% content-ref url="dsrm-credentials.md" %} dsrm-credentials.md {% endcontent-ref %}
ACL Persistence
ç¹å®ã®ãã¡ã€ã³ãªããžã§ã¯ãã«å¯ŸããŠãŠãŒã¶ãŒã«ç¹å¥ãªæš©éãäžããããšã§ãå°æ¥çã«æš©éãææ Œããããšãã§ããŸãã
{% content-ref url="acl-persistence-abuse/" %} acl-persistence-abuse {% endcontent-ref %}
Security Descriptors
ã»ãã¥ãªãã£ãã£ã¹ã¯ãªãã¿ãŒã¯ããªããžã§ã¯ããä»ã®ãªããžã§ã¯ãã«å¯ŸããŠæã€æš©éãä¿åããããã«äœ¿çšãããŸãããªããžã§ã¯ãã®ã»ãã¥ãªãã£ãã£ã¹ã¯ãªãã¿ãŒããããã«å€æŽããããšãã§ããã°ãç¹æš©ã°ã«ãŒãã®ã¡ã³ããŒã§ãªããŠããã®ãªããžã§ã¯ãã«å¯ŸããŠéåžžã«èå³æ·±ãæš©éãåŸãããšãã§ããŸãã
{% content-ref url="security-descriptors.md" %} security-descriptors.md {% endcontent-ref %}
Skeleton Key
ã¡ã¢ãªå ã®LSASSãå€æŽããŠããã¡ã€ã³å ã®ä»»æã®ã¢ã«ãŠã³ãã§æ©èœãããã¹ã¿ãŒãã¹ã¯ãŒããäœæããŸãã
{% content-ref url="skeleton-key.md" %} skeleton-key.md {% endcontent-ref %}
Custom SSP
SSPïŒã»ãã¥ãªãã£ãµããŒããããã€ãïŒã«ã€ããŠã¯ãã¡ãã§åŠã¶ã
èªåèªèº«ã®SSPãäœæããŠããã·ã³ã«ã¢ã¯ã»ã¹ããããã«äœ¿çšãããè³æ Œæ
å ±ãã¯ãªã¢ããã¹ãã§ãã£ããã£ããããšãã§ããŸãã\
{% content-ref url="custom-ssp.md" %} custom-ssp.md {% endcontent-ref %}
DCShadow
ADã«æ°ãããã¡ã€ã³ã³ã³ãããŒã©ãŒãç»é²ããããã䜿çšããŠæå®ããããªããžã§ã¯ãã«å¯ŸããŠå±æ§ïŒSIDHistoryãSPNãªã©ïŒããã°ãæ®ããã«ããã·ã¥ããŸãããããè¡ãã«ã¯DAæš©éãå¿
èŠã§ãã«ãŒããã¡ã€ã³å
ã«ããå¿
èŠããããŸãã
ééã£ãããŒã¿ã䜿çšãããšãéåžžã«éããã°ã衚瀺ãããããšã«æ³šæããŠãã ããã
{% content-ref url="dcshadow.md" %} dcshadow.md {% endcontent-ref %}
LAPS Persistence
以åã«ãLAPSãã¹ã¯ãŒããèªãååãªæš©éãæã£ãŠããå Žåã«æš©éãææ Œããæ¹æ³ã«ã€ããŠ
Get-DomainTrust
SourceName : sub.domain.local --> current domain
TargetName : domain.local --> foreign domain
TrustType : WINDOWS_ACTIVE_DIRECTORY
TrustAttributes : WITHIN_FOREST --> WITHIN_FOREST: Both in the same forest
TrustDirection : Bidirectional --> Trust direction (2ways in this case)
WhenCreated : 2/19/2021 1:28:00 PM
WhenChanged : 2/19/2021 1:28:00 PM
{% hint style="warning" %}
2ã€ã®ä¿¡é ŒãããããŒããããŸããäžã€ã¯ Child --> Parent çšãããäžã€ã¯ Parent --> Child çšã§ãã
çŸåšã®ãã¡ã€ã³ã§äœ¿çšãããŠããããŒã確èªããã«ã¯ïŒ
Invoke-Mimikatz -Command '"lsadump::trust /patch"' -ComputerName dc.my.domain.local
Invoke-Mimikatz -Command '"lsadump::dcsync /user:dcorp\mcorp$"'
SID-History ã€ã³ãžã§ã¯ã·ã§ã³
SID-History ã€ã³ãžã§ã¯ã·ã§ã³ãæªçšããŠãä¿¡é Œé¢ä¿ãä¹±çšããå/芪ãã¡ã€ã³ã®ãšã³ã¿ãŒãã©ã€ãºç®¡çè ãšããŠæš©éãææ ŒãããŸãïŒ
{% content-ref url="sid-history-injection.md" %} sid-history-injection.md {% endcontent-ref %}
æžã蟌ã¿å¯èœãª Configuration NC ã®æªçš
Configuration NC ã¯ãã©ã¬ã¹ãã®èšå®æ å ±ã®äž»èŠãªãªããžããªã§ããããã©ã¬ã¹ãå ã®ãã¹ãŠã® DC ã«ã¬ããªã±ãŒããããŸããããã«ããã©ã¬ã¹ãå ã®ãã¹ãŠã®æžã蟌ã¿å¯èœãª DCïŒèªã¿åãå°çšã® DC ã¯é€ãïŒã¯ãæžã蟌ã¿å¯èœãª Configuration NC ã®ã³ããŒãä¿æããŠããŸãããããæªçšããã«ã¯ãïŒåïŒDC äžã§ SYSTEM ãšããŠå®è¡ããå¿ èŠããããŸãã
以äžã«èšèŒãããŠããæ§ã ãªæ¹æ³ã§ã«ãŒããã¡ã€ã³ã䟵害ããããšãå¯èœã§ãã
ã«ãŒã DC ãµã€ãã« GPO ããªã³ã¯ãã
Configuration NC ã® Sites ã³ã³ããã«ã¯ãAD ãã©ã¬ã¹ãã«åå ããŠããã³ã³ãã¥ãŒã¿ã®ãã¹ãŠã®ãµã€ããå«ãŸããŠããŸãããã©ã¬ã¹ãå ã®ä»»æã® DC äžã§ SYSTEM ãšããŠå®è¡ããããšã«ããããã©ã¬ã¹ãã®ã«ãŒã DC ã®ãµã€ããå«ããµã€ãã« GPO ããªã³ã¯ãããããã䟵害ããããšãå¯èœã§ãã
詳现ã¯ãã¡ãã§èªãããšãã§ããŸã Bypass SID filtering researchã
ãã©ã¬ã¹ãå ã®ä»»æã® gMSA ã䟵害ãã
æ»æã¯ã察象ãã¡ã€ã³å ã®ç¹æš©ãæ〠gMSA ã«äŸåããŠããŸãã
ãã©ã¬ã¹ãå ã® gMSA ã®ãã¹ã¯ãŒããèšç®ããããã«äœ¿çšããã KDS Root ããŒã¯ãConfiguration NC ã«æ ŒçŽãããŠããŸãããã©ã¬ã¹ãå ã®ä»»æã® DC äžã§ SYSTEM ãšããŠå®è¡ããããšã«ãããKDS Root ããŒãèªã¿åãããã©ã¬ã¹ãå ã®ä»»æã® gMSA ã®ãã¹ã¯ãŒããèšç®ããããšãã§ããŸãã
詳现ã¯ãã¡ãã§èªãããšãã§ããŸãïŒGolden gMSA trust attack from child to parentã
ã¹ããŒãå€æŽæ»æ
æ»æè ã¯æ°ããç¹æš© AD ãªããžã§ã¯ããäœæãããã®ãåŸ ã€å¿ èŠããããŸãã
ãã©ã¬ã¹ãå ã®ä»»æã® DC äžã§ SYSTEM ãšããŠå®è¡ããããšã«ãããä»»æã®ãŠãŒã¶ãŒã« AD ã¹ããŒãã®ãã¹ãŠã®ã¯ã©ã¹ã«å¯Ÿããå®å šãªå¶åŸ¡ãä»äžããããšãã§ããŸãããã®å¶åŸ¡ã¯ã䟵害ãããããªã³ã·ãã«ã«å®å šãªå¶åŸ¡ãä»äžãã ACE ãä»»æã® AD ãªããžã§ã¯ãã®ããã©ã«ãã»ãã¥ãªãã£èšè¿°åã«äœæããããã«æªçšãããå¯èœæ§ããããŸããå€æŽããã AD ãªããžã§ã¯ãã¿ã€ãã®æ°ããã€ã³ã¹ã¿ã³ã¹ã¯ããã® ACE ãæã€ããšã«ãªããŸãã
詳现ã¯ãã¡ãã§èªãããšãã§ããŸãïŒSchema change trust attack from child to parentã
ADCS ESC5 ã䜿çšã㊠DA ãã EA ãž
ADCS ESC5ïŒVulnerable PKI Object Access ControlïŒæ»æã¯ãPKI ãªããžã§ã¯ãã®å¶åŸ¡ãæªçšããŠããã©ã¬ã¹ãå ã®ä»»æã®ãŠãŒã¶ãŒãšããŠèªèšŒããããã«æªçšã§ããè匱ãªèšŒææžãã³ãã¬ãŒããäœæããŸããPKI ãªããžã§ã¯ãã¯ãã¹ãŠ Configuration NC ã«æ ŒçŽãããŠããããããã©ã¬ã¹ãå ã®ä»»æã®æžã蟌ã¿å¯èœãªïŒåïŒDC ã䟵害ããå ŽåãESC5 ãå®è¡ããããšãã§ããŸãã
詳现ã¯ãã¡ãã§èªãããšãã§ããŸãïŒFrom DA to EA with ESC5
AD ãã©ã¬ã¹ãã« ADCS ããªãå Žåãæ»æè ã¯ãã¡ãã«èšèŒãããŠããããã«å¿ èŠãªã³ã³ããŒãã³ããäœæããããšãã§ããŸãïŒEscalating from child domainâs admins to enterprise admins in 5 minutes by abusing AD CS, a follow up.
å€éšãã©ã¬ã¹ããã¡ã€ã³ - çæ¹åïŒã€ã³ããŠã³ãïŒãŸãã¯åæ¹å
Get-DomainTrust
SourceName : a.domain.local --> Current domain
TargetName : domain.external --> Destination domain
TrustType : WINDOWS-ACTIVE_DIRECTORY
TrustAttributes :
TrustDirection : Inbound --> Inboud trust
WhenCreated : 2/19/2021 10:50:56 PM
WhenChanged : 2/19/2021 10:50:56 PM
ãã®ã·ããªãªã§ã¯ãããªãã®ãã¡ã€ã³ã¯ä¿¡é ŒãããŠããŸã å€éšã®ãã¡ã€ã³ã«ãã£ãŠãããã«å¯ŸããŠäžç¹å®ã®æš©éãäžããããŠããŸããããªãã¯ããªãã®ãã¡ã€ã³ã®ã©ã®ããªã³ã·ãã«ãå€éšãã¡ã€ã³ã«ã©ã®ãããªã¢ã¯ã»ã¹æš©ãæã£ãŠããããèŠã€ãåºãããããå©çšããããšããå¿ èŠããããŸãïŒ
{% content-ref url="external-forest-domain-oneway-inbound.md" %} external-forest-domain-oneway-inbound.md {% endcontent-ref %}
å€éšãã©ã¬ã¹ããã¡ã€ã³ - çæ¹åïŒã¢ãŠãããŠã³ãïŒ
Get-DomainTrust -Domain current.local
SourceName : current.local --> Current domain
TargetName : external.local --> Destination domain
TrustType : WINDOWS_ACTIVE_DIRECTORY
TrustAttributes : FOREST_TRANSITIVE
TrustDirection : Outbound --> Outbound trust
WhenCreated : 2/19/2021 10:15:24 PM
WhenChanged : 2/19/2021 10:15:24 PM
ãã®ã·ããªãªã§ã¯ã**ããªãã®ãã¡ã€ã³**ã**ç°ãªããã¡ã€ã³**ããã®ããªã³ã·ãã«ã«ããã€ãã®**æš©é**ã**ä¿¡é Œ**ããŠããŸãã
ãããã**ãã¡ã€ã³ãä¿¡é Œããã**ãšãä¿¡é ŒããŠãããã¡ã€ã³ã¯**äºæž¬å¯èœãªåå**ãæã€ãŠãŒã¶ãŒã**äœæ**ãã**ä¿¡é Œããããã¹ã¯ãŒãããã¹ã¯ãŒããšããŠäœ¿çš**ããŸããã€ãŸããä¿¡é ŒããŠãããã¡ã€ã³ã®ãŠãŒã¶ãŒãä¿¡é Œããããã¡ã€ã³ã«**ã¢ã¯ã»ã¹**ããŠåæããããã«æš©éããšã¹ã«ã¬ãŒãããããšããããšãå¯èœã§ãïŒ
{% content-ref url="external-forest-domain-one-way-outbound.md" %}
[external-forest-domain-one-way-outbound.md](external-forest-domain-one-way-outbound.md)
{% endcontent-ref %}
ä¿¡é Œããããã¡ã€ã³ã䟵害ããå¥ã®æ¹æ³ã¯ããã¡ã€ã³ã®ä¿¡é Œã®**éæ¹å**ã«äœæããã[**SQLä¿¡é Œãªã³ã¯**](abusing-ad-mssql.md#mssql-trusted-links)ãèŠã€ããããšã§ãïŒããã¯ããŸãäžè¬çã§ã¯ãããŸããïŒã
ä¿¡é Œããããã¡ã€ã³ã䟵害ããããäžã€ã®æ¹æ³ã¯ãä¿¡é Œããããã¡ã€ã³ã®**ãŠãŒã¶ãŒãã¢ã¯ã»ã¹ã§ãã**ãã·ã³ã§åŸ
ã¡ã**RDP**çµç±ã§ãã°ã€ã³ããã®ãåŸ
ã€ããšã§ãããã®åŸãæ»æè
ã¯RDPã»ãã·ã§ã³ããã»ã¹ã«ã³ãŒãã泚å
¥ãããããã**被害è
ã®å
ã®ãã¡ã€ã³ã«ã¢ã¯ã»ã¹**ããããšãã§ããŸãã\
ããã«ã**被害è
ãããŒããã©ã€ããããŠã³ããã**å Žåã**RDPã»ãã·ã§ã³**ããã»ã¹ããæ»æè
ã¯**ããŒããã©ã€ãã®ã¹ã¿ãŒãã¢ãããã©ã«ããŒ**ã«**ããã¯ãã¢**ãä¿åããããšãã§ããŸãããã®æè¡ã¯**RDPInception**ãšåŒã°ããŠããŸãã
{% content-ref url="rdp-sessions-abuse.md" %}
[rdp-sessions-abuse.md](rdp-sessions-abuse.md)
{% endcontent-ref %}
### ãã¡ã€ã³ä¿¡é Œã®æªçšç·©å
**SIDãã£ã«ã¿ãªã³ã°ïŒ**
* ãã©ã¬ã¹ãä¿¡é Œãè¶ããSIDå±¥æŽå±æ§ã®æªçšãé²ãã
* ãã¹ãŠã®ã€ã³ã¿ãŒãã©ã¬ã¹ãä¿¡é Œã§ããã©ã«ãã§æå¹ã«ãªã£ãŠããŸããã€ã³ã¿ãŒãã©ã¬ã¹ãä¿¡é Œã¯ããã©ã«ãã§å®å
šãšèŠãªãããŠããŸãïŒMSã¯ãã¡ã€ã³ã§ã¯ãªããã©ã¬ã¹ããã»ãã¥ãªãã£å¢çãšèŠãªããŠããŸãïŒã
* ããããSIDãã£ã«ã¿ãªã³ã°ã¯ã¢ããªã±ãŒã·ã§ã³ãšãŠãŒã¶ãŒã¢ã¯ã»ã¹ãå£ãå¯èœæ§ãããããããã°ãã°ç¡å¹ã«ãããŸãã
* éžæçèªèšŒ
* ã€ã³ã¿ãŒãã©ã¬ã¹ãä¿¡é Œã§éžæçèªèšŒãèšå®ãããŠããå Žåãä¿¡é Œéã®ãŠãŒã¶ãŒã¯èªåçã«èªèšŒãããŸãããä¿¡é ŒããŠãããã¡ã€ã³/ãã©ã¬ã¹ãå
ã®ãã¡ã€ã³ãšãµãŒããŒãžã®åå¥ã®ã¢ã¯ã»ã¹ãäžããã¹ãã§ãã
* æžã蟌ã¿å¯èœãªConfigration NCã®æªçšãšä¿¡é Œã¢ã«ãŠã³ãæ»æãé²ãããšã¯ã§ããŸããã
[**ired.teamã§ãã¡ã€ã³ä¿¡é Œã«ã€ããŠã®è©³çŽ°æ
å ±ã**](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/child-domain-da-to-ea-in-parent-domain)
## AD -> ã¯ã©ãŠã & ã¯ã©ãŠã -> AD
{% embed url="https://cloud.hacktricks.xyz/pentesting-cloud/azure-security/az-lateral-movements/azure-ad-connect-hybrid-identity" %}
## ããã€ãã®äžè¬çãªé²åŸ¡
[**ããã§è³æ Œæ
å ±ãä¿è·ããæ¹æ³ã«ã€ããŠãã£ãšåŠã¶ã**](../stealing-credentials/credentials-protections.md)\
**æè¡ã®èª¬æã§åæè¡ã«å¯Ÿããããã€ãã®ç§»è¡ãèŠã€ããŠãã ããã**
* ãã¡ã€ã³ç®¡çè
ããã¡ã€ã³ã³ã³ãããŒã©ãŒä»¥å€ã®ãã¹ãã«ãã°ã€ã³ããããšãèš±å¯ããªã
* DAæš©éã§ãµãŒãã¹ãå®è¡ããªã
* ãã¡ã€ã³ç®¡çè
æš©éãå¿
èŠãªå Žåã¯ãæéãå¶éããïŒ`Add-ADGroupMember -Identity âDomain Adminsâ -Members newDA -MemberTimeToLive (New-TimeSpan -Minutes 20)`
### 欺ç
* ãã¹ã¯ãŒããæéåãã«ãªããªã
* å§ä»»ã®ããã«ä¿¡é ŒãããŠãã
* SPNãæã€ãŠãŒã¶ãŒ
* 説æã®äžã®ãã¹ã¯ãŒã
* é«æš©éã°ã«ãŒãã®ã¡ã³ããŒã§ãããŠãŒã¶ãŒ
* ä»ã®ãŠãŒã¶ãŒãã°ã«ãŒãããŸãã¯ã³ã³ããã«å¯ŸããACLæš©éãæã€ãŠãŒã¶ãŒ
* ã³ã³ãã¥ãŒã¿ãŒãªããžã§ã¯ã
* ...
* [https://github.com/samratashok/Deploy-Deception](https://github.com/samratashok/Deploy-Deception)
* `Create-DecoyUser -UserFirstName user -UserLastName manager-uncommon -Password Pass@123 | DeployUserDeception -UserFlag PasswordNeverExpires -GUID d07da11f-8a3d-42b6-b0aa-76c962be719a -Verbose`
## 欺çã®ç¹å®æ¹æ³
**ãŠãŒã¶ãŒãªããžã§ã¯ãã®å ŽåïŒ**
* ObjectSIDïŒãã¡ã€ã³ãšç°ãªãïŒ
* lastLogon, lastlogontimestamp
* LogoncountïŒéåžžã«äœãæ°ã¯æªããïŒ
* whenCreated
* BadpwdcountïŒéåžžã«äœãæ°ã¯æªããïŒ
**äžè¬çãªæ¹æ³ïŒ**
* ããã€ãã®ãœãªã¥ãŒã·ã§ã³ã¯ãå¯èœãªãã¹ãŠã®å±æ§ã«æ
å ±ãèšå
¥ããŸããäŸãã°ãDCã®ãããª100%å®éã®ã³ã³ãã¥ãŒã¿ãŒãªããžã§ã¯ãã®å±æ§ãšã³ã³ãã¥ãŒã¿ãŒãªããžã§ã¯ãã®å±æ§ãæ¯èŒããŸãããŸãã¯ãRID 500ïŒããã©ã«ãã®ç®¡çè
ïŒã«å¯ŸãããŠãŒã¶ãŒã
* äœããããŸãã«ãè¯ãããå Žåã¯ç¢ºèªãã
* [https://github.com/JavelinNetworks/HoneypotBuster](https://github.com/JavelinNetworks/HoneypotBuster)
### Microsoft ATAæ€åºã®ãã€ãã¹
#### ãŠãŒã¶ãŒåæ
ATAã¯DCã§ã»ãã·ã§ã³ãåæããããšãããšãã«ã®ã¿æå¥ãèšãã®ã§ãDCã§ã¯ãªãä»ã®ãã¹ãã§ã»ãã·ã§ã³ãæ¢ããªããã°ãããããæ€åºãããŸããã
#### ãã±ããã®ãªãããŸãäœæïŒOver pass the hash, golden ticket...ïŒ
ãã±ãããäœæãããšãã¯ãATAãNTLMãžã®å£åãšããŠæªæã®ãããã®ãšèå¥ããã®ã§ã**aes**ããŒã䜿çšããŠãã ããã
#### DCSync
ãã¡ã€ã³ã³ã³ãããŒã©ãŒããå®è¡ããªãå ŽåãATAã«æãŸããŸããããããªããã
## ãã®ä»ã®ããŒã«
* [ãã¡ã€ã³ç£æ»ã®èªååãè¡ãPowershellã¹ã¯ãªãã](https://github.com/phillips321/adaudit)
* [ã¢ã¯ãã£ããã£ã¬ã¯ããªãåæããPythonã¹ã¯ãªãã](https://github.com/ropnop/windapsearch)
* [ã¢ã¯ãã£ããã£ã¬ã¯ããªãåæããPythonã¹ã¯ãªãã](https://github.com/CroweCybersecurity/ad-ldap-enum)
## åèæç®
* [http://www.harmj0y.net/blog/redteaming/a-guide-to-attacking-domain-trusts/](http://www.harmj0y.net/blog/redteaming/a-guide-to-attacking-domain-trusts/)
<details>
<summary><strong>htARTE (HackTricks AWS Red Team Expert)ã§AWSãããã³ã°ããŒãããããŒããŒãŸã§åŠã¶</strong></summary>
HackTricksããµããŒãããä»ã®æ¹æ³ïŒ
* **HackTricksã«ããªãã®äŒç€Ÿãåºåããã**ããŸãã¯**HackTricksãPDFã§ããŠã³ããŒãããã**å Žåã¯ã[**ãµãã¹ã¯ãªãã·ã§ã³ãã©ã³**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
* [**å
¬åŒã®PEASS & HackTricksã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ãã
* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãçºèŠããç¬å çãª[**NFTs**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³ããã§ãã¯ããŠãã ãã
* ð¬ [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ã«**åå ãã**ãã[**telegramã°ã«ãŒã**](https://t.me/peass)ã«åå ãããã**Twitter** ðŠ [**@carlospolopm**](https://twitter.com/carlospolopm)ã§**ãã©ããŒ**ããŠãã ããã
* **HackTricks**ã®[**githubãªããžããª**](https://github.com/carlospolop/hacktricks)ãš[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud)ã«PRãæåºããŠãããã³ã°ã®ã³ããå
±æããŠãã ããã
</details>