MH-security-Lab

# MH Security Lab `root@mr-monsif:~#` **Hands-on web security training for access control, authentication and business logic bugs.**
English and Arabic. Runs entirely in the browser. [**Open the lab**](https://monsifhmouri.github.io/MH-security-Lab/) · [العربية](/MH-security-Lab/README.ar.html) · [Run locally](#run-it-locally) · [Certificates](#certificates) [![Tests](https://github.com/monsifhmouri/MH-security-Lab/actions/workflows/test.yml/badge.svg)](https://github.com/monsifhmouri/MH-security-Lab/actions/workflows/test.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](LICENSE) [![Telegram](https://img.shields.io/badge/Telegram-Contact-blue?style=flat-square&logo=telegram)](http://t.me/monstr_m1nd) [![Instagram](https://img.shields.io/badge/Instagram-Follow-purple?style=flat-square&logo=instagram)](https://www.instagram.com/httpx.mrmonsif/) [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=flat-square&logo=linkedin)](https://www.linkedin.com/in/monsifhmouri/) MH Security Lab home page

About

Some of the most damaging web vulnerabilities are not found by pointing a scanner at a target. A scanner does not know that invoice 1043 belongs to someone else, that a logged-out session should be dead, or that a shop should never accept a quantity of -2. Finding these takes an understanding of what the application is supposed to do.

MH Security Lab is built to practise exactly that. Each topic has written lessons, a small fictional application to attack, and challenges that check your result automatically. Every application also has a secure version, so you can replay the same requests and see which control stops them.

Contents

What is inside

Module Covers Practice app Lessons Challenges
01 · IDOR / BOLA Object-level authorization, nested resources, testing with two accounts Ledgerly (billing and documents) 11 3
02 · Authentication & ATO Login, password reset, sessions, cookies, MFA, account takeover Portalis (accounts) 11 4
03 · Business Logic Prices, coupons, quantities, payment workflows, race conditions (concept and defence) Cartwheel (online shop) 11 4

Lessons start from first principles and continue to impact assessment, report writing and prevention.

Also included:

Challenges

ID Challenge Level
idor-1 Someone else’s invoice Beginner
idor-2 Read is locked, write is not Intermediate
idor-3 The parent check trap Advanced
auth-1 The talkative login form Beginner
auth-2 Logout that does not log out Intermediate
auth-3 Skipping the second factor Intermediate
auth-4 A reset token for the wrong person Advanced
logic-1 Name your own price Beginner
logic-2 One coupon, many times Intermediate
logic-3 Quantities below zero Intermediate
logic-4 Ship now, pay never Advanced

Each challenge has a scenario, objectives, instructions, a success condition, hints and an explained solution.

Using the lab

  1. Open the site and enter your full name. It is the name printed on your certificates.
  2. Pick a module and read its lessons. Mark each one as completed.
  3. Open the matching lab and choose a challenge.
  4. Edit the method, path, headers or body, then press Send (Ctrl + Enter).
  5. Read the response. A success screen appears as soon as the condition is met.
  6. Switch to Secure build and repeat your steps to compare.
Request editor and response viewer

Terminal commands: help, whoami, ls, cd, pwd, cat, modules, open, lab, challenges, progress, completed, badges, certs, lang, history, date, clear

Your progress is saved in your browser’s local storage. There are no accounts. Use Export progress on the dashboard before clearing site data or moving to another device.

Run it locally

You need Node.js 18 or newer. The project has no dependencies to install.

git clone https://github.com/monsifhmouri/MH-security-Lab.git
cd MH-security-Lab
npm start

Then open http://127.0.0.1:8080. To use another port on Linux or macOS: PORT=3000 npm start.

You can also open docs/index.html directly in a browser. In that case, certificate links and QR codes only work on your own device.

Command What it does
npm start Builds the site and serves it locally
npm run build Bundles src/ into docs/index.html
npm test Runs the lab engine tests
npm run test:e2e Runs the browser walk-through (needs Playwright)
npm run issue -- <file> Adds a verified certificate to the registry (site owner)

Deployment

The site is static and is published with GitHub Pages:

  1. Go to Settings → Pages.
  2. Under Build and deployment, choose Deploy from a branch.
  3. Select branch main and folder /docs, then save.

After editing anything in src/ or data/, run npm run build and commit the updated docs/ folder. The test workflow fails if the published files do not match the sources.

If you fork the project, replace the branding, portrait and links with your own.

Certificates

Finishing a module unlocks its certificate. You need all 11 lessons marked as completed and every challenge in that module solved.

Certificate Challenges required
IDOR / BOLA Security Research Certificate 3
Authentication Security Certificate 4
Business Logic Security Certificate 4

Each one shows the learner’s name, specialization, completion date, a unique ID (for example MH-IDOR-2026-XXXXXXXXXXXX) and a QR code. It can be downloaded as an A4 landscape PDF or as a PNG image.

Sample certificate

[!IMPORTANT] These are independently issued educational completion certificates. They are not accredited professional qualifications and are not issued by an external certification authority.

Verification

Status What it means
Registry verified The ID is listed in this site’s public registry, after the submitted lab solutions were replayed and passed
Not verified The link is internally consistent but not registered. Anyone could have generated it
No valid certificate found The ID is not registered, or the link is incomplete or altered

Learners: to have a certificate registered, download its proof file from the Certificates page and send it to me on Telegram or LinkedIn. The registry is public and includes your name, so only send it if you agree to that.

Site owner:

npm run issue -- path/to/proof.json
npm run build
git add data docs
git commit -m "Register certificate"
git push

Check the name before publishing it. Registration confirms that the submitted requests solve the challenges. It does not prove who worked them out, since solutions are part of the course, and lesson completion is self-reported.

How it works

The three practice applications are JavaScript simulations in src/js/engine.js. When you press Send, the request is handled inside the page. Nothing is sent to a real server or a third-party system. All users, products, orders and tokens are fictional.

The interface is plain HTML, CSS and JavaScript, bundled into a single file. A Content Security Policy restricts what the page may load. The only external resource is Google Fonts, with system fonts as a fallback.

.
├── src/
│   ├── index.html          page template
│   ├── styles.css
│   └── js/
│       ├── engine.js       simulated back-ends and challenge validation
│       ├── challenges.js   scenarios, hints and solutions
│       ├── content-*.js    lessons, tools, glossary, references
│       ├── certificates.js certificate rendering, PDF and verification
│       └── ...             interface, terminal, translations, QR encoder
├── data/registry.json      registered certificates
├── tools/                  build, local server, certificate registration
├── tests/                  engine, browser and QR tests
├── assets/                 portrait and screenshots
└── docs/                   built site served by GitHub Pages

Testing

npm test

For every challenge, the tests check that it can be solved on the vulnerable build, cannot be solved on the secure build, and that its recorded proof replays correctly. They also send malformed input to the engine.

The browser walk-through covers the challenges, certificates, verification, terminal and both languages at desktop, tablet and phone widths:

npm install --no-save playwright
npx playwright install chromium
npm run build
npm run test:e2e

Contributing

Corrections to lessons, translation fixes and new challenge ideas are welcome. Open an issue first for larger changes. Before sending a pull request, run npm test and npm run build.

Responsible use

Use these techniques only on systems you own or have written permission to test, and follow the scope and rules of each bug bounty programme. Unauthorised testing is illegal in most countries.

License

Code and lesson text are released under the MIT License. The name Monsif Hmouri, the portrait and the MH logo are not covered by it.


Built by **Monsif Hmouri**, security researcher [Telegram](http://t.me/monstr_m1nd) · [Instagram](https://www.instagram.com/httpx.mrmonsif/) · [LinkedIn](https://www.linkedin.com/in/monsifhmouri/)