Attack detection method, device, equipment and storage medium

By identifying the tags and external links in the request traffic, combining black and white lists, substrings and feature detection, the problem of high error detection rate of XSS external link attack detection in the prior art is solved, and more accurate attack traffic identification and interception is achieved.

CN114006746BActive Publication Date: 2024-12-03SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111263747.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2024-12-03
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

The existing XSS external link attack detection technology has a high misjudgment rate, which cannot accurately identify attack traffic, affecting the user experience.

Method used

By identifying the tags in the request traffic, determining the pending external link, determining whether it contains attack information, using black and white lists, dangerous substrings and bypass features for multi-dimensional detection, obtaining the target file to determine whether it contains attack features, and then determining the request Traffic is attack or normal traffic.

Benefits of technology

It improves the accuracy of XSS external link attack detection, reduces the misjudgment rate, and ensures accurate interception and release of requested traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114006746B_ABST
    Figure CN114006746B_ABST
Patent Text Reader

Abstract

The present invention discloses an attack detection method, including: identifying a label in a request flow; determining an external link to be processed from the label; judging whether the external link to be processed contains attack information; if the external link to be processed contains attack information, judging the request flow to be attack flow; if the external link to be processed does not contain attack information, judging the request flow to be normal flow. It can be seen that in this scheme, if the request flow contains an external link, it will not be directly intercepted, but it is necessary to detect whether the external link to be processed contains attack information. If it contains attack information, it will be judged as attack flow and needs to be intercepted. In this way, the accuracy of XSS external link attack detection can be improved and the misjudgment rate can be reduced; the present invention also discloses an attack detection device, equipment and storage medium, which can also achieve the above technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more specifically, to an attack detection method, device, equipment and storage medium. Background Art

[0002] Cross Site Script Attack (XSS) is one of the most common security vulnerabilities in Web (World Wide Web) applications. This type of vulnerability allows attackers to embed malicious script code into pages that normal users visit. When normal users visit the page, the embedded malicious script code will be executed, thereby achieving the purpose of maliciously attacking users. Usually in actual XSS attacks, external links are introduced to expand the attack, for example: for tags<scriptsrc=www.xss.cn / 1.js> It tries to get the 1.js script from the external link www.xss.cn and execute it, which brings security risks.

[0003] The common XSS external link attack detection technology currently can directly identify whether an external link is introduced in the request packet. If an external link is detected, the request packet is directly intercepted. However, although this detection method can detect more external links, it will cause more misjudgments and affect customer use. Summary of the invention

[0004] The purpose of the present invention is to provide an attack detection method, device, equipment and storage medium to improve the detection accuracy of XSS external link attacks and reduce misjudgments.

[0005] To achieve the above object, the present invention provides an attack detection method, comprising:

[0006] Identify tags in request traffic;

[0007] Determine the external links to be processed from the tags;

[0008] Determine whether the external link to be processed contains attack information;

[0009] If the external link to be processed contains attack information, the request traffic is determined to be attack traffic; if the external link to be processed does not contain attack information, the request traffic is determined to be normal traffic.

[0010] Wherein, determining the external link to be processed from the tag includes:

[0011] The attributes of the tag and the Js code are used to determine the external links to be processed.

[0012] Wherein, the determining whether the to-be-processed external link contains attack information includes:

[0013] Extract target information from the external link to be processed; the target information includes a domain name and an IP address;

[0014] Matching the target information with the blacklist and whitelist in the intelligence database;

[0015] If the target information is in the blacklist, it is determined that the external link to be processed contains attack information; if the target information is in the whitelist, it is determined that the external link to be processed does not contain attack information.

[0016] Wherein, if the target information is not in the blacklist and the whitelist, the attack detection method further includes:

[0017] Detecting whether the external link to be processed contains a target substring; the target substring is a pre-set dangerous substring with attack characteristics;

[0018] If the target information includes a target substring, it is determined that the external link to be processed contains attack information.

[0019] Wherein, if the target information does not include the target substring, the attack detection method further includes:

[0020] determining whether the tag contains a bypass feature;

[0021] If the tag contains a bypass feature, it is determined that the external link to be processed contains attack information.

[0022] The bypass feature includes: a string concatenation feature and / or a string assignment feature.

[0023] Wherein, if the tag does not contain a bypass feature, the attack detection method further includes:

[0024] Obtain the target file introduced by the external link to be processed;

[0025] Determining whether the target file contains attack features;

[0026] If the attack feature is included, it is determined that the external link to be processed contains attack information; if the attack feature is not included, it is determined that the external link to be processed does not contain attack information.

[0027] To achieve the above object, the present invention further provides an attack detection device, comprising:

[0028] An identification module, used to identify tags in request traffic;

[0029] A determination module, used for determining the external links to be processed from the tags;

[0030] A judgment module, used to judge whether the external link to be processed contains attack information;

[0031] A first determination module, configured to determine that the request traffic is attack traffic when the external link to be processed contains attack information;

[0032] The second determination module is used to determine that the request traffic is normal traffic when the external link to be processed does not contain attack information.

[0033] To achieve the above object, the present invention further provides an electronic device, comprising:

[0034] Memory for storing computer programs;

[0035] A processor is used to implement the steps of the above attack detection method when executing a computer program.

[0036] To achieve the above object, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above attack detection method are implemented.

[0037] It can be seen from the above scheme that an attack detection method provided by an embodiment of the present invention includes: identifying a label in a request flow; determining an external link to be processed from the label; judging whether the external link to be processed contains attack information; if the external link to be processed contains attack information, judging the request flow to be attack flow; if the external link to be processed does not contain attack information, judging the request flow to be normal flow.

[0038] It can be seen that in this scheme, if the request traffic contains external links, it will not be intercepted directly, but it is necessary to detect whether the external links to be processed contain attack information. If it contains attack information, it will be determined as attack traffic and needs to be intercepted. In this way, the accuracy of XSS external link attack detection can be improved and the misjudgment rate can be reduced. The present invention also discloses an attack detection device, equipment and storage medium, which can also achieve the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 A schematic diagram of a flow chart of an attack detection method disclosed in an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of another attack detection method flow disclosed in an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of the structure of an attack detection device disclosed in an embodiment of the present invention;

[0043] Figure 4 The present invention is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] At present, common XSS external link attack detection technologies include a rule-based "one-size-fits-all" approach, which usually means: auditing dangerous features of request packets. For example, if a tag introduces an external link, the tag that introduces the external link will be directly intercepted through the rule. For example: Based on the rule detection tag:<ahref=www.baidu.com> , and the tag has an external link: www.baidu.com, then the tag will be directly intercepted. However, this tag is a tag that jumps to Baidu, not an attacking tag, so this method will inevitably generate a large number of false positives.

[0045] Therefore, in this embodiment, an attack detection method, apparatus, device and storage medium are disclosed to improve the detection accuracy of XSS external link attacks and reduce misjudgments.

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] See also Figure 1 , is a flow chart of an attack detection method disclosed in an embodiment of the present invention, through Figure 1 It can be seen that the method specifically includes the following steps:

[0048] S101, identifying labels in request traffic;

[0049] Specifically, the request traffic in this embodiment refers to the request message from the client to the server, including: request line, request header, request body, etc. The label in this embodiment specifically refers to the label that can introduce external links, such as: a label, script label, img label, ifram label, etc., which are not specifically limited here; this solution can identify the above labels from the request traffic, so as to determine whether the request traffic is attack traffic by detecting the external links in the label.

[0050] S102, determining the external links to be processed from the tags;

[0051] In this solution, external links refer to links from other websites to one's own website. After identifying the tag, this solution can use the tag's attributes and Js (JavaScript, programming language) code to determine the external links to be processed. Among them, the tag's attribute refers to an event attribute in the html (Hyper Text Markup Language, Hypertext Markup Language) code, such as: href, src. After identifying the above attributes, the content of the attribute is the link in the tag.

[0052] Such as: label <a href=baidu.com>The href in href is an attribute. The specific link after the equal sign of href is the external link, that is, baidu.com is an external link. Similarly, the tag <img src=attack.com> The src in the tag is an attribute. The specific link after the equal sign of src is the external link, that is, attack.com is an external link. <script src=xss.com>中的src为属性,src的等号后的具体链接即为外链,也即:xss.com为外链;标签<iframe src=xss123.com>中的src为属性,src的等号后的具体链接即为外链,也即:xss123.com为外链。

[0053] 并且,XSS攻击的外链还可以通过Js代码进行引入,Js中引入外链的形式相较于通过标签引入复杂些,例如:在标签<script>location.href

[0054] ='attac'+'k.com'< / script> In the example, 'attac'+'k.com' can be extracted from the Js code. It should be noted that in this embodiment, only the above two methods of identifying external links are used as examples to illustrate this solution, but it is not limited to this, and other methods can also be used to identify and extract external links.

[0055] S103, determine whether the external link to be processed contains attack information; if so, execute S104; if not, execute S105;

[0056] S104, determining that the request traffic is attack traffic;

[0057] S105: Determine whether the requested traffic is normal traffic.

[0058] At present, in the relevant scheme, if the label in the request flow introduces an external link, the request flow will be directly intercepted as an attack flow, and this method will result in more misjudgments. Therefore, in this embodiment, in order to detect more accurately, it is necessary to extract the external link and detect it as a to-be-processed external link, so as to determine whether the request flow needs to be intercepted by re-detection. In this embodiment, the detection of the to-be-processed external link is mainly to detect whether the to-be-processed external link contains attack information. If it contains attack information, the request flow is determined to be attack flow. If it does not contain attack information, the request flow is determined to be normal flow. This method can improve the detection accuracy. It can be understood that in this embodiment, the judgment method of whether the to-be-processed external link contains attack information is not specifically limited, and it can be set according to actual needs. For example, it can be detected through a blacklist whether the to-be-processed external link contains an attack letter, or through a whitelist whether the to-be-processed external link contains an attack letter, or directly detect whether the to-be-processed external link contains a dangerous substring to determine whether the to-be-processed external link contains an attack letter, etc.

[0059] From the above, it can be seen that in this solution, if the request traffic contains external links, it will not be intercepted directly. Instead, it is necessary to detect whether the external links to be processed contain attack information. If it contains attack information, it will be determined as attack traffic and needs to be intercepted. In this way, the accuracy of XSS external link attack detection can be improved and the misjudgment rate can be reduced.

[0060] See also Figure 2 , is a flow chart of another attack detection method disclosed in an embodiment of the present invention, through Figure 2 It can be seen that the method specifically includes the following steps:

[0061] S201, identifying labels in request traffic;

[0062] S202, determining the external links to be processed from the tags;

[0063] S203, extracting target information from the external link to be processed; the target information includes the domain name and IP address;

[0064] S204, matching the target information with the blacklist and whitelist in the intelligence database;

[0065] If the target information is in the whitelist, execute S205; if the target information is in the blacklist, execute S206; if the target information is not in the blacklist or the whitelist, execute S207;

[0066] In this embodiment, when judging whether the external link to be processed contains attack information, the target information can be first extracted from the external link to be processed, and the target information can be a domain name or an IP (Internet Protocol) address; then the extracted target information is matched with the blacklist and whitelist in the intelligence library, the blacklist includes black domain names and black IP addresses, and the whitelist includes white domain names and white IP addresses; if the target information is in the blacklist of the intelligence library, it means that the external link to be processed contains attack information, and the request traffic is determined to be attack traffic, and if the target information is in the whitelist of the intelligence library, it means that the external link to be processed does not contain attack information, and the request traffic is determined to be normal traffic. Among them, if the external link extracted from the Js code is: 'attac'+'k.com', it can be processed to obtain attack.com, and then matched with the black and white lists in the intelligence library.

[0067] It should be noted that, since the traditional black and white lists are relatively fixed, newly emerged attacks or attacks not in the black list will be bypassed, and hard-coded IP addresses will also be bypassed. Therefore, in this embodiment, the black list and white list in the intelligence library are mainly used to match the target information. The black list and white list in the intelligence library will be updated in real time, so that through the black and white lists in the intelligence library, it is possible to accurately determine whether the request traffic is normal traffic or attack traffic. For example: if the target information is baidu.com, and the domain name exists in the white list of the intelligence library, then the request traffic is determined to be normal traffic; if the target information is: attack.com or IP address, and the domain name or IP address exists in the black list, then the request traffic is determined to be attack traffic. In addition, in this embodiment, if the domain name in the target information is identified to have a government unit or school suffix, the request traffic can be directly determined to be normal traffic, such as: domain names in the form of xxx.edu.cn and xxx.gov.cn are normal traffic.

[0068] S205, determining that the external link to be processed does not contain attack information, and determining that the request traffic is normal traffic;

[0069] S206, determining that the external link to be processed contains attack information, and determining that the request traffic is attack traffic;

[0070] S207, detecting whether the external link to be processed contains a target substring; the target substring is a pre-set dangerous substring with attack characteristics; if so, executing S206; if not, executing S208;

[0071] It should be noted that when an attacker creates a new domain name, it usually includes a dangerous string. Therefore, in this embodiment, if the target information is neither in the blacklist nor in the whitelist, in order to further detect whether the target information has attack information, it can be determined whether there is a target substring in the domain name of the external link to be processed. The target substring is a pre-set dangerous substring with attack characteristics, such as hack, attack, etc. Therefore, if the external link to be processed contains the target substring, the request traffic is determined to be attack traffic; for example: if the domain name in the external link to be processed is: xss123.com, the substring xss can be extracted from it, and if the domain name in the external link to be processed is: xssabc.cn, the substring xss can be extracted from it, and then the substring in the above domain name is determined to be the target substring. The method determines whether the external link to be processed contains attack information. Through this method, the domain name that is no longer in the blacklist and whitelist can be processed, and the blacklist and whitelist identification is complementary, so that this scheme has a certain generalization ability.

[0072] S208, determining whether the tag contains a bypass feature;

[0073] If yes, execute S206; if no, execute S209;

[0074] In this embodiment, for the to-be-processed external links that do not identify the target substring, it is also possible to confirm whether there is attack information by detecting whether the label contains bypass features. Specifically, the frequency of using bypass features in normal customer traffic requests is extremely low. The bypass features include: string concatenation features and / or string assignment features. Therefore, in this solution, if the label contains bypass features, it is determined that the label has bypass behavior and the to-be-processed external link contains attack information, thereby greatly reducing the possibility of being bypassed. For example: for the label <script>location.href='attac'+'k.com'< / script> , this solution can identify the feature that 'attac'+'k.com' is concatenated with a + sign, and it is determined to contain attack information; such as: tag <script>a="att";b="ack";c=".com";location.href=a+b+c< / script> , this solution can identify the use of string assignment (a = "att"; b = "ack"; c = ".com") and string concatenation (a + b + c) features. Therefore, after identifying the bypass features, this solution will determine that the request traffic is attack traffic, which makes this solution have a certain generalization ability.

[0075] S209, obtaining the target file introduced by the external link to be processed;

[0076] S210, determining whether the target file contains attack features;

[0077] If yes, execute S206; if no, execute S205.

[0078] In this embodiment, if no black domain name, dangerous string or bypass feature is identified in the external link to be processed, that is, this solution cannot determine whether the request traffic is normal traffic or attack traffic only from the traffic side, then this solution also obtains the target file introduced by the external link to be processed, such as a JS file, and analyzes whether the JS file has malicious operations. <script src=http: xxxx.com xxx.js>,本方案还需要获取XSS攻击Payload中的JS文件,到http: / / xxxx.com / 这个网站获取xxx.js文件,并分析其中是否存在攻击特征,如:xxx.js文件中具有获取cookie、定位、截屏、获取浏览器敏感信息等行为特征时,判定该xxx.js文件含有攻击特征,并判定请求流量为攻击流量。

[0079] 需要说明的是,在本实施例中,并不对"将目标信息与情报库中的黑白名单进行匹配”、"检测待处理外链中是否包含目标子串”、"判断标签是否含有绕过特征”、"判断目标文件中是否含有攻击特征”这几个步骤的执行顺序进行限定,可以通过如图2所示的顺序执行,也可以通过其他顺序执行,在此并不具体限定。

[0080] 综上可以看出,本方案中,并不会直接拦截引入外链的标签,而是识别该标签并定位出外链的位置,例如:对于标签<a href=www.baidu.com>,其是一个跳转到百度的标签,本方案会从该标签中识别出外链www.baidu.com,进行后续判断;若该外链中不包括黑域名、危险子串、恶意的js文件、绕过特征,则判定请求流量中不具有攻击信息,那么本方案就会判定请求流量为正常流量,会对该请求流量放行;可见,本方案使用多维度的检测方法,可以大大提升攻击的检测能力和准确率,本方案可适用于Web攻击检测等场景,应用于防火墙和安全态势感知等产品。

[0081] 下面对本发明实施例提供的检测装置、设备及介质进行介绍,下文描述的检测装置、设备及介质与上文描述的检测方法可以相互参照。

[0082] 参见图3,本发明实施例提供的一种攻击检测装置结构示意图,包括:

[0083] 识别模块11,用于识别请求流量中的标签;

[0084] 确定模块12,用于从所述标签中确定待处理外链;

[0085] 判断模块13,用于判断所述待处理外链是否含有攻击信息;

[0086] 第一判定模块14,用于在所述待处理外链含有攻击信息时,判定所述请求流量为攻击流量;

[0087] 第二判定模块15,用于在所述待处理外链不含有攻击信息时,判定所述请求流量为正常流量。

[0088] 其中,该确定模块具体用于利用标签的属性及Js代码确定待处理外链。

[0089] 其中,所述判断模块包括:

[0090] 提取单元,用于从所述待处理外链中提取目标信息;所述目标信息包括域名及IP地址;

[0091] 匹配单元,用于将所述目标信息与情报库中的黑白名单进行匹配;若所述目标信息在黑名单中,则判定所述待处理外链含有攻击信息,若所述目标信息在白名单中,则判定所述待处理外链不含有攻击信息。

[0092] 其中,所述判断模块还包括:

[0093] 检测单元,用于在所述目标信息不在所述黑名单及所述白名单中时,检测所述待处理外链中是否包含目标子串;所述目标子串为预先设定的具有攻击特性的危险子串;若所述述目标信息包含目标子串,则判定所述待处理外链含有攻击信息。

[0094] 其中,所述判断模块还包括:

[0095] 第一判断单元,用于在所述述目标信息不包含目标子串时,判断所述标签是否含有绕过特征;若所述标签含有绕过特征,则判定所述待处理外链含有攻击信息。其中,所述绕过特征包括:字符串拼接特征和 / 或字符串赋值特征。

[0096] 其中,所述判断模块还包括:

[0097] 获取单元,用于在所述标签不含有绕过特征时,获取所述待处理外链引入的目标文件;

[0098] 第二判断单元,用于判断所述目标文件中是否含有攻击特征;若含有攻击特征,则判定所述待处理外链含有攻击信息;若不含有攻击特征,则判定所述待处理外链不含有攻击信息。

[0099] 参见图4,本发明实施例提供的一种电子设备结构示意图,包括:

[0100] 存储器21,用于存储计算机程序;

[0101] 处理器22,用于执行所述计算机程序时实现上述方法实施例所述的攻击检测方法的步骤。

[0102] 在本实施例中,该设备可以防火墙设备及安全态势感知设备等等。

[0103] 该设备可以包括存储器21、处理器22和总线23。

[0104] 其中,存储器21至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器21在一些实施例中可以是设备的内部存储单元,例如该设备的硬盘。存储器21在另一些实施例中也可以是设备的外部存储设备,例如设备上配备的插接式硬盘,智能存储卡(SmartMedia Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器21还可以既包括设备的内部存储单元也包括外部存储设备。存储器21不仅可以用于存储安装于设备的应用软件及各类数据,例如执行检测方法的程序代码等,还可以用于暂时地存储已经输出或者将要输出的数据。

[0105] 处理器22在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器21中存储的程序代码或处理数据,例如执行检测方法的程序代码等。

[0106] 该总线23可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。

[0107] 进一步地,设备还可以包括网络接口24,网络接口24可选的可以包括有线接口和 / 或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该设备与其他电子设备之间建立通信连接。

[0108] 可选地,该设备还可以包括用户接口25,用户接口25可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口25还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-EmittingDiode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在设备中处理的信息以及用于显示可视化的用户界面。

[0109] 图4仅示出了具有组件21-25的设备,本领域技术人员可以理解的是,图4示出的结构并不构成对设备的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。

[0110] 本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述方法实施例所述的攻击检测方法的步骤。

[0111] 其中,该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。

[0112] 本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。

[0113] 对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。< / script>

Claims

1. An attack detection method, characterized in that: include: Identify tags in request traffic; Determine the external link to be processed from the tag; wherein determining the external link to be processed from the tag includes determining the external link to be processed using an attribute of the tag, and the attribute of the tag refers to an event attribute in the HTML code; Determine whether the external link to be processed contains attack information; wherein, the method of determining whether the external link to be processed contains attack information includes matching the target information extracted from the external link to be processed with the black and white lists in the intelligence library, detecting whether the external link to be processed contains a target substring, determining whether the tag contains a bypass feature, and determining whether the target file introduced by the external link to be processed contains an attack feature; the target substring is a pre-set dangerous substring with attack characteristics; If the external link to be processed contains attack information, the request traffic is determined to be attack traffic; if the external link to be processed does not contain attack information, the request traffic is determined to be normal traffic.

2. The attack detection method according to claim 1, characterized in that: The determining of the to-be-processed external link from the tag includes: The attributes of the tag and the Js code are used to determine the external links to be processed.

3. The attack detection method according to claim 1, characterized in that: The determining whether the to-be-processed external link contains attack information includes: Extract target information from the external link to be processed; the target information includes a domain name and an IP address; Matching the target information with the blacklist and whitelist in the intelligence database; If the target information is in the blacklist, it is determined that the external link to be processed contains attack information; if the target information is in the whitelist, it is determined that the external link to be processed does not contain attack information.

4. The attack detection method according to claim 3, characterized in that: If the target information is not in the blacklist and the whitelist, the attack detection method further includes: Detecting whether the external link to be processed contains a target substring; the target substring is a pre-set dangerous substring with attack characteristics; If the target information includes a target substring, it is determined that the external link to be processed contains attack information.

5. The attack detection method according to claim 4, characterized in that: If the target information does not include the target substring, the attack detection method further includes: determining whether the tag contains a bypass feature; If the tag contains a bypass feature, it is determined that the external link to be processed contains attack information.

6. The attack detection method according to claim 5, characterized in that: The bypass feature includes: a string concatenation feature and / or a string assignment feature.

7. The attack detection method according to claim 5, characterized in that: If the tag does not contain a bypass feature, the attack detection method further includes: Obtain the target file introduced by the external link to be processed; Determining whether the target file contains attack features; If the attack feature is included, it is determined that the external link to be processed contains attack information; if the attack feature is not included, it is determined that the external link to be processed does not contain attack information.

8. An attack detection device, characterized in that: include: An identification module, used to identify tags in request traffic; A determination module, configured to determine the external link to be processed from the tag; wherein determining the external link to be processed from the tag includes determining the external link to be processed using an attribute of the tag, wherein the attribute of the tag refers to an event attribute in the HTML code; A judgment module is used to judge whether the external link to be processed contains attack information; wherein the method of judging whether the external link to be processed contains attack information includes matching the target information extracted from the external link to be processed with the black and white lists in the intelligence library, detecting whether the external link to be processed contains a target substring, judging whether the tag contains a bypass feature, and judging whether the target file introduced by the external link to be processed contains an attack feature; the target substring is a pre-set dangerous substring with attack characteristics; A first determination module, configured to determine that the request traffic is attack traffic when the external link to be processed contains attack information; The second determination module is used to determine that the request traffic is normal traffic when the external link to be processed does not contain attack information.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the attack detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the attack detection method according to any one of claims 1 to 7 are implemented.