TRACE_Method是HTTP(超文本传输)协议定义的一种协议调试方法,该方法会使服务器原样返回任意客户端请求的任何内容。
TRACE和TRACK是用来调试web服务器连接的HTTP方式。支持该方式的服务器存在跨站脚本漏洞,通常在描述各种浏览器缺陷的时候,把"Cross-Site-Tracing"简称为XST。攻击者可以利用此漏洞欺骗合法用户并得到他们的私人信息。
如何关闭Apache的TRACE请求
虚拟主机用户可以在.htaccess文件中添加如下代码过滤TRACE请求:
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
服务器用户在httpd.conf尾部添加如下指令后重启apache即可:
TraceEnable off
――――――――――――――――――――――――---
####################################################方法1
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
####################################################
TraceEnable off
####################################################
cd /application/apache/conf
ls
cp httpd.conf httpd.conf.$(date +%F).bak
ls
egrep "RewriteEngine|RewriteCond|RewriteRule" httpd.conf
echo -e "RewriteCond {REQUEST_METHOD} ^(TRACE|TRACK)\nRewriteRule .* - [F]" >>httpd.conf
egrep "RewriteEngine|RewriteCond|RewriteRule" httpd.conf
tail -10 httpd.conf
###################################################
echo -e "RewriteEngine on\nRewriteCond {REQUEST_METHOD} ^(TRACE|TRACK)\nRewriteRule .* - [F]" >>httpd.conf
tail -5 httpd.conf
egrep "RewriteEngine|RewriteCond|RewriteRule" httpd.conf
############################################
netstat -lntup | grep httpd
ps -ef |grep http
/application/apache/bin/apachectl stop
ps -ef |grep http
netstat -lntup | grep httpd
/application/apache/bin/apachectl start
ps -ef |grep http
netstat -lntup | grep httpd