本次针对 Appscan漏洞 Authentication Bypass Using HTTP Verb Tampering(HTTP动词篡改致使的认证旁路)进行总结,以下:html
1. Authentication Bypass Using HTTP Verb Tampering
1.一、攻击原理
不安全的HTTP方法PUT/DELETE/MOVE/COPY/TRACE/PROPFIND/PROPPATCH/MKCOL/LOCK/UNLOCK容许攻击者修改web服务器文件、删除web页面、甚至上传web shell获取用户的身份信息等,它们都有可能制造出严重的安全漏洞,开发人员须要对HTTP请求类型进行控制,防止服务器资源被非受权篡改。java
1.二、案例分析
APPSCAN用无心义的HTTP动词bogus向服务端发起请求,系统正常返回,显示此系统未对http请求类型进行判断限制,存在HTTP动词篡改漏洞。web
BOGUS /fams/admin/j_security_check HTTP/1.1
Accept-Language: en-US
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://xxx-core-stg1.paic.com.cn/fams/
Host: xxx-core-stg1.paic.com.cn
User-Agent: Mozilla/4.0 (compatible; MSIE 9.0; Win32)
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 477
Date: Wed, 14 Mar 2018 01:56:23 GMT
1.三、防护建议
1. 限制http method,如仅容许GET、POST等类型shell
2. 使用J2EE标准中提供的Filter方法进行请求类型过滤apache
3. 检查tomcat的web.xml,weblogic的weblogic.xml配置,对请求类型进行限制,如:tomcat
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>HEAD</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint></auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
4. Struts中使用request.getMethod方法添加请求拦截器,如:安全
if(method.equalsIgnoreCase("post")||method.equalsIgnoreCase("get")||method.equalsIgnoreCase("head")||method.equalsIgnoreCase("trace")||method.equalsIgnoreCase("connect")||method.equalsIgnoreCase("options")){}
5. 禁用IIS的WebDAV功能,WebDAV基于 HTTP 1.1 的一个通讯协议,它为 HTTP 1.1 添加了一些除GET,POST,HEAD以外的方法,使得应用程序能够直接将文件写到 Web Server 上。服务器
6. apache的httpd.conf文件中进行以下限制app
<Location />
<LimitExcept GET POST HEAD CONNECT OPTIONS>
Order Allow,Deny
Deny from all
</LimitExcept>
</Location>
1.四、实际修复方案
一、服务器能够分为Tomcat和WebSphere(WAS)两种,本地为Tomcat,加下2的配置方式,下3的方式主要是针对WAS服务器的。post
二、在web.xml文件中加以上的 <security-constraint> 配置。
三、 若是是请求的静态资源,把下属字段另存为文件.htaccess 放到静态资源的文件夹下面。
<LimitExcept GET POST >
Order deny,allow
Deny from all
</LimitExcept>
动态资源的话,须要在java 代码里面实现。
参考下官网的limitexcept指令,IHS 就是基于apache,语法同样的。