Im going through the beginner hackerone ctfs and Im trying to crack the Micro-CMS v2. There is a login page that is vulnerable to an SQL injection. The query goes like this:
'SELECT password FROM admins WHERE username=\'%s\'' % request.form['username'].replace('%', '%%')
In the username field I input ' UNION SELECT '123' AS password WHERE '1'='1
but then it returns this error
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE '1'='1'' at line 1")
I tried commenting it out with --' or usingg WHERE 1=1'
instead but nothing seamed to work