ASP 伪造 referer 的方法和实例代码

ASP版伪造referer代码如下:

Copy to ClipboardLiehuo.Net Codes引用的内容:[www.veryhuo.com] <%
'本代码放在如www.veryhuo.com/down/1.asp下
Function GetBody(weburl)
Set Retrieval = Server.CreateObject("MSXML2.XMLHTTP")
With Retrieval
.Open "GET", weburl, False, "", ""
.setRequestHeader "referer","http://www.123.com"'想改什么就改什么
.Send
GetBody = .ResponseBody
End With
GetBody = BytesToBstr(GetBody,"GB2312")
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

Response.Write(GetBody("http://down.61qq.com/2.asp"))
%>

//以上是www.veryhuo.com/down/1.asp

//以下是www.veryhuo.com/down/2.asp
<% Response.Write "来路:"%>
<% =Request.ServerVariables("HTTP_REFERER") %>
<%
Dim IP
IP=Request.ServerVariables("REMOTE_ADDR")
Response.Write " 来访者IP地址:" & IP
%>
//代码完

转载请注明:代码家园 » ASP 伪造 referer 的方法和实例代码

评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)