← RegistryDossier · 6 steps · 5 edges
SSRF → reach internal Redis → write SSH key → RCE
Web app SSRF lets the attacker hit gopher://redis on the internal network. Inject CONFIG SET dir + dbfilename + SAVE to write an SSH authorized_keys onto the Redis host — log in as the Redis user.
Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll
§ Context
Assumed environment: target web app has an SSRF primitive (URL fetcher / proxy / image library). An internal Redis instance accepts unauthenticated connections from app-server IPs.
§ Steps
- 01SSH in as redis userInitial AccessT1078— Valid Accounts
- 02Identify SSRF primitive (gopher:// support)Lateral MovementW-SSRF— Server-Side Request Forgery (SSRF)
- 03Reach internal Redis via gopher://Lateral MovementW-SSRF-INTERNAL— SSRF → Internal Service Exploit
- 04Continue internal pivotLateral MovementN-SSH-PROXY— SSH Dynamic / Reverse Tunnel
- 05SAVE → writes ~/.ssh/authorized_keysExecutionDB-REDIS-RCE— Redis Unauth → RCE via CONFIG
- 06CONFIG SET dir / dbfilenameExecutionDB-REDIS-RCE— Redis Unauth → RCE via CONFIG
§ References
- T1078Valid Accounts
§ Frequently asked
- What is the "SSRF → reach internal Redis → write SSH key → RCE" attack path?
- Web app SSRF lets the attacker hit gopher://redis on the internal network. Inject CONFIG SET dir + dbfilename + SAVE to write an SSH authorized_keys onto the Redis host — log in as the Redis user. It chains 6 steps drawn from real-world offensive-security techniques.
- What starting position does this attack require?
- The first step is SSH in as redis user (T1078) — a initial access primitive. Assumed environment: target web app has an SSRF primitive (URL fetcher / proxy / image library).
- What is the final impact of this kill-chain?
- The final step lands on CONFIG SET dir / dbfilename (DB-REDIS-RCE), which falls under Execution. From here, an operator typically pivots into post-exploitation or maintains persistence.
- How can defenders detect or prevent this attack?
- Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.
§ Related dossiers
- Shared techniques2
VLAN hopping → cross into production
Discover that the access port negotiates trunking (DTP). Send double-tagged frames or set up a fake trunk to send packets into restricted VLANs.
- Shared techniques2
SSRF → IMDS → cloud creds → lateral
An image-fetcher / link-preview endpoint fetches attacker-controlled URLs server-side. Pivot to the cloud metadata service and steal the instance role credentials.