!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/   drwxrwxrwx
Free 51.24 GB of 127.8 GB (40.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     sitemap.php (11.32 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.
        
********************************************************************************/

header("Content-Type: text/xml");

//===========================================
//Database: Connect
//===========================================
require_once("inc/inc_config.php");
require_once(
"inc/inc_database.php");

$dblink = new database();
$dblink->connect();

//===========================================
//TIMEZONE SETTING + DATABASE CHECK
//===========================================
$timezonerow $dblink->get_row("SELECT timezone FROM memht_config") or die("<table style='padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;' align='center'><tr><td><b>Attention:</b> Cannot find database tables!</td></tr></table>");
$siteConfig['timezone'] = intval($timezonerow['timezone']);
$tzNOW "DATE_ADD(NOW(),INTERVAL ".$siteConfig['timezone']." HOUR)";

require_once(
"inc/inc_login.php");
require_once(
"inc/inc_functions.php");
require_once(
"inc/inc_readConfig.php");
require_once(
"inc/inc_getinfo.php");
require_once(
"inc/inc_ban.php");

if (
file_exists("lang/".$siteConfig['language'].".php")) {
    include_once(
"lang/".$siteConfig['language'].".php");
} else {
    include_once(
"lang/".$siteConfig['default_language'].".php");
}

if (!
defined("_LANG_CHARSET_")) { define("_LANG_CHARSET_","utf-8"); }

$now date(Y."-".m."-".d);

echo 
"<?xml version=\"1.0\" encoding=\""._LANG_CHARSET_."\"?>\n";
echo 
"<?xml-stylesheet type=\"text/xsl\" href=\"sitemap.xsl\"?>\n";
echo 
"<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/09/sitemap.xsd\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
//===========================================

//Index
echo "<url>\n";
    if (
$siteConfig['modrewrite']) { echo "<loc>".$siteConfig['site_url']."/index.html</loc>\n"; } else { echo "<loc>".$siteConfig['site_url']."/index.php</loc>\n"; }
    echo 
"<lastmod>$now</lastmod>\n";
    echo 
"<changefreq>daily</changefreq>\n";
    echo 
"<priority>1.0</priority>\n";
echo 
"</url>\n";

$pages $dblink->get_list("SELECT * FROM memht_pagine WHERE enabled=1 AND rank=0 ORDER BY nome");
foreach (
$pages as $prow) {
    
$page outCode($prow['nome']);
    
    if (!
stristr("banners",$page) AND !stristr("error",$page) AND !stristr("messages",$page) AND !stristr("submission",$page)) {
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/$page.html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=$page</loc>\n";
            }
            echo 
"<lastmod>$now</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.5</priority>\n";
        echo 
"</url>\n";
        
        switch (
$page) {
            case 
"articles":
                
articles();
            break;
            case 
"blog":
                
blog();
            break;
            case 
"download":
                
download();
            break;
            case 
"faq":
                
faq();
            break;
            case 
"forum":
                
forum();
            break;
            case 
"guide":
                
guide();
            break;
            case 
"mypage":
                
mypage();
            break;
            case 
"news":
                
news();
            break;
        }
    }
}

if (
$siteConfig['virtualpages']==1) {
    
$result $dblink->get_list("SELECT name,title FROM memht_virtualpages WHERE enabled=1 AND rank=0 ORDER BY title");
    foreach (
$result as $row) {
        
$name outCode($row['name']);
        
$title outCode($row['title']);
        
        echo 
"<url>\n";
            echo 
"<loc>".$siteConfig['site_url']."/index.php?page=$name</loc>\n";
            echo 
"<lastmod>$now</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.5</priority>\n";
        echo 
"</url>\n";
    }
}

//Articles
function articles() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(data,'%Y-%m-%d') as date FROM memht_articoli WHERE enabled=1 ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$id intval($row['id']);
        
$name outCode($row['nome']);
        
$date $row['date'];
        if (
$date=="0000-00-00") { $date $now; }
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/articles_{$id}_".mem_urlencode($name).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=articles&amp;op=readArticle&amp;id=$id&amp;title=".mem_urlencode($name)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.8</priority>\n";
        echo 
"</url>\n";
    }
}

//Blog
function blog() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(date,'%Y-%m-%d') as date FROM memht_blog_posts WHERE enabled=1 ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$id intval($row['id']);
        
$title outCode($row['title']);
        
$date $row['date'];
        if (
$date=="0000-00-00") { $date $now; }
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/blog_view_{$id}_".mem_urlencode($title).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=blog&amp;id=$id&amp;title=".mem_urlencode($title)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.8</priority>\n";
        echo 
"</url>\n";
    }
}

//Download
function download() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(data,'%Y-%m-%d') as date FROM memht_download ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$date $row['date'];
        
$id intval($row['id']);
        
$name outCode($row['nome']);
        if (
$date=="0000-00-00") { $date $now; }
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/download_file_{$id}_".mem_urlencode($name).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=download&amp;op=getFile&amp;id=$id&amp;title=".mem_urlencode($name)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.8</priority>\n";
        echo 
"</url>\n";
    }
}

//Faq
function faq() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT id FROM memht_faq ORDER BY id DESC LIMIT 500");
    foreach (
$result as $row) {
        
$id intval($row['id']);
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/faq_$id.html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=faq&amp;op=read&amp;id=$id</loc>\n";
            }
            echo 
"<lastmod>$now</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.7</priority>\n";
        echo 
"</url>\n";
    }
}

//Forum
function forum() {
    global 
$siteConfig,$dblink,$now;
    
    require_once(
"pages/forum/inc_functions.php");
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(date,'%Y-%m-%d') as date FROM memht_forum_posts WHERE parent=0 ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$threadid intval($row['id']);
        
$thname outCode($row['name']);
        
$forum intval($row['forum']);
        
$date $row['date'];
        
        if (
$siteConfig['modrewrite']) {
            
$link "forum_thread_{$threadid}_".mem_urlencode($thname).".html";
        } else {
            
$link "index.php?page=forum&amp;op=viewThread&amp;id=$threadid&amp;title=".mem_urlencode($thname);
        }            
        
        if (
isAuthorized($forum,"view") AND isAuthorized($forum,"read")) {
            echo 
"<url>\n";
                echo 
"<loc>".$siteConfig['site_url']."/$link</loc>\n";
                echo (
$date!="0000-00-00") ? "<lastmod>$date</lastmod>\n" "" ;
                echo 
"<changefreq>daily</changefreq>\n";
                echo 
"<priority>0.6</priority>\n";
            echo 
"</url>\n";
        }
    }
}

//Guide
function guide() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(data,'%Y-%m-%d') as date FROM memht_guide WHERE enabled=1 ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$id intval($row['id']);
        
$name outCode($row['nome']);
        
$date $row['date'];
        if (
$date=="0000-00-00") { $date $now; }
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/guide_{$id}_".mem_urlencode($name).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=guide&amp;op=readGuide&amp;id=$id&amp;title=".mem_urlencode($name)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.8</priority>\n";
        echo 
"</url>\n";
    }
}

//MyPage
function mypage() {
    global 
$siteConfig,$dblink,$now;
    
    
$myrank myRank();
    
$result $dblink->get_list("SELECT id,title,DATE_FORMAT(date,'%Y-%m-%d') as date FROM memht_mypage WHERE public=1 AND enabled=1 AND rank<=$myrank ORDER BY id LIMIT 200");
    foreach (
$result as $row) {
        
$id intval($row['id']);
        
$title outCode($row['title']);
        
$date $row['date'];
        if (
$date=="0000-00-00") { $date $now; }
        
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/mypage_{$id}_".mem_urlencode($title).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=mypage&amp;op=openPage&amp;id=$id&amp;title=".mem_urlencode($title)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.6</priority>\n";
        echo 
"</url>\n";
    }
}

//News
function news() {
    global 
$siteConfig,$dblink,$now;
    
    
$result $dblink->get_list("SELECT *,DATE_FORMAT(data,'%Y-%m-%d') as date FROM memht_news WHERE enabled=1 ORDER BY id DESC LIMIT 200");
    foreach (
$result as $row) {
        
$id intval($row['id']);
        
$name outCode($row['nome']);
        
$date $row['date'];
        if (
$date=="0000-00-00") { $date $now; }
                
        echo 
"<url>\n";
            if (
$siteConfig['modrewrite']) {
                echo 
"<loc>".$siteConfig['site_url']."/news_{$id}_".mem_urlencode($name).".html</loc>\n";
            } else {
                echo 
"<loc>".$siteConfig['site_url']."/index.php?page=news&amp;op=readNews&amp;id=$id&amp;title=".mem_urlencode($name)."</loc>\n";
            }
            echo 
"<lastmod>$date</lastmod>\n";
            echo 
"<changefreq>weekly</changefreq>\n";
            echo 
"<priority>0.9</priority>\n";
        echo 
"</url>\n";
    }
}

//===========================================
echo "</urlset>\n";

//===========================================
//Database: Disconnect
//===========================================
$dblink->disconnect();

?>

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