Learn · Hack Lab
Break it, then fix it
0 of 3 broken into · 0 of 3 defended
Everything here is simulated in your browser. Only ever test systems you own or are allowed to test.
Log in as admin without the password
Your goal: The login glues what you type into an SQL query. Get in as admin. You do not know the password.
What the database receives
SELECT * FROM users WHERE name = '' AND password = ''Wrong name or password.
Stuck? Think about what a single quote does to the query, and what -- means in SQL.
Make a script run in every visitor's browser
Your goal: This comment box puts your text into the page as HTML. Write a comment that would run code.
What the page sends to visitors
<div class="comment"></div>Nothing posted yet.
This box never runs anything. It only reads your text and tells you what a real browser would do with it.
Read an invoice that is not yours
Your goal: You are logged in as user 7. Your invoice is number 1001. Find someone else's.
Response
200 OK
{
"id": 1001,
"owner": 7,
"customer": "You",
"amount": "450 MAD"
}This one is yours.