ASP伪造REFERER方法
来源:asp之家 时间:2008-07-03 12:48:00
一个网站的一个页面download.asp通过判断referer来确定是不是从他本站点过来的链接,使用这个功能我们可以用来防止下载盗链,当然这种方法不是最可靠的,看下面的代码,通过XMLHTTP就伪造了REFERER地址。
代码:
<%
Function GetBody(weburl)
Set Retrieval = Server.CreateObject("MSXML2.XMLHTTP")
With Retrieval
.Open "Get", weburl, False, "", ""
.setRequestHeader "referer","https://www.aspxhome.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("https://www.aspxhome.com/referer.asp"))
%>
标签:referer,XMLHTTP,代码
0
投稿
猜你喜欢
成功实现ajax,xmlhttp跨域访问(php,asp,jsp)
2008-02-13 18:40:00
asp中提示至少一个参数没有被指定值 解决方法
2013-06-01 20:14:00
{ hide_text } CSS文字隐藏总结报告
2010-06-13 17:19:00
CSS Sprites + 圆角[译]
2009-05-08 16:10:00
SQL Server 2005中的CLR集成
2009-03-10 15:07:00
用css实现透视效果
2009-09-05 16:33:00
javascript权威指南,学习笔记,之运算符号
2008-04-20 16:43:00
网购中的商品评价与口碑传播-译
2010-07-09 13:44:00
发个js从样式表取值的函数
2008-05-20 12:23:00
自定义404错误页面实现自动跳转
2007-12-10 18:25:00
OpenSearch 初探
2008-06-19 12:06:00
Mysql Innodb引擎优化(参数篇)
2010-05-02 19:57:00
ASP编写计数器的优化方法
2009-01-21 19:46:00
WAP设计基础
2011-01-06 12:13:00
asp如何用ADO批量更新记录?
2010-06-10 18:42:00
asp生成不需要数据库的中奖码
2008-07-18 12:31:00
设计较好付款流程的12个建议
2009-06-08 12:45:00
FrontPage2003 中网页布局功能的应用
2007-11-18 14:43:00
加快Firefox 3.5启动速度的方法
2009-07-16 15:22:00
taobao cdn的缓存?
2009-09-19 17:21:00