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

安全防护
为Windows 2003安全—层层设防(3)
为Windows 2003安全—层层设防(4)
修改IIS的Banner隐藏操作系统版本
以毒攻毒!IIS Banner巧伪装
四招加强Windows 2003安全性
深入剖析EFS(2)
设置Active Directory域(1)
设置Active Directory域(2)
Rootkit分析(1)
Rootkit分析(2)
Rootkit分析(3)
Windows域信任关系建立全攻略
关于网站木马的解释(1)
关于网站木马的解释(2)
hdsi2.0 sql注入部分抓包(1)
hdsi2.0 sql注入部分抓包(2)
hdsi2.0 sql注入部分抓包(3)
hdsi2.0 sql注入部分抓包(4)
建造永不被杀的80端口后门(1)
建造永不被杀的80端口后门(2)

安全防护 中的 jsp防盗链


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 42 ::
收藏到网摘: 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(把#改为@)