Apache 启用虚拟主机http重定向或SSL/443启用时,TraceEnable off不工作
早上好 我目前正在对内部webapps上的服务器扫描进行修复,需要验证端口80和443是否都未启用跟踪方法。我正在centos 6上运行apache 2.4。我在/etc/httpd/conf/httpd.conf中设置了Apache 启用虚拟主机http重定向或SSL/443启用时,TraceEnable off不工作,apache,trace,httpd.conf,http-redirect,Apache,Trace,Httpd.conf,Http Redirect,早上好 我目前正在对内部webapps上的服务器扫描进行修复,需要验证端口80和443是否都未启用跟踪方法。我正在centos 6上运行apache 2.4。我在/etc/httpd/conf/httpd.conf中设置了TraceEnable关。但是,当我尝试验证此方法是否确实已关闭时,使用telnet从我的桌面连接到远程服务器,我得到以下结果: 输入: #telnet与端口80上的远程主机建立连接 telnet 80 #运行跟踪方法 TRACE/HTTP/1.0 输出: 'Trying &l
TraceEnable关。但是,当我尝试验证此方法是否确实已关闭时,使用telnet从我的桌面连接到远程服务器,我得到以下结果:
输入:
#telnet与端口80上的远程主机建立连接
telnet 80
#运行跟踪方法
TRACE/HTTP/1.0
输出:
'Trying <my_remote_ip>...
Connected to <my_remote_ip>.
Escape character is '^]'.
TRACE / HTTP/1.0
Host: test
HTTP/1.1 302 Found
Date: Sat, 19 Sep 2020 12:27:22 GMT
Server: Apache/2.4.43 (IUS) OpenSSL/1.0.1e-fips
Location: https://<my_remote_ip>
Content-Length: 205
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://<my_remote_ip>">here</a>.</p>
</body></html>
Connection closed by foreign host'
正在尝试。。。
连接到。
转义字符为“^]”。
TRACE/HTTP/1.0
主持人:测试
找到HTTP/1.1 302
日期:2020年9月19日星期六12:27:22 GMT
服务器:Apache/2.4.43(IUS)OpenSSL/1.0.1e-fips
地址:https://
内容长度:205
连接:关闭
内容类型:text/html;字符集=iso-8859-1
302发现
建立
文档已移动
外部主机的连接已关闭
我的/etc/httpd/conf/httpd.conf文件包含:
TraceEnable off
<VirtualHost <my_remote_ip>:80>
ServerAdmin admin@localhost.com
DocumentRoot /var/www/html/
ServerName <my_remote_ip>
Redirect / https://<my_remote_ip>/
ErrorLog /var/www/html/error.log
CustomLog /var/www/html/requests.log common
</VirtualHost>
可跟踪关闭
服务器管理员admin@localhost.com
DocumentRoot/var/www/html/
服务器名
重定向/https:///
ErrorLog/var/www/html/error.log
CustomLog/var/www/html/requests.log common
如果我注释掉重定向,它将返回所需的输出:
Trying <my_remote_ip>...
Connected to <my_remote_ip>.
Escape character is '^]'.
TRACE / HTTP/1.0
Host: test
HTTP/1.1 405 Method Not Allowed
Date: Sat, 19 Sep 2020 12:21:28 GMT
Server: Apache/2.4.43 (IUS) OpenSSL/1.0.1e-fips
Allow:
Content-Length: 222
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method TRACE is not allowed for this URL.</p>
</body></html>
Connection closed by foreign host.
正在尝试。。。
连接到。
转义字符为“^]”。
TRACE/HTTP/1.0
主持人:测试
不允许使用HTTP/1.1 405方法
日期:2020年9月19日星期六12:21:28 GMT
服务器:Apache/2.4.43(IUS)OpenSSL/1.0.1e-fips
允许:
内容长度:222
连接:关闭
内容类型:text/html;字符集=iso-8859-1
405方法不允许
方法不允许
此URL不允许请求的方法跟踪
连接被外部主机关闭。
至于端口443,我猜是另一个问题,但如果有人想知道:
#telnet到端口443上的远程主机建立连接
telnet 443
#当我尝试运行trace时,它会立即断开连接
TRACE/HTTP/1.0
输出:
'Trying <my_remote_ip>...
Connected to <my_remote_ip>.
Escape character is '^]'.
TRACE / HTTP/1.0
Host: test
HTTP/1.1 302 Found
Date: Sat, 19 Sep 2020 12:27:22 GMT
Server: Apache/2.4.43 (IUS) OpenSSL/1.0.1e-fips
Location: https://<my_remote_ip>
Content-Length: 205
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://<my_remote_ip>">here</a>.</p>
</body></html>
Connection closed by foreign host'
连接已被外部主机关闭。
但是,如果我从localhost尝试,它会给出所需的方法拒绝(如上所示)
如果有人能帮助解决80号端口的问题,那就太好了。我不确定我的IT部门是否会接受重定向消息
提前感谢您的帮助或建议