sajjit.soti
← Back to projects

Case study — Team penetration test, EPITA

Web app penetration test: fourteen flaws, one chain of compromise

A four-person team ran a grey-box penetration test against a municipal citizen-portal web application, starting from an authenticated but low-privilege account. The goal wasn’t to find isolated bugs — it was to see how far a single chain of small mistakes could go. The answer: all the way to remote code execution and full database compromise.

14

Vulnerabilities identified and proven

2 + 9

Critical + High severity findings

<1s

Time to crack the extracted admin hash

Critical

Overall assessed risk rating

Conducted with Aimen Daddi, Oladapo Banjo-Obaleye, and Yahya Borghol.

01

The full chain, step by step

Every step in this assessment starts from a minor-looking flaw and chains straight into the next one. None of the techniques used are exotic — that’s exactly what makes it instructive: it was the most ordinary mistakes, stacked, that brought the application down.

1. A password “hidden” with ROT13

The CCTV configuration page validates its password entirely client-side, in JavaScript. The encoded password (ebg13vfxrl) is sitting directly in the page’s source — ROT13 decoding it gives rot13iskey. An early signal: security logic lives in the browser here, not the server.

2. Privilege escalation via unsigned cookies

The app identifies users through cookies (login, id_user) with no cryptographic signature at all. Logged in as a regular “chef” account, editing those cookies in browser dev tools — no exploit, no injection — and refreshing the page grants full administrator access.

3. Unrestricted file upload → remote code execution

Once admin, the article-management module accepts file attachments checked only by extension. A file named php-jpeg-shell.jpg.php slips past the filter — the double extension defeats the check — and the server executes the uploaded PHP script as code, exactly like any other .php file on the site.

# The filter only checks the "visible" extension, not the real MIME
# type, nor whether the filename carries multiple extensions.
Uploaded: php-jpeg-shell.jpg.php
Server result: executed as PHP → working web shell
Tested command: ?cmd=ipconfig → system output returned in the HTTP response

4. Database credentials found in plaintext

With shell access from the uploaded file, browsing the server’s directory tree turned up include/mysql.php, containing plaintext database credentials — direct access to every piece of data the application holds, bypassing the web interface entirely.

5. A second, independent path: SQL injection

Separately, the id parameter on the CCTV configuration page was vulnerable to a UNION-based SQL injection, extracting the administrator’s password hash directly. That unsalted MD5 hash cracked in under a second with Hashcat — two completely different paths led to the same level of compromise, a sign the weakness wasn’t a one-off but systemic.

6. Parameter tampering → financial fraud

The local tax payment module determines the amount due from a URL parameter that’s never revalidated server-side. Changing montant=200 to montant=0 (or a negative value) is enough to mark an invoice as paid, or even credit a balance.

02

The rest of the chain

Four more flaws round out the picture, each opening its own door:

  • Stored XSS in messaging. A message body containing <script>alert(document.cookie)</script> executes the moment an admin views it, exposing their session cookie.
  • CSRF on message deletion. Deletions go through a plain GET request with no token — a crafted page can force a logged-in victim’s messages to be deleted.
  • IDOR on the inbox. Changing id_user in the URL reads any other account’s private messages, admin included.
  • A public backup and hardcoded credentials in the source. A full database backup archive was publicly reachable at /backup/, protected by a trivial password (“hack”), and admin/agent/chef credentials sat in plain HTML comments, visible with a simple “View Page Source.”

The entire site also ran over unencrypted HTTP: even without exploiting a single flaw above, a basic network capture (Wireshark) was enough to intercept credentials and session tokens in plaintext.

03

The common root cause

Fourteen distinct findings, but one cause kept recurring: trusting the client. A cookie the browser can edit, a file extension checked without looking at real content, a payment amount read from the URL, a password validated in JavaScript — in every case, a security decision that should never have left the server had been delegated to the user’s browser instead. The report’s central recommendation fits in one sentence: every security decision must be revalidated server-side, with no exceptions.