According to ES0en ES1en the spider code black hat jump code of js version and php version is determined

  • 2020-08-22 21:53:33
  • OfStack

One of the tricks of the Black hat seo approach that everybody USES is to determine user-ES3en on the server side of the client browser and then do the next step,

There's been a lot of people on the web using this code. It starts with an js code that tells you where your visitors are coming from. If it's a search engine, it jumps. If it's a direct visit, it doesn't change


<script language="javascript">
var pattern = /google/gi;
var pattern1= /yahoo/gi;
var keyValue=escape(document.referrer);
if (pattern.exec(keyValue))
setTimeout(
"windows.location='https://www.ofstack.com'",10*1000);
else if(pattern1.exec(keyValue))
setTimeout(
"window.location='https://www.ofstack.com'",10*1000);
</script>

If it is user-ES11en of the search engine, then 301 redirect is the practice of many fraudulent links on the Internet (the code will be put at the end)

Specific there are a lot of ideas, jump, Joe page and so on today only put out the code php code

Declaration code is baidu down to write a simple first
Judge by php's $_SERVER[' HTTP_USER_AGENT']


<?php
$tmp = $_SERVER['HTTP_USER_AGENT'];
if(strpos($tmp, 'Googlebot') !== false){
    echo ' Google ';
} else if(strpos($tmp, 'Baiduspider') >0){
    echo ' baidu ';
} else if(strpos($tmp, 'Yahoo! Slurp') !== false){
    echo ' Yahoo! ';
} else if(strpos($tmp, 'msnbot') !== false){
    echo 'Msn';
} else if(strpos($tmp, 'Sosospider') !== false){
    echo ' search ';
} else if(strpos($tmp, 'YodaoBot') !== false || strpos($tmp, 'OutfoxBot') !== false){
    echo ' youdao ';
} else if(strpos($tmp, 'Sogou web spider') !== false || strpos($tmp, 'Sogou Orion spider') !== false){
    echo ' sogou ';
} else if(strpos($tmp, 'fast-webcrawler') !== false){
    echo 'Alltheweb';
} else if(strpos($tmp, 'Gaisbot') !== false){
    echo 'Gais';
} else if(strpos($tmp, 'ia_archiver') !== false){
    echo 'Alexa';
} else if(strpos($tmp, 'altavista') !== false){
    echo 'AltaVista';
} else if(strpos($tmp, 'lycos_spider') !== false){
    echo 'Lycos';
} else if(strpos($tmp, 'Inktomi slurp') !== false){
    echo 'Inktomi';
}
?>

Paragraph 2 with a jump


<?php
$flag = false;
$tmp = $_SERVER['HTTP_USER_AGENT'];
if(strpos($tmp, 'Googlebot') !== false){
    $flag = true;
} else if(strpos($tmp, 'Baiduspider') >0){
    $flag = true;
} else if(strpos($tmp, 'Yahoo! Slurp') !== false){
    $flag = true;
} else if(strpos($tmp, 'msnbot') !== false){
    $flag = true;
} else if(strpos($tmp, 'Sosospider') !== false){
    $flag = true;
} else if(strpos($tmp, 'YodaoBot') !== false || strpos($tmp, 'OutfoxBot') !== false){
    $flag = true;
} else if(strpos($tmp, 'Sogou web spider') !== false || strpos($tmp, 'Sogou Orion spider') !== false){
    $flag = true;
} else if(strpos($tmp, 'fast-webcrawler') !== false){
    $flag = true;
} else if(strpos($tmp, 'Gaisbot') !== false){
    $flag = true;
} else if(strpos($tmp, 'ia_archiver') !== false){
    $flag = true;
} else if(strpos($tmp, 'altavista') !== false){
    $flag = true;
} else if(strpos($tmp, 'lycos_spider') !== false){
    $flag = true;
} else if(strpos($tmp, 'Inktomi slurp') !== false){
    $flag = true;
}
if($flag == false){
   header("Location: https://www.ofstack.com" . $_SERVER['REQUEST_URI']);
    //  Automatically transferred to the https://www.ofstack.com  Corresponding page 
    // $_SERVER['REQUEST_URI']  Is the path after the domain name 
    //  or   Switch to  header("Location: https://www.ofstack.com/abc/d.php");
   exit();
}
?>

The third code is determined after the 301 jump


if (preg_match( " #(google|slurp@inktomi|yahoo! slurp|msnbot)#si " , $_SERVER['HTTP_USER_AGENT'])) {
 
header( " HTTP/1.1 301 Moved Permanently " );
header( " Location: http://www.saoyu.com/ " );
exit;
 
}}

The black hat approach is risky and should be used with caution. If the friend feels like looking for the back door.


Related articles: