Just recently our client got their site tested by the penetration tests company and in report it states that in some form on some field there could be a SQL injection performed. They only state the DB server version and a few of tables they have found.
I tried to perform the SQL injection on that field so hard but I cannot get a relevant result. The problem with SQL injection on that field is I guess:
- field is validated by AJAX on blur
- field has a JS validation and the input could only be a number (any other char is stripped)
- the field's AJAX validation asks DB using SQL whether the value could be find while returning 1 if yes or false if not (simple
SELECT 1 FROM table WHERE column = '{$value}') - the validation method then returns true or an error message and this is returned to the form in JSON format
Because of all this I do not know how to perform a SQL injection that would return some data... I know I could do an insert, update, delete queries, so there is SQL injection indeed, but how to retrieve some data from select query using this field and its validation method???
HEY GUYS! I am not asking "is there any SQL injection?" or "Is SQL injection a bad thing?" - I know there is SQL injection and I know it is mega bad, but my question is HOW CAN I PERFORM SQL INJECTION THAT WOULD RETRIEVE ANY DATA while You know the conditions above...
Those comments under are useless...
$value = "foo' OR '1'='1"bad enough?