window环境
进行安全漏洞扫描时:发送敏感信息时,始终使用 SSL 和 POST(主体)参数。
打开dos,在dos下输入一下命令
keytool -genkey -v -alias tomcat -keyalg RSA -keystore D:tomcatkeystorestomcat.keystore -validity 36500
打开你自己的tomcat下的 D:tomcatconf 下的l 文件
找到<Connector port=“8443” 并按照下面的方法进行设置,一般这个端口是被注释调用的,只需要把注释放开并作修改就可以了
<Connector port="8443" protocol="http11.Http11Protocol"maxThreads="150" SSLEnabled="true" scheme="https" secure="true"clientAuth="false" sslProtocol="TLS" keystoreFile="D:\tomcat\keystores\tomcat.keystore" keystorePass="aaa111"/>
此时访问:localhost:8443/ 时会出现,表示https一配置好,但是当我们访问localhost:8089/ 时还是可以正常访问,这样就绕过了ssl的验证,还没有解决开头的漏洞问题,需要强制将http请求重定向到https请求才可以。
打开你自己的tomcat下的 D:tomcatconf 下的l 文件,在</welcome-file-list>后面
加上以下内容
<login-config> <!-- Authorization setting for SSL --> <auth-method>CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint> <!-- Authorization setting for SSL --> <web-resource-collection > <web-resource-name >SSL</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
此时访问:localhost:8089/ 就会从定向到 localhost:8443/
本文发布于:2024-02-02 07:37:55,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170683067642328.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |