!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/local/hosting/awstats/   drwxr-xr-x
Free 6182.12 GB of 6263.32 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     awstats_wrapper.php (4.15 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
ini_set
('display_errors''off');

function 
e($msg "Unable to get statistics"$code 1) {
    echo 
$msg."\n";
    exit(
$code);
}

function 
get_opt($argv$required = array()){
    
$return = array();

    foreach(
$argv as $a) {
        if (
strpos($a'--') === false) continue;

        
preg_match('/\-\-(.+)=(.+)/',$a$m);

        if (empty(
$m)) continue;

        
$return[$m[1]] = $m[2];
    }

    if (!empty(
$required)) {
        foreach(
$required as $r) {
            if (empty(
$return[$r])) return false;
        }   
    }

    return 
$return;
}


if (!
$o get_opt($argv, array('host''dirdata'))) {
    
e();
}

extract($o);

// Output parameter
if (!empty($output)) {
    
$args['output'] = "-output=" escapeshellarg($output);
} else {
    
$output 'main';
    
$args['output'] = "-output=main";
}

// Validate $year and $month
if (!empty($year) || !empty($month)) {
    
$args['year'] = "-year=" escapeshellarg($year);
    
$args['month'] = "-month=" escapeshellarg($month);
} else {
    
$args['month'] = $args['year'] = '';
}

// Staticlinks parameter
if (empty($staticlinks)) {
    
$args['staticlinks'] = "-staticlinks=" escapeshellarg("/statistics/host-web-awstats/?output=");
} else {
    
$args['staticlinks'] = escapeshellarg($staticlinks);
}


// Set env variables for awstats.pl
putenv("AWSTATS_SITE_DOMAIN={$host}");
putenv("AWSTATS_DIRDATA={$dirdata}");


// Generate the view with the awstats.pl
exec("perl /usr/local/hosting/awstats/awstats.pl -config=/usr/local/hosting/awstats/awstats.config "implode(" "$args), $view$return);
$view implode("\n"$view);


// Get available dates
exec("ls -1 $dirdata | grep -E 'awstats([0-9])+' -o | grep -E '[0-9]+' -o"$tmp_output$return);

foreach (
$tmp_output as $to) {
    
$m = (int)substr($to02);
    
$y = (int)substr($to2);

    
$available_dates[$y][] = $m;
}
krsort($available_dates);
foreach(
$available_dates as &$aarsort($a);


ob_start();
?>
<style type='text/css'>
    body { padding-top: 40px; }
    .awstats_date_select{
        text-align:center;
        position:absolute;
        top:20px;
    }
    .awstats_date_select label { font-weight:bold; }
</style>
<?
$css 
ob_get_contents();
ob_end_clean();

// Check for the file
if ($month != 'all' && !file_exists($dirdata "/awstats".date('m'mktime(000$month))."{$year}.txt")) {
    
//$no_data_warning = "No statistics found for " . date("F", mktime(0, 0, 0, $month)). " $year";
    
echo "<p style=\"color: #F8B403\">No statistics found for " date("F"mktime(000$month)). $year</p>";
}
?>

<?php
$currently_selected 
= (empty($month) ? date('n') : $month) . "_" . (empty($year) ? date('Y') : $year);
ob_start();
?>

<form style="left:10px;" action="" method="GET" class="awstats_date_select">
    <label for="month_year">Monthly reports:</label>
    <select name="month_year" id="month_year">
        <?php foreach($available_dates as $y => $months){ foreach($months as $m) {?>

        <option <?php if ($currently_selected == "{$m}_{$y}") echo "selected='selected' ";?>value="<?="{$m}_{$y}";?>"><?=date("F"mktime(000$m))." ".$y;?></option>

        <?php }} ?>
    </select>
    <input type="hidden" name="host" value="<?=trim($host,"'");?>" />
    <input type="hidden" name="output" value="<?=$output;?>" />
    <input type="submit" value="Show" />
</form>

<form style="right:10px;" action="" method="GET" class="awstats_date_select">
    <label for="year">Yearly reports:</label>
    <select name="year" id="year">
        <?php foreach(array_keys($available_dates) as $y): ?>

        <option <?php if (!empty($year) && $year == $y) echo "selected='selected' ";?>value="<?=$y;?>"><?=$y;?></option>

        <?php endforeach; ?>
    </select>
    <input type="hidden" name="month" value="all" />
    <input type="hidden" name="host" value="<?=trim($host,"'");?>" />
    <input type="hidden" name="output" value="<?=$output;?>" />
    <input type="submit" value="Show" />
</form>

<?php
$form 
ob_get_contents();
ob_end_clean();

$view str_replace("</head>"$css "\n</head>\n"$view);
$view preg_replace("/<body (.+)>/""<body $1>\n{$form}\n"$view);
//$view = str_replace("</body>", "{$form}\n</body>\n", $view);

$append_to_url "&host=$host";
if (!empty(
$month)) $append_to_url .= "&month=$month";
if (!empty(
$year)) $append_to_url .= "&year=$year";

$view preg_replace('/\?output=\.([A-Za-z0-9]+)\.html/','?output=\1'.$append_to_url$view);

echo 
$view;

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0116 ]--