当前位置: 首页 > 图文教程 > 服务器 > 安全防护 > jsp防盗链

安全防护
360安全卫士3.6beta发布 查杀15万种木马
最佳安全实践:锁定IIS和SQL服务器
机房的硬件防火墙到底能不能防DDOS?
服务器安全:防范拒绝服务攻击妙招
服务器安全:从“治标”到“治本”
重点评论黑客袭击服务器和网站种种
全方位堵住Windows 2003的安全隐患
红客必学:Windows权限设置详解
Windows 2003安全指南之强化IAS服务器
windows日志的保护与伪造
Windows Internet服务器安全配置原理篇
Windows 2003 Server安全配置完整篇(1)
Windows 2003 Server安全配置完整篇(2)
Windows 2003 Server安全配置完整篇(3)
Windows 2003 Server安全配置完整篇(4)
服务器安全配置精华技巧
网管必知 如何设置虚拟主机访问权限
运用CrackLib构建安全的Unix口令
命令行下也玩IPsec
使用IIS为Web内容配置Web服务器权限

安全防护 中的 jsp防盗链


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 30 ::
收藏到网摘: n/a

jsp防盗链

index.jsp

以下为引用的内容:

-----------------------------

<html>
  <head><title>Simple jsp page</title></head>
  <body>Place your content here

  here is index jsp
    get header info
  <a href="a.jsp">a.jsp</a>
  </body>
</html>

 ------------------------------

a.jsp页面

通过判断 referer, 判断你从哪里来。

以下为引用的内容:

<html>
  <head><title>Simple jsp page</title></head>
  <body>Place your content here

  here is a. jsp
    get header info
  <%=request.getHeader("Referer")%>
  <%if(null == request.getHeader("Referer") || request.getHeader("Referer").indexOf("yourdomain.com") < 0){%>
     做人要厚道
  <%}else{%>
  合法访问
  <%}%>
  </body>
</html>

本文收集整理自互联网,若您是原文作者,请来信更改作者及出处Post#ruanchen.com(把#改为@)