问题描述
早上好
我目前正在对内部Webapp上的服务器扫描进行补救,并且需要验证端口80和443均未启用Trace方法。我正在centos 6上运行apache 2.4。我已设置{{1} } /etc/httpd/conf/httpd.conf中。但是,当我尝试验证该方法确实关闭时,使用telnet从我的桌面到远程服务器,我得到以下信息:
输入:
#telnet与端口80上的远程主机建立连接
telnet
80
#运行跟踪方法
TRACE / HTTP / 1.0
输出:
TraceEnable off
我的/etc/httpd/conf/httpd.conf文件具有:
'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'
如果我注释掉重定向,它将返回所需的输出:
TraceEnable off
<VirtualHost <my_remote_ip>:80>
ServerAdmin [email protected]
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>
对于443端口,我猜是一个不同的问题,但如果有人想知道的话,还包括:
#telnet与端口443上的远程主机建立连接
telnet 443
#当我尝试运行跟踪时,它会立即断开连接
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 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.
但是,如果我从localhost尝试,它会拒绝所需的方法(如上所示)。
如果任何人都可以帮助解决80端口的问题,那将是非常有用的。我不确定我的IT部门是否会接受重定向消息。
提前感谢您的帮助或建议!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)