
20.05.2009, 15:40
|
|
Постоянный
Регистрация: 11.03.2008
Сообщений: 347
Провел на форуме: 2075230
Репутация:
462
|
|
URL dumper
а так?
Код:
<form method=GET>
<input type=text name=q value="">
<input type=submit name=submit value="Поиск">
</form>
<?php
If(isset($_GET['q']))
{
$s=file_get_contents("http://www.google.com/search?q=".$_GET['q']."&num=100");
$preg='#\"(http://)[a-z\.]+\/*[\S]+\"#';
$p=preg_match_all($preg,$s,$ar,PREG_SET_ORDER); ;
for($i=0;$i<$p-1;$i++)
{
If(!strchr($ar[$i][0],"google"))
{
$ar[$i][0]=str_replace('"',"",$ar[$i][0]);
echo $ar[$i][0]."<br>";
}
}
}
?>
или перловый. только на сокетах
Код:
#! /usr/bin/perl
# ===::: google parser v0.8 :::===
# (c)oded by drmist\STNC
# www.security-teams.net
use IO::Socket::INET;
$server = "google.com";
$port = 80;
$count = 0;
$search = "";
@found = ();
@dn = ();
if((@ARGV < 2)||(@ARGV > 8)||(@ARGV % 2 > 0)) { usage(); exit; }
$i = 0;
while($i < @ARGV)
{
if($ARGV[$i] eq "-s"){ $server = $ARGV[$i+1]; }
elsif($ARGV[$i] eq "-p"){ $port = $ARGV[$i+1]; }
elsif($ARGV[$i] eq "-r"){ $search = $ARGV[$i+1]; }
elsif($ARGV[$i] eq "-n"){ $count = $ARGV[$i+1]; }
else { print "Invalid key: ".$ARGV[$i]."\n"; exit; }
$i += 2;
}
if($search eq ""){ usage(); exit; }
$search =~ s/(.)/sprintf("%%%02x",ord($1))/eg;
if($server !~ /:[0-9]{2,5}$/){$server.=":$port";}
for($i = 0; $i < 10; $i++)
{
@temp = get_request($server,"search?filter=0&num=100&start=".$i.
"00&q=$search") =~ /(https?\:\/\/[a-z0-9\.\-\/\?\:\&\%\=\_]{5,})/gi;
$a = 0;
foreach $url (@temp)
{
if($url =~ /https?\:\/\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/search\?q=cache:/i){ next; }
($domain) = $url =~ /^https?\:\/\/([a-z0-9\.\-]{5,})/i;
$f=0;foreach(@dn){if($_ eq $domain){$f++;last;}}if($f){next;}
push(@found, $url);
if($count){if(!--$count){$a++;last;}}
push(@dn,$domain);
}
if($a){last;}
}
foreach(@found){print "$_\n";}
sub get_request()
{
local $sock;
local $data = "";
local($server, $url) = ($_[0], $_[1]);
$sock = IO::Socket::INET->new($server) or return -2; # connection failed
print $sock "GET /$url HTTP/1.0\r\n\r\n";
while(<$sock>){$data .= $_;}
close $sock;
return $data;
}
sub usage()
{
print qq(
drmist's google parser v 0.8
usage: gparse.pl [-s <server>] [-p <port>] -r <request> [-n <number>]
<server> google server, default: google.com
<port> http-server port, default: 80
<requets> search request
<number> number of links, that will be shown, default: all
examples:
perl gparse.pl -r 'filetype:php inurl:page=' | grep page=
perl gparse.pl -s google.ru:80 -r 'Powered by phpbb' -n 10
perl gparse.pl -s google.ru -p 80 -r 'site:com inurl:backup.sql'
perl gparse.pl -s google.de -r 'inurl:seite=' -n 400
for more information visit www.security-teams.net
);
}
|
|
|