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


Viewing file:     clsUser.php (7.91 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
class clsUser{
    
var 
$userID;                            //เปลี่ยนเมื่อ login
var $userLogin;                    //รหัสบุคลากร รหัสนักศึกษา 
var $userPassword;            //
var $userIP    ;
var 
$userName;

var 
$userDptCode;            //ไม่ได้ใช้
var $userDptName;            //ไม่ได้ใช้
var $userPosCode;            //ไม่ได้ใช้
var $userPosName;            //ไม่ได้ใช้

var $userPsID;                //id ของบุคลากร   รหัสนิสิต
var $userPsCode;            //รหัสบุคลากร

var $SessionID;
var 
$Lang "th";

var 
$WgID;                    //is set when login
                                        //กลุ่ม:: 
                                        //    1 ผู้ดูแลระบบ, 
                                        //    2 ผู้บริหารระดับสูง, 
                                        //    3 ผู้บริหาร, 
                                        //    4 เจ้าหน้าที่, 
                                        //    5 อาจารย์, 
                                        //    6 นักศึกษา 
var $StID;                        //StID ของระบบที่เลือกจากเมนูสไลด์ด้านข้าง    ถูกเปลี่ยนโดน slide menu
var $GpID;                        //GpID กลุ่มระบบงานที่เลือก            ถูกเปลี่ยนโดน slide menu

var $MmnID;                    //ถูกเปลี่ยนโดยเมนูหลัก
var $MnID;                        //ถูกเปลี่ยนโดยเมนู
var $X;
var 
$C;
var 
$R;
var 
$U;
var 
$D;    

function 
clsUser(){    }    
function 
getLoginName(){ return $this->userLogin; }
function 
getUserIP(){ return $this->userIP; }
function 
getName(){ return $this->userName; }
function 
getDptCode(){ return $this->userDptCode; }
function 
getDptName(){ return $this->userDptName;    }
function 
checkAA(){ return true; }
function 
isExpire(){     return false;    }
function 
isLock(){ return false; }

function 
GetRightsByMenu(){
    global 
$oU;
    
//global $mm;
    
if ($this->MnID<>""){
        include_once(
"global.php");
        
//include_once("../class/clsConnection.php");
        //include_once("../class/clsDB.php");
        
include_once("clsUmPermission.php");
        include_once(
"clsUmGPermission.php");
        include_once(
"clsUmLog.php");
        include_once(
"global.php");
        
$oCu = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
        
$oUp = new umpermission($oCu);
        
$oGp = new umgpermission($oCu);
        
$oL = new umlog($oCu);
            
$oL->AddNew();
            
$oL->UlUsID $oU->userID;
            if (
$mm==1)
                
$oL->UlMnID $oU->MmnID;
            else
                
$oL->UlMnID $oU->MnID;
            
$oL->UlFrTime date('h:i:s');
            
$oL->UltoTime "";
            
$oL->UlIP $oU->userIP;
            
$oL->UlCmd "";
            
$oL->Save();
        
$this->1;
        
$this->1
        
$this->1;     
        
$this->1
        
$this->1;
        
$oUp->SearchByKey($this->userID$this->MnID);
        if (
$oUp->GetRecord()){
            
$this->$oUp->pmX;    
            
$this->$oUp->pmC;
            
$this->$oUp->pmR;    
            
$this->$oUp->pmU;
            
$this->$oUp->pmD;
        } else {
            
$oGp->SearchByKey($this->GpID$this->MnID);
            if (
$oGp->GetRecord()){
                
$this->$oGp->gpX;    
                
$this->$oGp->gpC;
                
$this->$oGp->gpR;    
                
$this->$oGp->gpU;
                
$this->$oGp->gpD;
            }        
        }
    }
}

function 
CRUD($link$linktype){
    
$linktype=strtolower($linktype);
    if (
strpos("crud",$linktype)===false) die("ชนิดของ Link ต้องเป็น CRUD เท่านั้น");
    
$flg false;
    if (
$linktype=="c" and $this->C==0)
         
$flg=true;
    elseif (
$linktype=="r" and $this->R==0
        
$flg=true;
    elseif (
$linktype=="u" and $this->U==0)
        
$flg=true;
    elseif (
$linktype=="d" and $this->D==0
        
$flg=true;
    if (
$flg==false){
        return  
$link;
    }else{
        
$link=trim($link);            
        
$s strtolower($link);
        
//----------------------------------------------------------------
        //find image name
        //            $input="images/del.gif";
        //            $output = "images/delgrey.gif";        // use explode fn
        //            $this->createGreyFromGifJpg($input, $output);
        //---------------------------------------------------------------
        //rename imagename.gif to imagenamegrey.gif
        
$pGif strpos($s,".gif");
        if (
$pGif===false){
        }else{
            
$ss substr_replace($link"grey"$pGif).substr($link$pGif);
            
$link $ss;
            
$s strtolower($link);
        }
        
//rename imagename.jpg to imagenamegrey.jpg
        
$pJpg strpos($s,".jp");
        if (
$pJpg===false){
        }else{
            
$ss substr_replace($link"grey"$pJpg).substr($link$pJpg);
            
$link $ss;
            
$s strtolower($link);
        }            
        
//add disabled to input tag
        
$pos strpos($s,"input");
        if (
$pos===false){
        }else{
            
$ss substr_replace($link"input disabled"$pos).substr($link$pos+5);
            
$link $ss;
            
$s strtolower($link);
        }
        
//change onclick-->onklick
        
$pOnClick strpos($s,"onclick");
        if (
$pOnClick===false){
        }else{
            
$ss substr_replace($link"onklick"$pOnClick).substr($link$pOnClick+7);
            
$link $ss;
            
$s strtolower($link);                
        }
        
////////////
        //disable tag A 
        
$pHref strpos($s,"href");
        if (
$pHref===false){
        }else{
            
$ss substr_replace($link"href1"$pHref).substr($link$pHref+4);
            
$link $ss;
            
$s strtolower($link);
        }            
        
//disable text between tag A and not have tag img 
        
$pImg strpos($s,"<img")===false;
        if (
$pImg===false){            
            if (
substr($s,0,2)=="<a"){
                
$p1 strpos($link,">");
                
$p2 strpos($link,"</");
                
$ss "<font color=#999999>".substr($link$p1+1,$p2)."</font>";
                
$link =  $ss;
                
$s strtolower($link);
            }
        }
        return 
$link;
    }
}

///////////////////    

function addNewUser($UsID$UsName$UsWgID$UsStID=-1$UsLogin=""$UsPassword=""$UsActive=1$UsAdmin=0){
    
//UsID
    //UsLogin
    //รหัสบุคลากร/รหัสนักศึกษา, ชื่อ, กลุ่มงาน, ระบบงาน, ชื่อล๊อกอิน, รหัสผ่าน, active, admin
    //กลุ่มงาน:: 1 ผู้ดูแลระบบ, 2 ผู้บริหารระดับสูง, 3 ผู้บริหาร, 4 เจ้าหน้าที่ทะเบียน/เจ้าหน้าที่ฝ่ายอื่น, 5 อาจารย์, 6 นักศึกษา 
    //ระบบงาน:: -1 ไม่ระบุ, 1 ทะเบียน, 2 บุคลากร, 3 e-office, 4 กำกับงบ, 5, 6, 7, 8, 9, 10, ...
    
include_once("../class/clsConnection.php");
    include_once(
"../class/clsDB.php");
    include_once(
"clsUmUser.php");
    include_once(
"clsUmUserGroup.php");
    include_once(
"global.php");
    
$oCu = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
    
$oUs = new umuser($oCu);
    
$oUg = new umusergroup($oCu);
    
    
$oCu->BeginTrans();
    
$oUs->AddNew();
    
$oUs->UsPsCode=$UsID;                    //ถ้าเป็นนิสิตให้เป็น UsID
    
$oUs->UsName=$UsName;
    
$oUs->UsWgID=$UsWgID;
    if(
$UsLogin==""$UsLogin=$UsID;                //ถ้าเป็นนิสิตให้เป็น UsID
    
$oUs->UsLogin=$UsLogin;                            
    if(
$UsPassword==""$UsPassword=$UsID;    //ครั้งแรกให้เท่ากับ UsID
    
$oUs->UsPassword=md5("O]O".$UsPassword."O[O");
    
$oUs->UsActive=$UsActive;
    
$oUs->UsAdmin=$UsAdmin;    
    
$oUs->Save();    
    
////////////////////////////////////////////////////
    //add usergroup ตามกลุ่มระบบงาน 4 5 6
    ///////////////////////////////////////////////////
    //ระบบทะเบียน
    
if ($UsStID==1){
        
$oUg->AddNew();
        
$oUg->UgUsID=$oUs->UsID;
        
//กำหนดรหัสกลุ่มระบบงาน
        
if ($UsWgID==4$oUg->UgGpID=2;            //ไม่ค่อยดี 
        
if ($UsWgID==5$oUg->UgGpID=3;            //ไม่ค่อยดี  fix เกินไป
        
if ($UsWgID==6$oUg->UgGpID=4;            //ไม่ค่อยดี 
        
$oUg->Save();
    }
    
///////////////////////////////////////////////////
    //ระบบบุคลากร
    
if ($UsStID==2){
    }
    
///////////////////////////////////////////////////
    //ระบบe-office
    
if ($UsStID==3){
    }
    
///////////////////////////////////////////////////
    //ระบบกำกับงบ
    
if ($UsStID==4){
    }
    
///////////////////////////////////////////////////
    
$oCu->CommitTrans();
}

function 
changePassword($UsLogin$oldPassword$newPassword){
    include_once(
"../class/clsConnection.php");
    include_once(
"../class/clsDB.php");
    include_once(
"clsUmUser.php");
    include_once(
"global.php");
    
$oCu = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
    
$oUs = new umuser($oCu);    
    
$oUs->SearchByLogin($UsLogin$oldPassword);
    if (
$oUs->GetRecord()){
        
$oUs->Edit();
        
$oUs->UsPassword=md5("O]O".$newPassword."O[O");        
        
$oUs->Save();    
        return 
1;
    }else{
        return 
0;    
    }
}

function 
deleteUser($UsCode$password){
    include_once(
"../class/clsConnection.php");
    include_once(
"../class/clsDB.php");
    include_once(
"clsUmUser.php");
    include_once(
"global.php");
    
$oCu = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
    
$oUs = new umuser($oCu);    
    
$oUs->SearchByLogin($UsCode$password);
    if (
$oUs->GetRecord()){
        
$oUs->Delete();
        return 
1;
    }else{
        return 
0;    
    }
}
function 
updateUser(){}

}    
//end class

?>

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