slow_http_dos tomcat

来源:互联网 发布:淘宝网怎么游专营店 编辑:程序博客网 时间:2024/06/05 11:05

原理:通过并发连接池进行的慢速读攻击(基于TCP持久时间)等。慢速攻击基于HTTP协议,通过精心的设计和构造,这种特殊的请求包会造成服务器延时,而当服务器负载能力消耗过大即会导致拒绝服务

解决方案:
1 设置Tomcat / server.xml文件    connectiontimeout 值,默认为20000ms,修改为8000ms(Tomcat 自身安全漏洞)

2 设置AJAX的全局timeout时间(默认为30000ms) $.ajaxSetup({timeout:8000});


3.3  If possible, you should set the Secure flag for this cookie,set the HTTPOnly flag for this cookie解决方案
(Tomcat 自身安全漏洞)设置设置Tomcat / web.xml文件:

<session-config>
        <session-timeout>30<session-timeout>
        <cookie-config>
           <secure>true<secure>
           <http-only>true<http-only>
        </cookie-config>

<session-config> 

2 在Login .jsp主页面加入:
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; secure ; HttpOnly");