
18.06.2013, 13:15
|
|
Новичок
Регистрация: 03.08.2009
Сообщений: 23
С нами:
8827377
Репутация:
-5
|
|
Есть сайт с уязвимым полем &id=5151
Ставлю в конце ковычку одинарную &id= 5151' - вот что получаю в ответ:
MySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '')' at line 1
Query: SELECT `id`, `name`, `uniqum`, `image`, `catsID` FROM `ap_products` WHERE `enable`=1 AND `id` IN(0, 5151')
Есть исходный код данного участка кода:
PHP код:
[COLOR="#000000"][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]'SELECT `id`, `name`, `uniqum`, `image`, `catsID`,`in_stock`,`cant_buy` FROM `'[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]$DB_prefix[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#DD0000"]'products` WHERE `enable`=1 AND `id` IN (0,'[/COLOR][COLOR="#007700"];
foreach([/COLOR][COLOR="#0000BB"]$Basket[/COLOR][COLOR="#007700"]AS[/COLOR][COLOR="#0000BB"]$code[/COLOR][COLOR="#007700"]=>[/COLOR][COLOR="#0000BB"]$bskt[/COLOR][COLOR="#007700"])
[/COLOR][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"].=[/COLOR][COLOR="#0000BB"]$code[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#DD0000"]','[/COLOR][COLOR="#007700"];
[/COLOR][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]substr[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]0[/COLOR][COLOR="#007700"],-[/COLOR][COLOR="#0000BB"]1[/COLOR][COLOR="#007700"]).[/COLOR][COLOR="#DD0000"]')'[/COLOR][COLOR="#007700"];
[/COLOR][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]query[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$sql[/COLOR][COLOR="#007700"]);[/COLOR][/COLOR]
Подскажите, как правильно составить запрос, чтобы выполнилась скуль?
|
|
|