首页 > 站长学院 > 服务器相关 > Web服务器的安全和攻击防范(7)
 

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

日期:2004-07-24 00:00:00  来源:天极网
请您记住思索网的网址: http://www.4so.net  [加入收藏夹]

    伪造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.0Host: valiant.koehntopp.deReferer: http://www.attacker.com/die_sucker_die.html

  下面是完整的会话过程:



kris@valiant:~/www < telnet valiant 80Trying 193.102.57.3...Connected to valiant.koehntopp.de.Escape character is '^]'.GET /~kris/test.php?b=this+is+a+test HTTP/1.0Host: valiant.koehntopp.deReferer: http://www.attacker.com/die_sucker_die.htmlHTTP/1.1 200 OKDate: Sat, 08 Apr 2000 06:44:02 GMTServer: Apache/1.3.9 (Unix) (SuSE/Linux) PHP/4.0RC2-dev mod_ssl/2.4.7 OpenSSL/0.9.4X-Powered-By: PHP/4.0RC2-devConnection: closeContent-Type: text/htmlThe value of b is this is a testThe value of HTTP_REFERER is http://www.attacker.com/die_sucker_die.htmlConnection closed by foreign host.


 
 
热门信息
 
相关文章