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


Viewing file:     connMySQL.class.php (3.93 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--- Main.inc.php  
//--- Class DBConn use to connect to MySQL Server

class DBConn {

	//### DataBase Variables
	var $result;
	var $_resource;
	var $_numrows;
	
	//### Connect to MIS MySQL Server
	function DBConn(){

		global $_Config_MISDBHost, $_Config_MISDBUser, $_Config_MISDBPass, $_Config_MISDBName;

		//--- perform a number of fatality checks, then die gracefully
		if (!function_exists( 'mysql_connect' )) {
			die( 'FATAL ERROR: MySQL support not available.  Please check your configuration.' );
			exit();
		}
		//if (!($this->_resource = mysql_connect( "localhost", "root", "1234"))) {  // local
		if (!($this->_resource = mysql_connect($_Config_MISDBHost, $_Config_MISDBUser, $_Config_MISDBPass))) {  // Server
			die( "FATAL ERROR: Connection to database server failed. $_Config_MISDBHost, $_Config_MISDBUser, $_Config_MISDBPass, $_Config_MISDBName" );
			exit();
		}
		//if (!mysql_select_db("managev3_db")) {  // local
		if (!mysql_select_db($_Config_MISDBName)) {  // Server
			die( "FATAL ERROR: Database not found. Operation failed with error: ".mysql_error() );
			exit();
		}

		mysql_query("SET NAMES tis620");
	}

	//### Connect to REG MySQL Server
	function RegDBConn(){
		
		global $_Config_REGDBHost, $_Config_REGDBUser, $_Config_REGDBPass, $_Config_REGDBName;

		//--- perform a number of fatality checks, then die gracefully
		if (!function_exists( 'mysql_connect' )) {
			die( 'FATAL ERROR: MySQL support not available.  Please check your configuration.' );
			exit();
		}
		//if (!($this->_resource = mysql_connect( "localhost", "root", "1234"))) {  // local
		if (!($this->_resource = mysql_connect($_Config_REGDBHost, $_Config_REGDBUser, $_Config_REGDBPass))) {  // Server
			die( 'FATAL ERROR: Connection to database server failed.' );
			exit();
		}
		//if (!mysql_select_db("managev3_db")) {  // local
		if (!mysql_select_db($_Config_REGDBName)) {  // Server
			die( "FATAL ERROR: Database not found. Operation failed with error: ".mysql_error() );
			exit();
		}

		mysql_query("SET NAMES tis620");
	}

	//### Disconnect
	function disconn() {
        $ret = mysql_close($this->_resource);
        $this->_resource = null;
        return $ret;	
	}

	//### Query user this function for run query and return number of rows too : for SELECT query
	function execQuery($sql) {
		$cur = mysql_query($sql);
    
		//--- handle error
		if(!$cur) {
			$this->DisplayErrMsg("Error in query : $sql. ". mysql_error());
			exit;
		}
		$this->_numrows = mysql_num_rows($cur);
		return($cur);
	}  

	//### Query user this function for run query only : for INSERT, DELETE, UPDATE query
	function runQuery($sql) {
		$cur = mysql_query($sql);
    
		// handle error
		if(!$cur){
			$this->DisplayErrMsg("Error in query : $sql. ". mysql_error());
			exit;
		}
		return($cur);
	}  

	//### Fetch Array
	function fetchArray($rs) { 
		$row = mysql_fetch_array($rs);
		return($row);
	}
	
	//### Fetch Object
	function fetchObject($rs) { 
		$row = mysql_fetch_object($rs);
		return($row);
	}

	//### Free Result
    function freeresult($result) {
        if (is_resource($result)) {
            return mysql_free_result($result);
        }
	}

	//### Display error messages
	function DisplayErrMsg( $message ) {
		printf("<font color=\"red\">%s</font>\n", $message);
	}

	//### Insert In (Last Id)
	function lastId() {
		return mysql_insert_id();
	}

	//### Affected Rows
	function affectedrows() {
		return mysql_affected_rows();
	}

	/**
	* Get a database escaped string
	* @return string
	*/
	function getEscaped( $text ) {
		return mysql_escape_string( $text );
	}
	/**
	* Get a quoted database escaped string
	* @return string
	*/
	function Quote( $text ) {
		return '\'' . mysql_escape_string( $text ) . '\'';
	}

	function insertid()	{
		return mysql_insert_id();
	}

	function getVersion()	{
		return mysql_get_server_info();
	}

} # 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 ::
 
[ 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 ]--