阅读内容 

Web服务器的安全和攻击防范(7)

[日期:2004-07-24] 来源:天极网  作者: [字体: ]
伪造Web请求(一)

   下面这个简单的PHP程序将输出CGI参数b的值以及HTTP_REFERER的值:



kris@valiant:~/www < cat test.PHP < ?php print "The value of b is $bn"; print "The value of HTTP_REFERER is $HTTP_REFERERn"; ? >

  用telnet连接到80端口,我们能够向上述脚本提供任意的参数值b,同时还可以任意提供HTTP_REFERER值。我们把下面的几行发送到服务器



GET /~kris/test.PHP?b=this+is+a+test HTTP/1.0 Host: valiant.koehntopp.de Referer: http://www.attacker.com/die_sucker_die.HTML

  下面是完整的会话过程:



kris@valiant:~/www < telnet valiant 80 Trying 193.102.57.3... Connected to valiant.koehntopp.de. Escape character is '^]'. GET /~kris/test.PHP?b=this+is+a+test HTTP/1.0 Host: valiant.koehntopp.de Referer: http://www.attacker.com/die_sucker_die.HTML HTTP/1.1 200 OK Date: Sat, 08 Apr 2000 06:44:02 GMT Server: Apache/1.3.9 (Unix) (SuSE/Linux) PHP/4.0RC2-dev mod_ssl/2.4.7 OpenSSL/0.9.4 X-Powered-By: PHP/4.0RC2-devConnection: close Content-Type: text/html The value of b is this is a test The value of HTTP_REFERER is http://www.attacker.com/die_sucker_die.html Connection closed by foreign host.

阅读:
录入:

推荐 】 【 打印
相关新闻      
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:
Advertisement
内容查询


Advertisement