CN106230863B - 一种基于WAF的ReDoS攻击检测方法 - Google Patents

一种基于WAF的ReDoS攻击检测方法 Download PDF

Info

Publication number
CN106230863B
CN106230863B CN201610831750.2A CN201610831750A CN106230863B CN 106230863 B CN106230863 B CN 106230863B CN 201610831750 A CN201610831750 A CN 201610831750A CN 106230863 B CN106230863 B CN 106230863B
Authority
CN
China
Prior art keywords
redos
waf
possibility
attack
parameter value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610831750.2A
Other languages
English (en)
Other versions
CN106230863A (zh
Inventor
赵乾
抄水明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Zhidaochuangyu Information Technology Co Ltd
Original Assignee
Chengdu Zhidaochuangyu Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Zhidaochuangyu Information Technology Co Ltd filed Critical Chengdu Zhidaochuangyu Information Technology Co Ltd
Priority to CN201610831750.2A priority Critical patent/CN106230863B/zh
Publication of CN106230863A publication Critical patent/CN106230863A/zh
Application granted granted Critical
Publication of CN106230863B publication Critical patent/CN106230863B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1458Denial of Service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种基于WAF的ReDoS攻击检测方法,包括以下步骤:WAF采用TCP代理方式接入,检测用户的输入数据,提取GET或POST中的参数值;判断所提取的参数值的长度,启动一个检测跟踪周期;判断所提取的参数值中选定的一个字符的重复次数;判断该请求提交后服务器响应页面时间;当同一个客户端IP再次提交请求到同一个页面,且同一个参数值长度大于30字节,ReDoS攻击可能性增加30%;若同一个客户端IP再次提交请求到相同域名的不同页面,且参数值长度大于30字节,ReDoS攻击可能性增加10%;一个周期结束后,根据相加的ReDoS可能性数值,WAF提示告警。本发明从ReDoS发生的可能性上为Web资产所有者提供安全参考或防护。

Description

一种基于WAF的ReDoS攻击检测方法
技术领域
本发明涉及ReDoS攻击检测领域,具体涉及一种基于WAF的ReDoS攻击检测方法。
背景技术
越来越多的交互式网站采用正则表达式来验证用户信息的真实与有效性,如注册时的用户名、邮箱地址、URL地址等。开发人员编写的正则表达式可能存在缺陷。
正则表达式的匹配算法会创建一个不确定有限状态自动机(NFA),这个‘状态机’会尝试有限次匹配所有可能的情况,直至发现一个匹配,或者最终没有一个匹配。这种机制使得使用NFA方式编译的正则表达式匹配方法存在一个潜在的缺陷:要匹配一个正则表达式可能很简单,但要否定一个匹配则需要否定所有可能的匹配路径。
例如正则表达式为^(a+)+$,用来匹配字符串aaaaX,则根据如下NFA状态机,必须经历16次尝试失败后,才能否定这个匹配。如果字符串为aaaaaaaaaaaaaaaaX,则必须经过65536次否定才能否定这个匹配。
以下5个示例是典型的、存在缺陷的正则表达式写法示例:
·(a+)+
·([a-zA-Z]+)*
·(a|aa)+
·(a|a?)+
·(.*a){x}|for x>10
从此正则表达式示例可知,如果使用字符串aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!进行测试,则会造成ReDoS。
现在检测技术实为一种人工渗透测试技术:从静态分析入手,检测网页源代码中可能存在的有漏洞的正则表达式,从渗透测试的角度对提取到的正则表达式进行动态测试,给出相应的漏洞防范措施,从而确保Web应用系统的可用性,该方法准确性较高。详情可参考《杭州电子科技大学学报》2011年05期《Web应用中ReDoS检测方法研究》。现有技术需要人工鉴别,耗时多,成本高,较难挖掘站点中所有的ReDoS攻击点。
相关术语:
RegEx:正则表达式,计算机科学中使用单个字符串来描述、匹配一系列符合某个句法规则的一个概念。
NFA:非确定有限状态自动机(Nondeterministic Finite Automata),是对每个状态和输入符号可以有多个可能的下一个状态的有限状态自动机。
DoS:拒绝服务攻击(Denial of Service Attack)是一种网络攻击手法,其目的在于使目标电脑的网络或系统资源耗尽,使服务暂时中断或停止,导致其对目标客户不可用。
ReDoS:正则表达式DoS攻击是编写的正则表达式有缺陷,攻击者可以构造特殊的字符串来大量消耗服务器的系统资源,造成服务器的服务中断或停止。
WAF:Web应用防护系统(也称:网站应用级入侵防御系统。英文:Web ApplicationFirewall),通常部署在客户端和网站服务器之间,用于防护网站服务器。
发明内容
本发明所要解决的技术问题是提供一种基于WAF的ReDoS攻击检测方法,从ReDoS攻击方法上提取特征,在WAF设备上进行攻击可能性检测,以助于Web资源所有者规避安全风险。
为解决上述技术问题,本发明采用的技术方案是:
一种基于WAF的ReDoS攻击检测方法,包括以下步骤:
步骤1:WAF采用TCP代理方式接入,检测用户的输入数据,提取GET或POST中的参数值;
步骤2:判断所提取的参数值的长度,若长度大于30字节,启动一个检测跟踪周期,跟踪源IP地址、域名、访问页面三个元素;
步骤3:判断所提取的参数值中选定的一个字符的重复次数,若所述字符重复次数大于等于30,并且该字符或字符串后面紧跟的字符为不同字符或符号时,ReDoS攻击可能性增加60%;
步骤4:判断该请求提交后服务器响应页面时间,若响应页面时间大于3秒,ReDoS攻击可能性增加30%,每增加1秒,ReDoS攻击可能性增加5%,累计最大为50%;
步骤5:当同一个客户端IP再次提交请求到同一个页面,且同一个参数值长度大于30字节,ReDoS攻击可能性增加30%,一个周期内每增加一个同类型请求,ReDoS攻击可能性增加5%,累计最大为50%;
步骤6:若同一个客户端IP再次提交请求到相同域名的不同页面,且参数值长度大于30字节,ReDoS攻击可能性增加10%;
步骤7:一个周期结束后,将ReDoS攻击可能性值相加,根据ReDoS可能性数值,WAF提示告警。
根据上述方案,所述步骤7中WAF提示告警的判据是:最终相加的ReDoS可能性值大于99%。
根据上述方案,WAF提示告警的信息包括可能的攻击者IP、被攻击页面、被攻击页面的对应参数。
与现有技术相比,本发明的有益效果是:本发明从WEB防护设备或代理防护软件出发,提取ReDoS攻击的典型手法,从ReDoS发生的可能性上为Web资产所有者提供安全参考或防护。
附图说明
图1是现有典型的正则表达式示例图。
具体实施方式
下面结合附图和具体实施方式对本发明作进一步详细的说明。本发明以逆向观点,从攻击者的攻击行为出发,提取ReDoS攻击时的典型特征,根据WAF设备所能识别的用户行为,综合判断攻击可能性,定义防御行为。
WAF采用TCP代理方式接入,检测用户的输入数据,提取GET或POST中的参数值,进行如下判定,如果:
1、某一个参数值长度大于30字节,启动一个检测跟踪周期,例如3分钟,跟踪源IP地址、域名、访问页面三个元素。
2.1、如果这个参数值中某一个字符重复次数大于等于30,并且该字符或字符串后面紧跟的字符为不同字符或符号时,ReDoS攻击可能性增加60%。
2.2、如果这个请求提交后服务器响应页面时间大小3秒,ReDoS攻击可能性增加30%;每增加1秒,ReDoS攻击可能性增加5%,累计最大达到50%。
2.3、如果同一个客户端IP再次提交请求到同一个页面,且同一个参数值长度大于30字节,ReDoS攻击可能性增加30%,一个周期内每增加一个同类型请求,ReDoS攻击可能性增加5%,累计最大为50%。
2.4、如果同一个客户端IP再次提交请求到相同域名的不同页面,且参数值长度大于30字节,ReDoS攻击可能性增加10%。
3、一个周期结束后,将ReDoS攻击可能性值相加,最终结果值最大99%,WAF提示告警:报告可能的攻击者IP、被攻击页面、被攻击页面的对应参数。
4、还可自定义策略,当ReDoS攻击可能性大于某阀值时在某一时间段内拦截攻击者IP的所有访问请求,默认不拦截。

Claims (3)

1.一种基于WAF的ReDoS攻击检测方法,其特征在于,包括以下步骤:
步骤1:WAF采用TCP代理方式接入,检测用户的访问请求数据,提取GET或POST中的参数值;
步骤2:判断所提取的参数值的长度,若长度大于30字节,启动一个检测跟踪周期,跟踪源IP地址、域名、访问页面三个元素;
步骤3:判断所提取的参数值中选定的一个字符的重复次数,若所述字符重复次数大于等于30,并且该字符或字符串后面紧跟的字符为不同字符或符号时,ReDoS攻击可能性增加60%;
步骤4:判断该请求提交后服务器响应页面时间,若响应页面时间大于3秒,ReDoS攻击可能性增加30%,每增加1秒,ReDoS攻击可能性增加5%,累计最大为50%;
步骤5:当同一个客户端IP再次提交请求到同一个页面,且同一个参数值长度大于30字节,ReDoS攻击可能性增加30%,一个周期内每增加一个同类型请求,ReDoS攻击可能性增加5%,累计最大为50%;
步骤6:若同一个客户端IP再次提交请求到相同域名的不同页面,且参数值长度大于30字节,ReDoS攻击可能性增加10%;
步骤7:一个周期结束后,将ReDoS攻击可能性值相加,根据ReDoS可能性数值,WAF提示告警。
2.如权利要求1所述的一种基于WAF的ReDoS攻击检测方法,其特征在于,所述步骤7中WAF提示告警的判据是:最终相加的ReDoS可能性值大于99%。
3.如权利要求1或2所述的一种基于WAF的ReDoS攻击检测方法,其特征在于,WAF提示告警的信息包括可能的攻击者IP、被攻击页面、被攻击页面的对应参数。
CN201610831750.2A 2016-09-19 2016-09-19 一种基于WAF的ReDoS攻击检测方法 Active CN106230863B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610831750.2A CN106230863B (zh) 2016-09-19 2016-09-19 一种基于WAF的ReDoS攻击检测方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610831750.2A CN106230863B (zh) 2016-09-19 2016-09-19 一种基于WAF的ReDoS攻击检测方法

Publications (2)

Publication Number Publication Date
CN106230863A CN106230863A (zh) 2016-12-14
CN106230863B true CN106230863B (zh) 2019-05-07

Family

ID=58076037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610831750.2A Active CN106230863B (zh) 2016-09-19 2016-09-19 一种基于WAF的ReDoS攻击检测方法

Country Status (1)

Country Link
CN (1) CN106230863B (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055227B (zh) * 2017-08-08 2020-10-20 西安交大捷普网络科技有限公司 基于站点自学习的waf未知攻击防御方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070060869A (ko) * 2005-12-09 2007-06-13 한국전자통신연구원 비정상 패킷 탐지 방법 및 장치
CN105337985A (zh) * 2015-11-19 2016-02-17 北京师范大学 一种攻击检测方法及系统
CN105516196A (zh) * 2016-01-19 2016-04-20 国家计算机网络与信息安全管理中心江苏分中心 基于http报文数据的并行化网络异常检测方法与系统
CN105786981A (zh) * 2016-02-15 2016-07-20 南京贝伦思网络科技股份有限公司 基于Hash表的host和URL关键字策略匹配方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9507563B2 (en) * 2013-08-30 2016-11-29 Cavium, Inc. System and method to traverse a non-deterministic finite automata (NFA) graph generated for regular expression patterns with advanced features

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070060869A (ko) * 2005-12-09 2007-06-13 한국전자통신연구원 비정상 패킷 탐지 방법 및 장치
CN105337985A (zh) * 2015-11-19 2016-02-17 北京师范大学 一种攻击检测方法及系统
CN105516196A (zh) * 2016-01-19 2016-04-20 国家计算机网络与信息安全管理中心江苏分中心 基于http报文数据的并行化网络异常检测方法与系统
CN105786981A (zh) * 2016-02-15 2016-07-20 南京贝伦思网络科技股份有限公司 基于Hash表的host和URL关键字策略匹配方法

Also Published As

Publication number Publication date
CN106230863A (zh) 2016-12-14

Similar Documents

Publication Publication Date Title
Deepa et al. Securing web applications from injection and logic vulnerabilities: Approaches and challenges
CN110233849B (zh) 网络安全态势分析的方法及系统
Ingham et al. Comparing anomaly detection techniques for http
Lee et al. A novel method for SQL injection attack detection based on removing SQL query attribute values
US8024804B2 (en) Correlation engine for detecting network attacks and detection method
Okereafor et al. Tackling the cybersecurity impacts of the corona virus outbreak as a challenge to internet safety
Song et al. Advanced evasion attacks and mitigations on practical ML‐based phishing website classifiers
EP3566166B1 (en) Management of security vulnerabilities
CN111786966A (zh) 浏览网页的方法和装置
Alenezi et al. SQL injection attacks countermeasures assessments
JP2018533793A (ja) ドメイン生成アルゴリズム(dga)のマルウェアを検出するためのシステムおよび方法
WO2020110109A1 (en) Phishing protection methods and systems
US20170155683A1 (en) Remedial action for release of threat data
Ramesh et al. Identification of phishing webpages and its target domains by analyzing the feign relationship
Gowtham et al. PhishTackle—a web services architecture for anti-phishing
Shyni et al. Phishing detection in websites using parse tree validation
CN106230863B (zh) 一种基于WAF的ReDoS攻击检测方法
Wen et al. Detecting malicious websites in depth through analyzing topics and web-pages
JP7439916B2 (ja) 学習装置、検出装置、学習方法、検出方法、学習プログラムおよび検出プログラム
Orunsolu et al. An Anti-Phishing Kit Scheme for Secure Web Transactions.
Patil et al. Automated Client-side Sanitizer for Code Injection Attacks
Stephen et al. Prevention of cross site scripting with E-Guard algorithm
Veerabudren et al. Security in web applications: A comparative analysis of key SQL Injection Detection Techniques
Gupta Comparison of classification algorithms to detect phishing web pages using feature selection and extraction
Park Text-based phishing detection using a simulation model

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 9/F, Building C, No. 28, North Tianfu Avenue, China (Sichuan) Pilot Free Trade Zone, Hi tech Zone, Chengdu, 610000, Sichuan

Patentee after: CHENGDU KNOWNSEC INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 8th Floor, Building 5, No. 801, Middle Section of Tianfu Avenue, High tech Zone, Chengdu City, Sichuan Province, 610000

Patentee before: CHENGDU KNOWNSEC INFORMATION TECHNOLOGY Co.,Ltd.