Cowherders 1¶
-
This is clearly vulnerable to SQLi:
python def check_auth(username, password): res = db.execute(f"SELECT * FROM users WHERE username = '{username}' AND password = '{password}'") user = res.fetchone() return user['username'] != NoneGo to
/loginand enter:text username: bigger_baron password: ' OR '1'='1 -
Go to
/transferand transfer 50 cows to "farmers" - Log into "farmers" account. Now we have 52 cows, which satisfies the condition for flag
- Go to
/check_cowsto claim the flag