!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/admin/pages/comments/   drwxr-xr-x
Free 50.92 GB of 127.8 GB (39.84%)
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 (10.34 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/********************************************************************************
    - MemHT Portal -
    
    Copyright (C) 2007-2008 by Miltenovik Manojlo
    http://www.memht.com
    
    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, or
    (at your opinion) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License along
    with this program; if not, see <http://www.gnu.org/licenses/> (GPLv2)
    or write to the Free Software Foundation, Inc., 51 Franklin Street,
    Fifth Floor, Boston, MA02110-1301, USA.
        
********************************************************************************/

if (!defined("_LOAD_PAGE_")) {
    die(
"<table style='padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;' align='center'><tr><td><b>Error:</b> This file cannot be opened directly!</td></tr></table>");
}

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

function 
commentsList() {
    global 
$dblink,$siteConfig;
    
    echo 
"<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center' class='std_nicetable'>\n";
    echo 
"<thead>\n";
    echo 
"<tr><td colspan='7'>"._COMMENTSWAITINGMODERATION_."</td></tr>";
    echo 
"<tr><td>"._NAME_."</td><td>"._EMAIL_."</td><td>"._DATE_."</td><td>"._PAGE_."</td><td>"._LEVEL_."</td><td width='1%'>&nbsp;</td><td width='1%'>&nbsp;</td></tr>";
    echo 
"</thead>\n";
    echo 
"<tbody>\n";
    if (
$result $dblink->get_list("SELECT *,DATE_FORMAT(date, '".$siteConfig['timestamp']."') as dateout FROM memht_comments WHERE moderate=1 AND whr<8 ORDER BY date")) {
        
$n 0;
        foreach (
$result as $row) {
            
$id intval($row['id']);
            
$whr intval($row['whr']);
            
$wid intval($row['wid']);
            
$name outCode($row['name']);
            
$email outCode($row['email']);
            
$text censure(outCode($row['text'],0));
            
$guest intval($row['guest']);
            
$date outCode($row['dateout']);
            
$ip outCode($row['ip']);
                        
            switch (
$whr) {
                case 
1:
                    
$whrpg "articles";
                    
$irow $dblink->get_row("SELECT nome FROM memht_articoli WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=articles&op=readArticle&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
2:
                    
$whrpg "guide";
                    
$irow $dblink->get_row("SELECT nome FROM memht_guide WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=guide&op=readGuide&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
3:
                    
$whrpg "news";
                    
$irow $dblink->get_row("SELECT nome FROM memht_news WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=news&op=readNews&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
4:
                    
$whrpg "download";
                    
$irow $dblink->get_row("SELECT nome FROM memht_download WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=download&op=getFile&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
5:
                    
$whrpg "blog";
                    
$row $dblink->get_row("SELECT title FROM memht_blog_posts WHERE id=$wid");
                    
$whritem  outCode($row['title']);
                    
$whrlink "index.php?page=blog&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
6:
                    
$whrpg "surveys";
                    
$irow $dblink->get_row("SELECT question FROM memht_survey WHERE id=$wid");
                    
$whritem trimString(outCode($irow['question']),40,1);
                    
$whrlink "index.php?page=surveys&op=result&id=$wid#comments";
                break;
            }
            
$prow $dblink->get_row("SELECT titolo FROM memht_pagine WHERE nome='$whrpg'");
            
$whrname outCode($prow['titolo']);
                        
            
$guest = ($guest==1) ? _GUEST_ _USER_ ;
                        
            
$class = (($n++%2)!=0) ? "hlight" "clean" ;
            echo 
"<tr>";
            
            
$text str_replace("[","{",$text);
            
$text str_replace("]","}",$text);
                        
            echo 
"<td class='$class' width='20%'><b>$name</b></td>";
            echo 
"<td class='$class' width='25%'>$email</td>";
            echo 
"<td class='$class' width='20%'>$date</td>";
            echo 
"<td class='$class' width='15%'>$whrname <a href='$whrlink' title=\"header=[$whrname] body=[$whritem]\"><img src='images/info.gif' alt='Info' border='0'></a></td>";
            echo 
"<td class='$class' width='10%'>$guest</td>";
            echo 
"<td class='$class' width='1%'><img src='images/documents.gif' alt='Documents' border='0' title=\"header=["._COMMENT_."] body=[$text]\"></td>";
            echo 
"<td class='$class' width='1%'>";
                echo 
"<select onChange='location = this.options[this.selectedIndex].value;' style='font-size:9px; border:0;' class='$class'>";
                    echo 
"<option value='' selected>-- "._APPROVE_." --</option>\n";
                    echo 
"<option value='admin.php?page=comments&op=approvation&id=$id&decision=1' style='font-weight:bold; color:green;'>"._YES_."</option>\n";
                    echo 
"<option value='admin.php?page=comments&op=approvation&id=$id&decision=0' style='font-weight:bold; color:red;'>"._NO_."</option>\n";
                echo 
"</select>\n";
            echo 
"</td>";
    
            echo 
"</tr>\n";
        }
    } else {
        echo 
"<tr><td align='center' id='errorText' colspan='7' class='clean'><b>"._EMPTY_."</b></td></tr>";
    }
    echo 
"</tbody>\n";
    echo 
"</table>\n";
    echo 
"<br>";
    
    echo 
"<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center' class='std_nicetable'>\n";
    echo 
"<thead>\n";
    echo 
"<tr><td colspan='6'><b>"._LAST_." 30</b></td></tr>";
    echo 
"<tr><td>"._NAME_."</td><td>"._EMAIL_."</td><td>"._DATE_."</td><td>"._PAGE_."</td><td>"._LEVEL_."</td><td width='1%'>&nbsp;</td></tr>";
    echo 
"</thead>\n";
    echo 
"<tbody>\n";
    if (
$result $dblink->get_list("SELECT *,DATE_FORMAT(date, '".$siteConfig['timestamp']."') as dateout FROM memht_comments WHERE moderate=0 AND whr<8 ORDER BY date DESC LIMIT 30")) {
        
$n 0;
        foreach (
$result as $row) {
            
$id intval($row['id']);
            
$whr intval($row['whr']);
            
$wid intval($row['wid']);
            
$name outCode($row['name']);
            
$email outCode($row['email']);
            
$text censure(outCode($row['text'],0));
            
$guest intval($row['guest']);
            
$date outCode($row['dateout']);
            
$ip outCode($row['ip']);
                        
            switch (
$whr) {
                case 
1:
                    
$whrpg "articles";
                    
$irow $dblink->get_row("SELECT nome FROM memht_articoli WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=articles&op=readArticle&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
2:
                    
$whrpg "guide";
                    
$irow $dblink->get_row("SELECT nome FROM memht_guide WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=guide&op=readGuide&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
3:
                    
$whrpg "news";
                    
$irow $dblink->get_row("SELECT nome FROM memht_news WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=news&op=readNews&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
4:
                    
$whrpg "download";
                    
$irow $dblink->get_row("SELECT nome FROM memht_download WHERE id=$wid");
                    
$whritem outCode($irow['nome']);
                    
$whrlink "index.php?page=download&op=getFile&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
5:
                    
$whrpg "blog";
                    
$row $dblink->get_row("SELECT title FROM memht_blog_posts WHERE id=$wid");
                    
$whritem  outCode($row['title']);
                    
$whrlink "index.php?page=blog&id=$wid&title=".mem_urlencode($whritem);
                break;
                case 
6:
                    
$whrpg "surveys";
                    
$irow $dblink->get_row("SELECT question FROM memht_survey WHERE id=$wid");
                    
$whritem trimString(outCode($irow['question']),40,1);
                    
$whrlink "index.php?page=surveys&op=result&id=$wid#comments";
                break;
            }
            
$prow $dblink->get_row("SELECT titolo FROM memht_pagine WHERE nome='$whrpg'");
            
$whrname outCode($prow['titolo']);
                        
            
$guest = ($guest==1) ? _GUEST_ _USER_ ;
                        
            
$class = (($n++%2)!=0) ? "hlight" "clean" ;
            echo 
"<tr>";
                        
            echo 
"<td class='$class' width='20%'><b>$name</b></td>";
            echo 
"<td class='$class' width='25%'>$email</td>";
            echo 
"<td class='$class' width='20%'>$date</td>";
            echo 
"<td class='$class' width='15%'>$whrname <a href='$whrlink' title=\"header=[$whrname] body=[$whritem]\"><img src='images/info.gif' alt='Info' border='0'></a></td>";
            echo 
"<td class='$class' width='10%'>$guest</td>";
            
$text str_replace("[","{",$text);
            
$text str_replace("]","}",$text);
            echo 
"<td class='$class' width='1%'><img src='images/documents.gif' alt='Documents' border='0' title=\"header=["._COMMENT_."] body=[$text]\"></td>";
    
            echo 
"</tr>\n";
        }
    } else {
        echo 
"<tr><td align='center' id='errorText' colspan='6' class='clean'><b>"._EMPTY_."</b></td></tr>";
    }
    echo 
"</tbody>\n";
    echo 
"</table>\n";
}

function 
approveWaitingComments($id,$decision) {
    global 
$dblink;
    
$id intval($id);
    
    if (
$dblink->get_num("SELECT id FROM memht_comments WHERE id=$id AND moderate=1")>0) {
        if (
$decision==1) {
            
$dblink->query("UPDATE memht_comments SET moderate=0 WHERE id=$id AND moderate=1");
            echo 
"<div align='center'><b>"._APPROVED_."</b></div>";
        } else {
            
$dblink->query("DELETE FROM memht_comments WHERE id=$id AND moderate=1");
            echo 
"<div align='center'><b>"._DELETED_."</b></div>";
        }
        echo 
"<meta http-equiv='refresh' content='0;URL=admin.php?page=comments'>";
    }
}

require_once(
"admin/inc/inc_header.php");
    
admin_page_title($page);
                                    
    
openTable();
        echo 
"<div align='center' class='box'>";
            echo 
"<a href='admin.php?page=comments' title='"._LIST_."'><img src='admin/icons/messages.png' border='0' title='"._LIST_."' align='top'> "._LIST_."</a>";
        echo 
"</div>";
    
closeTable();
    
    
openTable();
    
        switch(
$op) {            
            case 
"approvation":
                
approveWaitingComments($id,$decision);
            break;
        
            case 
"showComments":
            default:
                
commentsList();
            break;
        }
    
    
closeTable();
require_once(
"admin/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.0203 ]--