PHP WebShell

Текущая директория: /var/www/bitcardoApp/backyard/user/users

Просмотр файла: generated.php

<?php
require '../../config/db_config.php'; // $conn = new mysqli(...);

// Define coin details with icons
$coins = [
    ["coin" => "NGN", "label" => "NGN Wallet", "type" => "fiat", "icon" => "ngn.png"],
    ["coin" => "BTC", "label" => "BTC Wallet", "type" => "crypto", "icon" => "btc.png"],
    ["coin" => "USDT", "label" => "USDT Wallet", "type" => "crypto", "icon" => "usdt.png"],
    ["coin" => "ETH", "label" => "ETH Wallet", "type" => "crypto", "icon" => "eth.jpg"],
    ["coin" => "SOL", "label" => "SOL Wallet", "type" => "crypto", "icon" => "sol.jpg"],
    ["coin" => "LTC", "label" => "LTC Wallet", "type" => "crypto", "icon" => "ltc.png"],
];

// 30 first and last names
$fakeFNames = ["David", "Grace", "Emeka", "Tolu", "Sandra", "James", "Ada", "Ife", "Uche", "Ngozi", "Mike", "Zainab", "Lola", "John", "Femi", "Chinwe", "Kemi", "Desmond", "Bukky", "Paul", "Amaka", "Yinka", "Bola", "Tope", "Gbenga", "Nneka", "Jide", "Blessing", "Ibrahim", "Chidi"];
$fakeLNames = ["Okoro", "Adeyemi", "Obi", "Balogun", "Lawal", "Okafor", "Eze", "Ogunleye", "Mohammed", "Ali", "Oke", "Onyeka", "Danladi", "Salami", "Osho", "Nwachukwu", "Ibrahim", "Ogunbanjo", "Iwu", "Ajayi", "Usman", "Omotoso", "Chukwu", "Egbetokun", "Etim", "Anyanwu", "Abdullahi", "Sule", "Idris", "Alabi"];

for ($i = 0; $i < 100; $i++) {
    $first = $fakeFNames[array_rand($fakeFNames)];
    $last = $fakeLNames[array_rand($fakeLNames)];
    $email = strtolower($first . '.' . $last . rand(100, 999) . '@mail.com');
    $phone = '080' . rand(10000000, 99999999); // no space
    $status = rand(0, 1) ? 'active' : 'inactive';

    $user_sql = "INSERT INTO users (email, phone, first_name, last_name, user_status)
                 VALUES ('$email', '$phone', '$first', '$last', '$status')";
    if ($conn->query($user_sql)) {
        $user_id = $conn->insert_id;

        foreach ($coins as $coin) {
            $coin_code = $coin['coin'];
            $label = $coin['label'];
            $type = $coin['type'];
            $icon = $coin['icon'];
            $wallet_add = substr(hash('sha256', $user_id . $coin_code), 0, 34);
            $bank_name = ($coin_code == 'NGN') ? 'Paystack Titan' : '';
            $wallet_qr = "";
            $balance = round(mt_rand(0, 1000000) / 100, 5);
            $wallet_status = rand(0, 1) ? 'active' : 'inactive';
            $now = date("Y-m-d H:i:s");

            $wallet_sql = "INSERT INTO user_wallets 
                (user_id, wallet_add, bank_name, wallet_qr, coin, icon, balance, type, label, wallet_status, updated_at, created_at)
                VALUES 
                ($user_id, '$wallet_add', '$bank_name', '$wallet_qr', '$coin_code', '$icon', $balance, '$type', '$label', '$wallet_status', '$now', '$now')";
            $conn->query($wallet_sql);
        }
    } else {
        echo "User insert failed: " . $conn->error . "<br>";
    }
}

echo "Seeding complete.";
?>

Выполнить команду


Для локальной разработки. Не используйте в интернете!