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

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/home/mnnews/public_html/phpads/   drwxr-xr-x
Free 4.04 GB of 27.03 GB (14.95%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     lib-view-direct.inc.php (4.16 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php // $Revision: 1.4 $

/************************************************************************/
/* phpAdsNew 2                                                          */
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2001 by the phpAdsNew developers                       */
/* http://sourceforge.net/projects/phpadsnew                            */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/


// Set define to prevent duplicate include
define ('LIBVIEWDIRECT_INCLUDED', true);


/*********************************************************/
/* Get a banner                                          */
/*********************************************************/

function phpAds_fetchBanner($what, $clientid, $context = 0, $source = '', $richmedia = true)
{
    global
$phpAds_config;
    
    
    
// Build preconditions
    
if (is_array ($context))
    {
        for (
$i=0; $i < count($context); $i++)
        {
            list (
$key, $value) = each($context[$i]);
            {
                switch (
$key)
                {
                    case
'!=': $contextExclusive[] = $phpAds_config['tbl_banners'].'.bannerid <> '.$value; break;
                    case
'==': $contextInclusive[] = $phpAds_config['tbl_banners'].'.bannerid = '.$value; break;
                }
            }
        }
        
        
$where_exclusive = !empty($contextExclusive) ? implode(' AND ', $contextExclusive) : '';
        
$where_inclusive = !empty($contextInclusive) ? implode(' OR ', $contextInclusive) : '';
        
        
$precondition = sprintf("$where_inclusive %s $where_exclusive", (!empty($where_inclusive) && !empty($where_exclusive)) ? 'AND' : '');
        
$precondition = trim($precondition);
        
        if (!empty(
$precondition))
            
$precondition = ' AND '.$precondition;
    }
    else
        
$precondition = '';
    
    if (
$clientid != 0)
        
$precondition .= " AND (".$phpAds_config['tbl_clients'].".clientid = $clientid OR ".$phpAds_config['tbl_clients'].".parent = $clientid) ";
    
    if (
$richmedia == false)
        
$precondition .= " AND (".$phpAds_config['tbl_banners'].".contenttype = 'jpeg' OR ".$phpAds_config['tbl_banners'].".contenttype = 'gif' OR ".$phpAds_config['tbl_banners'].".contenttype = 'png') ";
    
    
    
    
// Separate parts
    
$what_parts = explode ('|', $what);    
    
    for (
$wpc=0; $wpc < sizeof($what_parts); $wpc++)
    {
        
// Build the query needed to fetch the banners
        
$select = phpAds_buildQuery ($what_parts[$wpc], sizeof($what_parts), $precondition);
        
        
$res = phpAds_dbQuery($select);
        if (
$res)
        {
            if (
phpAds_dbNumRows($res) > 0)    
                break;    
// Found banners, continue
        
}
    }
    
    
    
    
// Build array for further processing...
    
$rows = array();
    
$prioritysum = 0;
    while (
$tmprow = phpAds_dbFetchArray($res))
    {
        
// weight of 0 disables the banner
        
if ($tmprow['priority'])
        {
            
$prioritysum += $tmprow['priority'];
            
$rows[] = $tmprow;
        }
    }
    
    
    
$maxindex = sizeof($rows);
    
    while (
$prioritysum && sizeof($rows))
    {
        
$low = 0;
        
$high = 0;
        
$ranweight = ($prioritysum > 1) ? mt_rand(0, $prioritysum - 1) : 0;
        
        for (
$i=0; $i<$maxindex; $i++)
        {
            if (
is_array($rows[$i]))
            {
                
$low = $high;
                
$high += $rows[$i]['priority'];
                
                if (
$high > $ranweight && $low <= $ranweight)
                {
                    if (
$phpAds_config['acl'])
                    {
                        if (
phpAds_aclCheck($rows[$i], $source))
                        {
                            
// ACL check passed, found banner!
                            
$rows[$i]['zoneid'] = 0;
                            return (
$rows[$i]);
                        }
                        
                        
// Matched, but phpAds_aclCheck failed.
                        // Delete this row and adjust $prioritysum
                        
$prioritysum -= $rows[$i]['priority'];
                        
$rows[$i] = '';
                        
                        
// Break out of the for loop to try again
                        
break;
                    }
                    else
                    {
                        
// Don't check ACLs, found banner!
                        
$rows[$i]['zoneid'] = 0;
                        return (
$rows[$i]);
                    }
                }
            }
        }
    }
    
    return
false;
}


?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0033 ]--