首页 > 服务器 > Win服务器 > 正文

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

2024-09-10 00:02:44
字体:
来源:转载
供稿:网友
伪造Web请求(二)

  注意b的值必须以URL编码格式输入。要将字符串进行URL编码,可以使用一个简单的PHP程序,例如:



kris@valiant:~/www < cat urlencode.php#! /home/kris/bin/php -q< ?php print urlencode($argv[1])."n";? >kris@valiant:~/www < ./urlencode.php "this is a test"this+is+a+test

  发送HTTP POST请求只是稍微复杂一点:现在应该在这个请求中包含一个合法的Content-Type头以及正确的内容长度字节数。下面是具体过程:



kris@valiant:~/www < telnet valiant 80Trying 193.102.57.3...Connected to valiant.koehntopp.de.Escape character is '^]'.POST /~kris/test.php HTTP/1.0Host: valiant.koehntopp.deReferer: http://www.attacker.com/die_sucker_die.htmlContent-Type: application/x-www-form-urlencodedContent-Length: 16b=this+is+a+testHTTP/1.1 200 OKDate: Sat, 08 Apr 2000 06:55:11 GMTServer: Apache/1.3.9 (Unix) (SuSE/Linux) PHP/4.0RC2-devmod_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 ishttp://www.attacker.com/die_sucker_die.htmlConnection closed by foreign host.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表