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

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\Intranet\C\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs\plugins\   drwxrwxrwx
Free 4.09 GB of 39.52 GB (10.35%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     function.math.php (2.43 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {math} function plugin
 *
 * Type:     function<br>
 * Name:     math<br>
 * Purpose:  handle math computations in template<br>
 * @link http://smarty.php.net/manual/en/language.function.math.php {math}
 *          (Smarty online manual)
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_math($params, &$smarty)
{
    
// be sure equation parameter is present
    
if (empty($params['equation'])) {
        
$smarty->trigger_error("math: missing equation parameter");
        return;
    }

    
$equation $params['equation'];

    
// make sure parenthesis are balanced
    
if (substr_count($equation,"(") != substr_count($equation,")")) {
        
$smarty->trigger_error("math: unbalanced parenthesis");
        return;
    }

    
// match all vars in equation, make sure all are passed
    
preg_match_all("!\!(0x)([a-zA-Z][a-zA-Z0-9_]*)!",$equation$match);
    
$allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
                           
'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
    foreach(
$match[2] as $curr_var) {
        if (!
in_array($curr_var,array_keys($params)) && !in_array($curr_var$allowed_funcs)) {
            
$smarty->trigger_error("math: parameter $curr_var not passed as argument");
            return;
        }
    }

    foreach(
$params as $key => $val) {
        if (
$key != "equation" && $key != "format" && $key != "assign") {
            
// make sure value is not empty
            
if (strlen($val)==0) {
                
$smarty->trigger_error("math: parameter $key is empty");
                return;
            }
            if (!
is_numeric($val)) {
                
$smarty->trigger_error("math: parameter $key: is not numeric");
                return;
            }
            
$equation preg_replace("/\b$key\b/",$val$equation);
        }
    }

    eval(
"\$smarty_math_result = ".$equation.";");

    if (empty(
$params['format'])) {
        if (empty(
$params['assign'])) {
            return 
$smarty_math_result;
        } else {
            
$smarty->assign($params['assign'],$smarty_math_result);
        }
    } else {
        if (empty(
$params['assign'])){
            
printf($params['format'],$smarty_math_result);
        } else {
            
$smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
        }
    }
}

/* vim: set expandtab: */

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

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