Skip to content

About

web-pentest-lab home

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web App Pentest Lab

Educational Levels Techniques Stack License

FOR EDUCATIONAL / AUTHORIZED LAB USE ONLY

Author: Mostafa Tamime
GitHub: mostafatamime99 · TryHackMe: mostafatamime8

Hands-on web application vulnerability labs I built while progressing through TryHackMe’s Jr. Penetration Tester path toward PJPT-level skills.
Every technique is a complete mini-course: theory → detection → runnable vulnerable app → Easy / Medium / Hard challenges → curl PoCs → mitigation.

If this helps your learning, a ⭐ star on the repo makes it easier for other students to find.


Why this lab exists

Most writeups show what worked once. This repo is built so you can repeat the skill locally:

You get Why it helps
Runnable PHP labs Break things safely on localhost — no VPN room required
Easy → Medium → Hard Same vulnerability, rising difficulty (bypass → extract → defeat filters)
Cheatsheets Fast payload recall while you practice
PoC notes Command-by-command proofs you can re-run and demo in interviews
Mitigation sections Learn how to fix what you exploited — defender mindset

Built as a portfolio companion to my machine writeups: write-ups-CTF.


Learning path

Work top to bottom. Finish Easy before Medium; finish Medium before Hard.

1. SQLi          → auth bypass → UNION → blind + WAF bypass
2. XSS           → reflected → stored → filter bypass
3. Auth bypass   → cookie trust → magic hash → weak API token
4. IDOR          → read → enumerate → write (update another user)
5. LFI / RFI     → file read → wrappers/traversal → path filter bypass
6. JWT           → decode → alg:none → crack secret & re-sign
7. SSRF          → internal HTTP → file:// → blacklist bypass

Suggested pace: one technique per study session (≈45–90 minutes with notes).


Labs & techniques

# Technique Levels What you practice Start
1 SQL Injection Easy / Medium / Hard Auth bypass, UNION dump, boolean blind + keyword filter :8000
2 XSS Easy / Medium / Hard Reflected, stored, blacklist bypass (<script> / onerror) :8001
3 IDOR Easy / Medium / Hard Read IDOR, id enumeration, write IDOR :8002
4 LFI / RFI Easy / Medium / Hard Arbitrary read, php://filter, traversal filter bypass :8003
5 JWT attacks Easy / Medium / Hard Decode claims, alg:none, weak HS256 secret :8004
6 SSRF Easy / Medium / Hard Internal pivot, file://, host blacklist bypass :8005
7 Auth bypass Easy / Medium / Hard Cookie trust, PHP magic hashes, weak API token :8006

Each folder includes:

  • README.md — overview, methodology, mitigations, references
  • cheatsheet.md — payloads
  • lab/ — vulnerable app + SETUP.md + easy.php / medium.php / hard.php
  • poc/poc.md — proof-of-concept commands

Requirements

Item Notes
PHP 8.x Built-in server: php -S localhost:PORT
pdo_sqlite Needed for SQLi, XSS (guestbook), IDOR
OS Kali, Ubuntu, WSL, or Windows with PHP

Kali — install SQLite driver (fixes could not find driver)

sudo apt update
sudo apt install php-sqlite3
php -m | grep -i sqlite

No MySQL/Docker required. Labs create lab.db on first request where needed.


Quick start

git clone https://github.com/mostafatamime99/web-pentest-lab.git
cd web-pentest-lab

Run one lab

cd sqli/lab
rm -f lab.db                 # recreate DB after schema updates
php -S localhost:8000

Open the hub: http://localhost:8000/index.php

Port map (run several labs at once)

Port Lab Hub
8000 SQL Injection http://localhost:8000/index.php
8001 XSS http://localhost:8001/index.php
8002 IDOR http://localhost:8002/index.php
8003 LFI / RFI http://localhost:8003/hub.php
8004 JWT http://localhost:8004/index.php
8005 SSRF http://localhost:8005/index.php
8006 Auth bypass http://localhost:8006/index.php
# example: three labs in parallel (separate terminals)
cd sqli/lab && php -S localhost:8000
cd xss/lab  && php -S localhost:8001
cd idor/lab && php -S localhost:8002

Level design (every technique)

Level Intent Example (SQLi)
Easy Spot the bug, land a basic exploit ' OR '1'='1' -- login bypass
Medium Extract real value / chain concepts UNION SELECT dump of users
Hard Defeat a weak control (filter / blacklist) Boolean blind + keyword bypass → FLAG{…}

Same pattern across XSS, IDOR, LFI, JWT, SSRF, and Auth bypass — so skills transfer between topics.


Repository layout

web-pentest-lab/
├── README.md                 ← you are here
├── sqli/                     ← SQL injection          (:8000)
├── xss/                      ← cross-site scripting   (:8001)
├── idor/                     ← broken access control  (:8002)
├── lfi/                      ← file inclusion         (:8003)
├── jwt/                      ← JSON Web Token attacks (:8004)
├── ssrf/                     ← server-side request forgery (:8005)
└── authbypass/               ← authentication flaws   (:8006)

<technique>/
├── README.md                 overview · detection · mitigation
├── cheatsheet.md             payloads
├── lab/
│   ├── SETUP.md
│   ├── index.php             hub (Easy / Medium / Hard links)
│   ├── easy.php | medium.php | hard.php
│   └── …                     supporting files / SQLite schema
└── poc/
    └── poc.md                curl / command walkthrough

How to study (recommended)

  1. Read the technique README.md (what / why / how to detect).
  2. Start the lab → clear Easy.
  3. Use the cheatsheet only when stuck; then try Medium.
  4. Finish Hard without copying the PoC first; then compare with poc/poc.md.
  5. Write 3–5 lines of notes: root cause, payload idea, fix.
  6. Map the skill to a real box (THM / HTB / TCM capstone) in write-ups-CTF.

Training context

Source Skill reinforced in this repo
TryHackMe — Jr. Penetration Tester SQLi, XSS, access control, file inclusion
TCM Security — PEH Capstone (Academy, Dev, …) Full-box chaining of these web bugs
PJPT-oriented practice Methodology: enum → exploit → prove → mitigate

Troubleshooting

Problem Fix
could not find driver (PDO) sudo apt install php-sqlite3 then restart php -S
Old pages / missing tables rm -f lab.db inside that lab/ folder
Port already in use Pick another port: php -S localhost:8010
Hard filter “Blocked” That’s the challenge — see the level hint / cheatsheet

Contributing / feedback

Issues and PRs that improve clarity, add safer lab notes, or fix broken setups are welcome.
Keep everything educational and localhost-only.


Author

Mostafa Tamime — building practical pentest skills toward PJPT through labs and full-box writeups.


Legal notice

Run these vulnerable apps only on machines you own or have explicit permission to use (localhost / isolated VMs).
Do not deploy them to the public internet. Do not use these techniques against systems without written authorization.

Unauthorized testing is illegal. This repository is for education and authorized practice only.


Support the project

If these labs helped you learn SQLi, XSS, IDOR, LFI, JWT, SSRF, or auth bypass — please ⭐ star the repo and share it with someone starting web pentesting.

About

web-pentest-lab home

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages