Skip to content
ILIAN(1)
← Back to the manual

$ man relaisexpress

RelaisExpress

Ethical Hacking 1, Efrei, team of three · 2026

WebOffensiveDev and design

Context
Ethical Hacking course project: build the flaws yourself to understand where they come from.
What I did
A full attack chain between two machines (Kali against a Windows host running XAMPP): a booby-trapped contact message runs in the admin's browser and sends their session cookie, we replay it to enter the back office, then an SQL injection in the user search dumps the database.
My choices
Chain both flaws into one scenario, because that's how a real attack works: the XSS gives admin access, the injection gives the data. Fixes are server-side, since browser-side protection can be bypassed.
Result
On the fixed version we replay both attacks and they fail: the script shows as plain text, the injection returns nothing.
Tools
PHPMySQLBurp Suite

BEFORE / AFTER

XSS: rendering the message

vulnerableecho $msg['message'];
fixedecho nl2br(htmlspecialchars($msg['message']));
// + cookie de session en HttpOnly

SQL injection: user search

vulnerable$sql = "SELECT identifiant, adresse FROM users
        WHERE identifiant LIKE '%$q%'";
$pdo->query($sql);
fixed$stmt = $pdo->prepare('SELECT identifiant, adresse
  FROM users WHERE identifiant LIKE ?');
$stmt->execute(['%' . $q . '%']);