Sploitus

Exploit for vuln-chain-labs

githubexploit Β· 2026-09-12

Exploit Code

README151 lines
## https://sploitus.com/exploit?id=49742684-7410-5683-B670-014170CB7470
# VulnChain Labs

A deliberately vulnerable API that reproduces a real-world exploit chain discovered during an authorized bug bounty engagement. The chain escalates from **unauthenticated outsider to full Remote Code Execution** through 6 independent vulnerabilities, each exploitable as a standalone finding.

The original chain produced **9 accepted reports (3 Critical, 2 High, 4 Medium)** on a private bug bounty program.

## The Chain

```
Outsider (no account)
    β”‚
    β–Ό
[Lab 1] nOAuth ATO ──────────────── Critical 9.1
    β”‚   Multi-tenant SSO accepts foreign tokens
    β”‚   Maps users by mutable email attribute
    β”‚
    β–Ό
  ROLE_USER session
    β”‚
    β”œβ”€β”€[Lab 2] Reset Token ATO ──── High 8.8
    β”‚   GET /users leaks recoverPasswordToken
    β”‚   POST /reset_password is unauthenticated
    β”‚
    β”œβ”€β”€[Lab 3] Systemic ACL Bypass ─ High 8.3
    β”‚   POST blocked, PUT/PATCH/DELETE open
    β”‚   Enables write to file-handling entities
    β”‚
    β–Ό
[Lab 4] Path Traversal LFI ──────── Critical 10.0
    β”‚   PATCH fileName with ../../
    β”‚   GET binary endpoint serves arbitrary files
    β”‚   Read .env.local β†’ JWT passphrase
    β”‚   Read config/jwt/private.pem β†’ signing key
    β”‚
    β–Ό
[Lab 5] JWT Forgery ──────────────── (chain step)
    β”‚   Decrypt private key with stolen passphrase
    β”‚   Forge ROLE_ADMIN token
    β”‚
    β–Ό
[Lab 6] RCE via File Upload ──────── Critical 9.9
    β”‚   POST /signatures uploads to web root
    β”‚   No file type or extension validation
    β”‚   Apache executes uploaded .php
    β”‚
    β–Ό
  Root-level code execution on server

[Lab 7] Full Chain ───────────────── walk-through
    All 6 steps combined end-to-end
```

## Quick Start

```bash
git clone https://github.com/YOUR_USERNAME/vuln-chain-labs.git
cd vuln-chain-labs
docker compose up --build -d
```

The API is available at `http://localhost:8080`.

Verify it's running:
```bash
curl http://localhost:8080/docs.json | jq .
```

## Lab Structure

Each lab is a self-contained challenge in the `labs/` directory:

| Lab | Vulnerability | Difficulty | Standalone CVSS |
|-----|--------------|------------|-----------------|
| [01](labs/01-noauth-ato/) | nOAuth Account Takeover | Medium | 9.1 |
| [02](labs/02-reset-token-ato/) | Password Reset Token ATO | Easy | 8.8 |
| [03](labs/03-systemic-acl-bypass/) | Systemic Write ACL Bypass | Easy | 8.3 |
| [04](labs/04-path-traversal-lfi/) | Path Traversal β†’ LFI | Medium | 10.0 |
| [05](labs/05-jwt-forgery/) | JWT Private Key Theft β†’ Forgery | Hard | β€” |
| [06](labs/06-rce-file-upload/) | RCE via Unrestricted Upload | Medium | 9.9 |
| [07](labs/07-full-chain/) | Complete Chain (all 6 steps) | Hard | β€” |

Each lab folder contains:
- `README.md` β€” objective, hints, and background
- `solution.md` β€” full walkthrough with curl commands

## Tech Stack

Intentionally mirrors real-world targets using this common enterprise stack:

- **PHP 8.2** + Apache 2.4
- **Symfony-style** API Platform routing
- **Lexik-style** RS256 JWT authentication
- **VichUploader-style** file upload to web root
- **SQLite** database
- **Docker** for one-command setup

## Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Apache 2.4 (serves public/ directory)      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚ public/                                 β”‚β”‚
β”‚  β”‚  β”œβ”€β”€ index.php    (API front controller)β”‚β”‚
β”‚  β”‚  └── uploaded_signatures/  ← WEBROOT!   β”‚β”‚
β”‚  β”‚       └── *.php files execute here      β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚  config/jwt/                                β”‚
β”‚  β”œβ”€β”€ private.pem   (encrypted RSA key)      β”‚
β”‚  └── public.pem    (verification key)       β”‚
β”‚  .env              (fake passphrase)        β”‚
β”‚  .env.local        (REAL passphrase)        β”‚
β”‚  data/app.db       (SQLite database)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## Seeded Accounts

| Email | Password | Role | Notes |
|-------|----------|------|-------|
| admin@vulnproperty.local | Adm1n@SecurePlatform! | ROLE_ADMIN | Target for privilege escalation |
| j.smith@vulnproperty.local | user123 | ROLE_USER | Has reset token: `abc123def456token` |
| m.jones@vulnproperty.local | β€” | ROLE_USER | SSO-only, has reset token |
| s.brown@vulnproperty.local | β€” | ROLE_MANAGER | Has reset token |

## Tools You'll Need

- `curl` or Burp Suite
- `jq` for JSON parsing
- `python3` with `PyJWT` + `cryptography` (for Lab 5)
- `openssl` CLI (for key decryption)
- `base64` CLI utility

## Reset

To start fresh:
```bash
docker compose down -v
docker compose up --build -d
```

## Disclaimer

This application is **intentionally vulnerable** and designed for educational purposes only. Do not deploy it on any network accessible to untrusted users. The vulnerabilities are real and exploitable.

Built to demonstrate methodology from an authorized private bug bounty engagement. No proprietary code, data, or branding from the original target is included.

## License

MIT