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


Viewing file:     ImportPsExcel.php (16.85 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
set_time_limit
(0);
include_once 
"template.php";
include_once 
"../class/clsTable.php";
include_once 
"../class/clsDepartment.php";
include_once 
"../class/clsPerson.php";
include_once 
"../link/function.php";
include_once 
"../class/clsUmuser.php";

$oUs = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_UMS'], $GLOBALS['DBUSER_UMS'], $GLOBALS['DBPASS_UMS']);
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

$oDP = new Department($oC);
$oDP2 = new Department($oC);
$oDP3 = new Department($oC);
$oPS = new person($oC);
$oUms= new umuser($oUs);
$oUms2= new umuser($oUs);

$oPS->RSperson();
if(
$oPS->GetRecord()=="0"){
    
$chk=0;
}else{
    
$chk=1;
}

?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="../source/style.css" rel="stylesheet" type="text/css"><br>
<table  width=703  align="center">
<tr><td>
<fieldset>
      <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="ImportPsExcel.php">นำข้อมูลเข้า</a>
      <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle">นำข้อมูลเข้าจาก excel</font></legend>
     
<?php
                
if($c!="3" && $success!="1"){
                                if(
$c=="1") {
                                    echo 
'<script LANGUAGE="JavaScript"> alert("ไฟล์ที่อัพโหลดมีขนาดใหญ่เกินไป !!") </script>';
                                }
                                else if(
$c=="2") {
                                    echo 
'<script LANGUAGE="JavaScript"> alert("ไฟล์ที่อัพโหลดไม่ใช่ .csv !!") </script>';
                                }
?>           
                 <form name="ff" method="post" enctype="multipart/form-data" action="processuploadfile.php">    
                
        <table width="95%" border="0" cellspacing="1" cellpadding="1" bordercolor="<?php echo $GLOBALS["COLOR_BORDER_TABLE_1"];?>" align="center">
          <tr> 
            <td colspan="2"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><b>1. 
              ดาวน์โหลดแฟ้มข้อมูล เพื่อกรอกข้อมูล</b></font></td>
          </tr>
          <tr> 
            <td colspan="2"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ดาวน์โหลดแฟ้มตัวอย่าง 
              <a href="uploadfile/templete.csv" target="_top">[คลิกที่นี่]</a></font></td>
          </tr>
          <tr> 
            <td colspan="2"><br>
              <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>ตัวอย่างการกรอกแฟ้มข้อมูล</b></font></td>
          </tr>
          <tr> 
            <td colspan="2" align="center"><br>
              <img src="../img/picaddperson.gif" border="1"></td>
          </tr>
          <tr> 
            <td width="315" align="right" valign="top"><br>
            <table width="184"  border="0" cellpadding="1" cellspacing="1" bgcolor="silver">
                <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>">
                <td colspan="2" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ข้อมูลคำนำหน้าชื่อ</b></font></td>
                </tr>
                <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_14"];?>">
                <td width="79" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>คำนำหน้าชื่อ</b></font></td>
                <td width="106" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>คำนำหน้าชื่อ</b></font></td>
                </tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_5"]; ?>><td align="center">1</td><td align="center">นาย</td></tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_11"]; ?>><td align="center">2</td><td align="center">นางสาว</td></tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_5"]; ?>><td align="center">3</td><td align="center">นาง</td></tr>
            </table>
            </td>
            <td width="328" valign="top"><br>
            <table width="246"  border="0" cellpadding="1" cellspacing="1" bgcolor="silver">
                <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>">
                <td colspan="2" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ข้อมูลหน่วยงาน</b></font></td>
                </tr>
                <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_14"];?>">
                <td width="74" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>หน่วยงาน</b></font></td>
                <td width="252" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อหน่วยงาน</b></font></td>
                </tr>
                <? 
                $i
=0;
                
$oDP->RSDeptByMaxdeptDate();
                while(
$oDP->GetRecord()){
                                    if((
$i%2) == 0)
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">"
                                    else
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">"
                    
?>
                        <td width="74" align="center"><? echo $oDP->deptId?></b></td>
                        <td width="252" align="left"><? echo $oDP->deptName?></td>
                        </tr>
                <? $i++; }?>
            </table></td>
          </tr>
          <tr> 
            <td colspan="2">
              <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><b>2. 
              อัพโหลดแฟ้มข้อมูล</b></font></td>
          </tr>
          <tr> 
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr> 
            <td colspan="2"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>แฟ้มข้อมูล</b></font> 
              <input type="file" name="uploadfile"> <input type="hidden" name="method" value="upload_file"> 
              <input type="submit" name="send" value="อัพโหลด" onClick="return checkFormat('<? echo $chk?>')"> 
            </td>
          </tr>
          <tr> 
            <td colspan="2">&nbsp;</td>
          </tr>
        </table>
      </form>
                
                                
<?php
                
}else{
                    if(
$success!="1"){
                            echo 
'<script LANGUAGE="JavaScript"> alert("ได้รับไฟล์แล้ว ชื่อ '.$n.' ขนาด '.$s.' ไบต์")</script>';
?>    
         <form name="ff2" method="post" enctype="multipart/form-data" action="processaddpersonex.php">
           <?   //--------------------------------------------check login ซ้ำ
                      
$UPath='uploadfile/'.$n;    
                    
$fp fopen($UPath"r");
                    
$j 0;
                    
$cnt=0;
                    while(!
feof($fp)) {                        
                            
$char fgets($fp);
                            list(
$prefixId$name$surname$deptId,$loginname,$adminId,$hireId) = split('[,]'$char); 
                                            
$loginname=strtolower(rtrim($loginname));        
                            if(
$prefixId!="" && $name!="" && $surname!="" && $deptId!="" && $loginname!="" && $adminId!="" && $hireId!=""){                                    
                                    
$aPerson[$j] = array("N"=>$loginname);
                                     for (
$k0$k<$j$k++) {
                                         if(
$aPerson[$k]["N"]==$loginname){
                                            
$aPerson2[$cnt]["C"]=$loginname;
                                            
$cnt++;
                                        }
                                     }
                            
$j++;
                            }
                    }
                  
//-----------------------------------------------------------------------------------------------
        
?>
        <table width="680" border="0" cellspacing="1" cellpadding="1"  align="center">
             <tr bgcolor="#FFFFFF">
                    <td colspan="6"><b>ข้อมูลจากแฟ้ม <? echo $n?></b>&nbsp;
                    
                    <? if($cnt==0){ ?>
                    <input type="submit" name="send2" value="บันทึกข้อมูล" onClick="return checkFormat2('<? echo $chk?>')">
                    <input type="hidden" name="method" value="addperson">
                    <input type="hidden" name="filename" value="<? echo $n;?>">
                    <?  }else{ ?><br><font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>มีชื่อผู้ใช้(Login) ซ้ำ กรุณากลับไปแก้ไขแฟ้ม และทำการอัพโหลดแฟ้มใหม่</b></font><? }?>
                    <input name="Button" type="button"  value="ยกเลิก" onClick=" location.href = 'ImportPsExcel.php'">
                    </td>
        </tr>
        
        </table><br>    
        <table width="90%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="silver">
          <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>"> 
            <td width="5%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>#</b></font></td>
            <td width="10%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>
              คำนำหน้า<br>ชื่อ</b></font></td>
            <td width="23%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อ</b></font></td>
           
            <td width="22%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>นามสกุล</b></font></td>
            
            <td  width="10%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>
              หน่วยงาน</b></font></td>
            <td width="20%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อผู้ใช้<br>
              (Login)</b></font></td>
          </tr>
          <?
     
                                    $UPath
='uploadfile/'.$n;    
                                    
$fp fopen($UPath"r");
                                    
$i 0;
                                    
                                    while(!
feof($fp)) {
                                    
$mark=0;                        
                                            
$char fgets($fp);
                                            list(
$prefixId$name$surname$deptId,$loginname,$adminId,$hireId) = split('[,]'$char);
                                            
$prefixId rtrim($prefixId);
                                            
$name rtrim($name);
                                            
$surname rtrim($surname);
                                            
$deptIdrtrim($deptId);  
                                            
$loginname=strtolower(rtrim($loginname));
                                            
$adminId rtrim($adminId);
                                            
$hireIdrtrim($hireId);  
                                            
                    if(
$prefixId!="" && $name!=""  && $surname!=""  && $deptId!="" && $loginname!=""  && $adminId!="" && $hireId!=""){
                                    if((
$i%2) == 0)
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">"
                                    else
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">"
                                          
                                    
                        
 
?>
            <td  align="center"><? echo $i+1?></td>
            <td align="center">&nbsp;<? echo $prefixId?></td>
            <td align="left">&nbsp;<? echo $name?></td>
            <td  align="left">&nbsp;<? echo $surname?></td>
            <td align="center">&nbsp;<? echo $deptId?></td>
            <?                     //     echo "+++++++++++++++++++++++++++++++++++++<br>";
                                         
for ($y 0$y<$cnt$y++) {
                                        
                                                
//    echo "person=".$aPerson2[$y]["C"]." &nbsp;&nbsp;login=".$loginname."result==".strcmp($aPerson2[$y]["C"],$loginname)."<br>";
                                              
if(strcmp($aPerson2[$y]["C"],$loginname)=="0"){        
                                                        
$mark++;
                                              }
                                          }
                                
              
?>
            <td  align="left"> 
              <? if($mark!=0){ ?>
              <font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b><? echo $loginname?></b></font> 
              <?   }else{    echo $loginname;  }?>
            </td>
          </tr>
          <? $i++;          }}  

                    if(
$i == 0) {        
?>
          <tr bgcolor="#FFFFFF"> 
            <td align="center" height="22" colspan="14"><font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2">** 
              ไม่ปรากฏข้อมูลบุคลากรในแฟ้ม <? echo $n?> **</font></td>
          </tr>
          <?php ?>
        </table>
        <table width="374" align="center">
                <!--DWLayoutTable-->
                <tr> 
                  <td width="116" height="63" valign="top"><br> <table width="184"  border="0" cellpadding="1" cellspacing="1" bgcolor="silver" align="right">
                <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>">
                <td colspan="2" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ข้อมูลคำนำหน้าชื่อ</b></font></td>
                </tr>
                <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_14"];?>">
                <td width="79" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>คำนำหน้าชื่อ</b></font></td>
                <td width="106" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>คำนำหน้าชื่อ</b></font></td>
                </tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_5"]; ?>><td align="center">1</td><td align="center">นาย</td></tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_11"]; ?>><td align="center">2</td><td align="center">นางสาว</td></tr>
                <tr bgcolor=<? echo $GLOBALS["COLOR_BG_TD_5"]; ?>><td align="center">3</td><td align="center">นาง</td></tr>
            </table></td>
                  <td width="246" valign="top"><br> <table width="246"  border="0" cellpadding="1" cellspacing="1" bgcolor="silver">
                <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>">
                <td colspan="2" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ข้อมูลหน่วยงาน</b></font></td>
                </tr>
                <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_14"];?>">
                <td width="74" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>หน่วยงาน</b></font></td>
                <td width="252" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อหน่วยงาน</b></font></td>
                </tr>
                <? 
                $i
=0;
                
$oDP->RSDeptByMaxdeptDate();
                while(
$oDP->GetRecord()){
                                    if((
$i%2) == 0)
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">"
                                    else
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">"
                    
?>
                        <td width="74" align="center"><? echo $oDP->deptId?></b></td>
                        <td width="252" align="left"><? echo $oDP->deptName?></td>
                        </tr>
                <? $i++; }?>
            </table></td>
                </tr>
              </table>
      </form>
      <? }} ?>
      <? if($success=="1"){  ?>
      <br>
                    <table width="710"  border="0" align="center" cellpadding="1" cellspacing="1"  bgcolor="#FFFFFF">
                     <tr >
                     <td colspan="7" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><b>บันทึกข้อมูลเรียบร้อยแล้ว</b></font></td>
                     </tr>
                     </table><br>
                     <table width="90%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="silver">
                  <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>"> 
            <td width="5%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>#</b></font></td>
            <td width="10%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>
              คำนำหน้า<br>ชื่อ</b></font></td>
            <td width="23%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อ</b></font></td>
           
            <td width="22%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>นามสกุล</b></font></td>
            
            <td  width="10%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>รหัส<br>
              หน่วยงาน</b></font></td>
            <td width="20%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อผู้ใช้<br>
              (Login)</b></font></td>
          </tr>
<?
                                    $j
=0;
                                    
$oPS->RSperson();
                                    while(
$oPS->GetRecord()){
                                            
$oUms->SearchByUsPsCode($oPS->personId);
                                            
$oUms->GetRecord();
                                      if((
$j%2) == 0)
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">"
                                    else
                                          echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">"
                                    
?>
               
                          <td width="17" align="center"><? echo $j+1?></td>
                        <td align="center">&nbsp;<? echo $oPS->prefixId?></td>
                        <td align="left">&nbsp;<? echo $oPS->fName?></td>
                        <td  align="left">&nbsp;<? echo $oPS->lName?></td>
                        <td align="center">&nbsp;<? echo $oPS->deptId?></td>
                        <td  align="left">&nbsp;<? echo $oUms->UsLogin?></td>
                      </tr>
                      <?  $j++; } ?>
                      </table>
                      <table width="760"  border="0" align="center" cellpadding="1" cellspacing="1" >
                      <tr bgcolor="#FFFFFF">
                      <td colspan="7" align="center"><input name="Button" type="button"  value="กลับหน้าหลัก" onClick=" location.href = 'ImportPsExcel.php'"></td>
                      </tr>
                      </table>
            <? ?>
  </fieldset></td></tr></table>
<script language="JavaScript1.2">
function checkFormat(chk){
    if(document.ff.uploadfile.value==""){
        alert("กรุณากรอกแฟ้มข้อมูล !!");
        document.ff.uploadfile.focus();
        return false;
    }else{
            if(chk==1){
                    var agree=confirm("มีข้อมูลบุคลากรในฐานข้อมูลแล้ว หากบันทึกข้อมูลใหม่ ข้อมูลบุคลากรทั้งหมดจะถูกลบ คุณต้องการอัพโหลดแฟ้มข้อมูลใช่หรือไม่ ?");
                        if (agree){ return true ;}else{return false ;}
            }else{
                    var agree=confirm("คุณต้องการอัพโหลดแฟ้มข้อมูลใช่หรือไม่ ?");
                        if (agree){return true ;}else{return false ;}
            }
    }
}
function checkFormat2(chk){
            if(chk==1){
                    var agree=confirm("มีข้อมูลบุคลากรในฐานข้อมูลแล้ว หากบันทึกข้อมูลใหม่ ข้อมูลบุคลากรทั้งหมดจะถูกลบ คุณต้องการบันทึกข้อมูลใช่หรือไม่ ?");
                        if (agree){ return true ;}else{return false ;}
            }else{
                    var agree=confirm("คุณต้องการบันทึกข้อมูลใช่หรือไม่ ?");
                        if (agree){return true ;}else{return false ;}
            }
}
function delfile(){
            var agree=confirm("คุณต้องการลบแฟ้มข้อมูลนี้แน่นอนใช่หรือไม่ ?");
            if (agree){ return true ;}else{return false ;}
}
</script>

<?php
set_time_limit
(30);
?>

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