Deserialization attack detection method and device, equipment, medium and product
By combining serialization structure features and blacklist class features for user input matching, the problem of high false positive rate and large engineering workload of existing deserialization attack detection methods is solved, and efficient and simple deserialization attack detection is achieved.
Patent Information
- Application Number
- CN202410859600.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-17
AI Technical Summary
Existing deserialization attack detection methods have high false positive rates and large engineering workloads, are difficult to reuse common deserialization chains, are complex to operate, and have low efficiency.
By obtaining the parameter values input by the user, and combining the preset serialization structure features and blacklist class features for matching, the false alarm rate is reduced, the detection process is simplified, and it is suitable for the detection of various deserialization attacks.
It effectively reduces the false alarm rate, simplifies the detection process, and improves detection efficiency. It can be applied to the detection of various deserialization attacks, with simple operation and small workload.
Smart Images

Figure CN118659910A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network security technology, and in particular to a method, device, equipment, medium and product for detecting a deserialization attack. Background Art
[0002] Deserialization attack is a security attack method that involves the process of converting a data structure or object state from a certain format back to an object. This format is usually a binary stream or a string (such as JSON, XML), which is the reverse process of object serialization (that is, the conversion of an object into a storable or transmittable format). During the deserialization process, if an attacker can control the serialized data and pass harmful data to the application code, an attack against the application can be launched.
[0003] Currently, firewalls (Web Application Firewall, WAF) are usually used to detect deserialization attacks, mainly through two detection methods. The first method matches user input based on the deserialization keyword blacklist to detect whether there is an attack; the second method completely parses the user input according to the deserialization data structure protocol, and then matches based on the deserialization keyword blacklist to detect whether there is an attack.
[0004] The first detection method is simple to implement and has a high degree of maturity, but it has a high false alarm rate. The second method is labor-intensive and requires parsing of the protocol format adaptation for each deserialization type, and requires separate rule writing, making it difficult to reuse a general deserialization chain. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, equipment, medium and product for detecting deserialization attacks, which can reduce the false alarm rate of deserialization attack detection and can simply and effectively detect various deserialization attacks.
[0006] In order to achieve the above objectives, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0007] In a first aspect, the present disclosure provides a method for detecting a deserialization attack, comprising: obtaining user input and determining a parameter value corresponding to the user input; matching the parameter value with a preset protection feature; the preset protection feature comprises: a serialization structure feature and a blacklist feature; and when the parameter value matches the preset protection feature, determining that the user input is a deserialization attack.
[0008] As an optional implementation of the embodiment of the present disclosure, obtaining user input and determining a parameter value corresponding to the user input includes: obtaining user input; preprocessing the user input to obtain a parameter value corresponding to the user input; wherein the preprocessing includes format conversion and decoding.
[0009] As an optional implementation of the embodiment of the present disclosure, the serialization structure feature is the data structure feature when the attack chain is serialized, including: at least one of the Java native serialization structure feature, the Json serialization structure feature, and the Hessian serialization structure feature; the blacklist class feature is the class name feature corresponding to the attack chain, including: at least one of the Java native serialization class name feature, the Json deserialization class name feature, and the Hessian deserialization class name feature.
[0010] As an optional implementation of the embodiment of the present disclosure, matching the parameter value with the preset protection feature includes: matching the parameter value with the serialized structure feature; and in case of a matching failure, matching the parameter value with a blacklist feature.
[0011] In a second aspect, the present disclosure provides a detection device for a deserialization attack, comprising:
[0012] The acquisition module is used to obtain user input and determine the parameter value corresponding to the user input;
[0013] A matching module is used to match parameter values with preset protection features; the preset protection features include: serialization structure features and blacklist features;
[0014] The detection module is used to determine that the user input is a deserialization attack when the parameter value matches the preset protection feature.
[0015] As an optional implementation of the embodiment of the present disclosure, the acquisition module is specifically used to: obtain user input; preprocess the user input to obtain a parameter value corresponding to the user input; wherein the preprocessing includes format conversion and decoding.
[0016] As an optional implementation of the embodiment of the present disclosure, the matching module is specifically used to: match the parameter value with the serialized structure feature; in the case of a matching failure, match the parameter value with a blacklist-type feature.
[0017] In a third aspect, the present disclosure provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for detecting a deserialization attack as described in the first aspect or any one of its optional embodiments is implemented.
[0018] In a fourth aspect, the present disclosure provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for detecting a deserialization attack as described in the first aspect or any one of its optional embodiments is implemented.
[0019] In a fifth aspect, the present disclosure provides a computer program product, including: the computer program product includes a computer program, and when the computer program runs on a computer, the computer implements the method for detecting a deserialization attack as described in the first aspect or any one of its optional embodiments.
[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0021] The disclosed embodiments provide a method, apparatus, device, medium and product for detecting a deserialization attack, wherein the method first obtains user input, determines a parameter value corresponding to the user input, and then matches the parameter value with a preset protection feature, and determines that the user input is a deserialization attack when the parameter value matches the preset protection feature, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. Thus, the disclosed embodiments detect whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature, which reduces the false alarm rate compared to the detection method based on the deserialization keyword blacklist, and is simple to operate, does not require a complete analysis of the user input, has a small workload, and is highly efficient, and can be applied to the detection of various deserialization attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0023] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A flowchart of a method for detecting a deserialization attack according to an embodiment of the present disclosure;
[0025] Figure 2A A schematic diagram of a deserialization attack detection device provided in an embodiment of the present disclosure Figure 1 ;
[0026] Figure 2BA second structural diagram of a deserialization attack detection device provided by an embodiment of the present disclosure;
[0027] Figure 3 The present invention is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0030] In order to solve some or all of the technical problems existing in the related art, the embodiments of the present disclosure provide a method, device, electronic device, medium and program product for detecting a deserialization attack, wherein the method first obtains user input, determines the parameter value corresponding to the user input, and then matches the parameter value with a preset protection feature. When the parameter value matches the preset protection feature, it is determined that the user input is a deserialization attack, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. In this way, the embodiments of the present disclosure detect whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature. Compared with the detection method based on the deserialization keyword blacklist, the false alarm rate is reduced. Compared with the detection method based on the complete parsing according to the deserialization data structure protocol, the operation is simple, there is no need to fully parse the user input, the workload is small, the efficiency is high, and it can be applied to the detection of various deserialization attacks.
[0031] A method for detecting a deserialization attack provided in an embodiment of the present disclosure can be implemented by a detection device or electronic device for a deserialization attack, and the electronic device includes but is not limited to a vehicle terminal, a server, a personal computer, a laptop computer, a tablet computer, a smart phone, etc. The operating system of the electronic device may include Android, a mobile operating system (iOS) developed by Apple, an operating system (Windows) developed by Microsoft Corporation of the United States, etc., and the embodiment of the present disclosure does not limit this. The electronic device can be operated alone to implement the present disclosure, or it can be connected to a network and implement the present disclosure through interactive operations with other computer devices in the network. Among them, the network in which the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN) network, etc.
[0032] It should be noted that the protection scope of the deserialization attack detection method described in the embodiment of the present disclosure is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present disclosure are included in the protection scope of the present disclosure.
[0033] like Figure 1 As shown, Figure 1 The figure is a flow chart of a method for detecting a deserialization attack according to an embodiment of the present disclosure. The method can be executed by a device for detecting a deserialization attack, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method mainly includes the following steps S101 to S103:
[0034] S101: Obtain user input and determine parameter values corresponding to the user input.
[0035] The user input may be a normal request, such as a uniform resource locator (URL) URL1:
[0036]
[0037] User input can also be a malicious request, such as URL2:
[0038]
[0039] In some embodiments, after obtaining the user input, the user input is preprocessed. Preprocessing includes, but is not limited to: format conversion, decoding. Among them, format conversion can convert the user input into a form format, or a lightweight data exchange format (JavaScript Object Notation, json); decoding includes base64 decoding, URL decoding, etc. Base64 decoding is an encoding method for converting binary data into printable characters. URL decoding is the process of restoring the encoded URL fragment to its original character form.
[0040] Parameter values corresponding to user input include: URL, element (body), etc.
[0041] For example, using the previous example, assuming that the user input is URL1, after preprocessing the user input, the parameter value corresponding to the user input is decoded to be "javax.swing.UIDefault". Assuming that the user input is URL2, after preprocessing the user input, the parameter value corresponding to the user input is decoded to be binary data containing the javax.swing.UIDefault keyword.
[0042] The inventors found that when the traditional WAF matches URL1 based on the deserialized keyword blacklist, false positives will be generated. However, the disclosed embodiment combines the serialization structure feature to accurately distinguish whether the user input is a normal request or a malicious request, thereby reducing false positives.
[0043] S102: Match the parameter value with the preset protection feature.
[0044] The preset protection features include: serialization structure features and blacklist features. The serialization structure features are the data structure features when the attack chain is serialized. The blacklist features are the class name features corresponding to the attack chain.
[0045] When the attack chain is serialized, the data structure includes prefix bytes and strings. The prefix bytes are located before the string and indicate the data type and data length. For example, the string is a class name, the prefix bytes before the class name indicate that the data type is a string, and the data length is the length of the class name.
[0046] Optionally, the serialization structure features include: Java native serialization structure features, Json serialization structure features, Hessian serialization structure features and other serialization structure features. This is only an exemplary description, and the present disclosure does not specifically limit this. It should be noted that different serialization structure features correspond to different types of deserialization attacks. For example, a parameter value that matches a Hessian serialization structure feature can further determine that the corresponding user input is a Hessian deserialization attack.
[0047] For example, referring to the official Hessian documentation (http: / / hessian.caucho.com / doc / hessian-serialization.html#anchor32) for the Hessian serialization structure features, if the class name (className) is "javax.swing.UIDefaults", the corresponding string needs the following string grammar (StringGrammar):
[0048]
[0049] Therefore, in the real deserialization attack, the class name "javax.swing.UIDefaults" contains any of S\x00\x16, \x16, and \x30\x16, and the corresponding serialization structure characteristics can be set to:
[0050]
[0051] For example, referring to the official document (https: / / docs.oracle.com / javase / 8 / docs / platform / serialization / spec / protocol.html) for the Java native serialization structure feature, if the class name is "javax.swing.UIDefaults", the length information before the class name in the real Java deserialization attack is "0x16", and the Java deserialization attack starts with magicversion, that is, it starts with "0xaced0005". Correspondingly, the serialization structure feature can be set to:
[0052] \xac\xed\x00\x05.*\x16javax.swing.UIDefaults
[0053] The serialization structure features are used to match the parameter values corresponding to the user input. There is no need to fully parse the user input, nor is there any need to write specific rules for each type of deserialization attack. The workload is small and it can be applied to various deserialization attacks, which improves the versatility of deserialization attack detection.
[0054] Optionally, the blacklist class features include: Java native serialization class name features, Json deserialization class name features, Hessian deserialization class name features, and may also include a deserialization general blacklist list.
[0055] In some embodiments, the parameter value is matched with the serialization structure feature; if the match fails, the parameter value is matched with the blacklist feature. The parameter value corresponding to the user input is first matched with the serialization feature. If the match fails, it means that the parameter value corresponding to the user input does not match the corresponding serialization feature, then the blacklist feature is continued to be matched.
[0056] It should be noted that there are a large number of blacklist features, while serialization structure features are relatively fixed. By matching with serialization structure features, it is possible to quickly determine whether the user input is a deserialization attack. If the match is not successful, further matching with blacklist features is performed to accurately detect deserialization attacks.
[0057] In some embodiments, the parameter value is matched with the serialization structure feature and the blacklist feature, which can improve the matching accuracy and thus improve the accuracy of deserialization attack detection.
[0058] The above embodiment matches the parameter value corresponding to the user input by combining multi-dimensional protection features. Compared with the related technology that only relies on blacklist keyword detection, the false alarm rate is low.
[0059] S103: When the parameter value matches the preset protection feature, determine that the user input is a deserialization attack.
[0060] In some embodiments, when it is determined that the user input is a deserialization attack, a security alert is issued. Specifically, when it is determined that the user input is a deserialization attack, the alert details are displayed on the user page. Exemplarily, when it is determined that the user input is a Hessian deserialization attack, a security alert is issued.
[0061] In summary, a method for detecting a deserialization attack provided by an embodiment of the present disclosure first obtains user input, determines a parameter value corresponding to the user input, and then matches the parameter value with a preset protection feature. When the parameter value matches the preset protection feature, it is determined that the user input is a deserialization attack, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. In this way, the embodiment of the present disclosure detects whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature. Compared with the detection method based on the deserialization keyword blacklist, the false alarm rate is reduced. Compared with the detection method based on the complete parsing according to the deserialization data structure protocol, the operation is simple, there is no need to fully parse the user input, the workload is small, the efficiency is high, and it can be applied to the detection of various deserialization attacks.
[0062] like Figure 2A As shown, Figure 2A A schematic diagram of a deserialization attack detection device provided in an embodiment of the present disclosure Figure 1 , the device comprises:
[0063] The acquisition module 201 is used to obtain user input and determine the parameter value corresponding to the user input;
[0064] A matching module 202 is used to match the parameter value with a preset protection feature; the preset protection feature includes: a serialization structure feature and a blacklist feature;
[0065] The detection module 203 is used to determine that the user input is a deserialization attack when the parameter value matches the preset protection feature.
[0066] As an optional implementation of the embodiment of the present disclosure, the serialization structure feature is the data structure feature when the attack chain is serialized, including: at least one of the Java native serialization structure feature, the Json serialization structure feature, and the Hessian serialization structure feature; the blacklist class feature is the class name feature corresponding to the attack chain, including: at least one of the Java native serialization class name feature, the Json deserialization class name feature, and the Hessian deserialization class name feature.
[0067] As an optional implementation of the embodiment of the present disclosure, the acquisition module 201 is specifically used to: acquire user input; preprocess the user input to obtain a parameter value corresponding to the user input; wherein the preprocessing includes format conversion and decoding.
[0068] As an optional implementation of the embodiment of the present disclosure, the matching module 202 is specifically used to: match the parameter value with the serialization structure feature; in the case of a matching failure, match the parameter value with a blacklist feature.
[0069] In summary, the embodiment of the present disclosure provides a detection device for a deserialization attack, in which an acquisition module first acquires user input, determines a parameter value corresponding to the user input, and then a matching module matches the parameter value with a preset protection feature, and the detection module determines that the user input is a deserialization attack when the parameter value matches the preset protection feature, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. In this way, the embodiment of the present disclosure detects whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature. Compared with the detection method based on the deserialization keyword blacklist, the false alarm rate is reduced. Compared with the detection method based on the complete parsing according to the deserialization data structure protocol, the operation is simple, there is no need to fully parse the user input, the workload is small, the efficiency is high, and it can be applied to the detection of various deserialization attacks.
[0070] like Figure 2B As shown, Figure 2B A second structural diagram of a deserialization attack detection device provided in an embodiment of the present disclosure, the device comprising:
[0071] The preset protection feature generation module is used to generate preset protection features, which include: serialization structure features and blacklist features.
[0072] A preprocessing module is used to preprocess the user input after obtaining the user input and determine the parameter value corresponding to the user input;
[0073] A deserialization attack detection module, used to read the preset protection feature from the preset protection feature generation module and match the parameter value with the preset protection feature;
[0074] The security warning module is used to determine that the user input is a deserialization attack and issue a security warning when the parameter value matches the preset protection feature.
[0075] In some embodiments, a protection feature generation module is preset, which is specifically used to: generate a serialization structure feature based on at least one of the Java native serialization structure feature, the Json serialization structure feature, and the Hessian serialization structure feature; and generate a blacklist class feature based on at least one of the Java native serialization class name feature, the Json deserialization class name feature, the Hessian deserialization class name feature, and the deserialization general blacklist list.
[0076] like Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure, and the electronic device includes: a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301, and when the computer program is executed by the processor 301, each process of the method for detecting a deserialization attack in the above method embodiment is implemented. And the same technical effect can be achieved, and it will not be repeated here to avoid repetition.
[0077] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0078] The embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the method for detecting a deserialization attack in the above method embodiment is implemented, and the same technical effect can be achieved.
[0079] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0080] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the following steps are implemented: obtaining user input and determining a parameter value corresponding to the user input; matching the parameter value with a preset protection feature; the preset protection feature includes: a serialization structure feature and a blacklist feature; and when the parameter value matches the preset protection feature, determining that the user input is a deserialization attack.
[0081] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: obtaining user input and determining parameter values corresponding to the user input, including: obtaining user input; preprocessing the user input to obtain parameter values corresponding to the user input; wherein the preprocessing includes format conversion and decoding.
[0082] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: matching the parameter value with the preset protection feature, including: matching the parameter value with the serialized structure feature; in case of a match failure, matching the parameter value with a blacklist feature.
[0083] When the computer program in the computer-readable storage medium provided by the present disclosure executes the computer program, the user input is first obtained, the parameter value corresponding to the user input is determined, and then the parameter value is matched with the preset protection feature. When the parameter value matches the preset protection feature, it is determined that the user input is a deserialization attack, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. In this way, the embodiment of the present disclosure detects whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature. Compared with the detection method based on the deserialization keyword blacklist, the false alarm rate is reduced. Compared with the detection method based on the complete parsing according to the deserialization data structure protocol, the operation is simple, there is no need to fully parse the user input, the workload is small, the efficiency is high, and it can be applied to the detection of various deserialization attacks.
[0084] The present disclosure provides a computer program product, which stores a computer program. When the computer program is executed by a processor, each process of the method for detecting a deserialization attack in the above method embodiment is implemented, and the same technical effect can be achieved. The computer program can be used in the following embodiments: Figure 2A The memory of the electronic device may store various program modules constituting the detection device of the deserialization attack, for example, Figure 2A The acquisition module 201, matching module 202 and detection module 203 shown in FIG. 2B, or the preset protection feature generation module, preprocessing module, deserialization attack detection module and security alarm module shown in FIG. The computer program composed of each program module enables the processor to execute the steps of the deserialization attack detection method of each embodiment of the present disclosure described in this specification.
[0085] For example, Figure 3 The electronic equipment shown can be Figure 2AThe acquisition module 201 in the deserialization attack detection device shown obtains user input, determines the parameter value corresponding to the user input, and matches the parameter value with the preset protection feature through the matching module 202; the preset protection feature includes: serialization structure features and blacklist features; the detection module 203 determines that the user input is a deserialization attack when the parameter value matches the preset protection feature.
[0086] In one embodiment, the present disclosure provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: obtaining user input and determining a parameter value corresponding to the user input; matching the parameter value with a preset protection feature; the preset protection feature includes: a serialization structure feature and a blacklist feature; and when the parameter value matches the preset protection feature, determining that the user input is a deserialization attack.
[0087] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining user input and determining parameter values corresponding to the user input, including: obtaining user input; preprocessing the user input to obtain parameter values corresponding to the user input; wherein the preprocessing includes format conversion and decoding.
[0088] In one embodiment, when the processor executes the computer program, the following steps are also implemented: matching the parameter value with the preset protection feature, including: matching the parameter value with the serialized structure feature; in the event of a match failure, matching the parameter value with a blacklist feature.
[0089] When the processor in the electronic device provided by the present disclosure executes a computer program, it first obtains the user input, determines the parameter value corresponding to the user input, and then matches the parameter value with the preset protection feature. When the parameter value matches the preset protection feature, it determines that the user input is a deserialization attack, wherein the preset protection feature includes a serialization structure feature and a blacklist feature. In this way, the embodiment of the present disclosure detects whether the user input is a deserialization attack by combining the blacklist feature with the serialization structure feature. Compared with the detection method based on the deserialization keyword blacklist, the false alarm rate is reduced. Compared with the detection method based on the complete parsing according to the deserialization data structure protocol, the operation is simple, there is no need to fully parse the user input, the workload is small, the efficiency is high, and it can be applied to the detection of various deserialization attacks.
[0090] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0091] In several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0092] In the present disclosure, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0093] In the present disclosure, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0094] In the present disclosure, computer-readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0095] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0096] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting a deserialization attack, characterized in that: include: Obtaining user input, and determining a parameter value corresponding to the user input; Matching the parameter value with a preset protection feature; The preset protection features include: serialization structure features and blacklist features; When the parameter value matches the preset protection feature, it is determined that the user input is a deserialization attack.
2. The method according to claim 1, characterized in that The obtaining of user input and determining a parameter value corresponding to the user input includes: Obtaining the user input; Preprocessing the user input to obtain a parameter value corresponding to the user input; The preprocessing includes format conversion and decoding.
3. The method according to claim 1, characterized in that The serialization structure feature is a data structure feature when the attack chain is serialized, including: at least one of a Java native serialization structure feature, a Json serialization structure feature, and a Hessian serialization structure feature; The blacklist class feature is a class name feature corresponding to the attack chain, including: at least one of a Java native serialization class name feature, a Json deserialization class name feature, and a Hessian deserialization class name feature.
4. The method according to claim 1, characterized in that The matching of the parameter value with the preset protection feature includes: Matching the parameter value with the serialized structure feature; In case of a match failure, the parameter value is matched with the blacklist-type feature.
5. A deserialization attack detection device, characterized in that: include: An acquisition module, used to acquire user input and determine a parameter value corresponding to the user input; A matching module, used for matching the parameter value with a preset protection feature; The preset protection features include: serialization structure features and blacklist features; A detection module is used to determine that the user input is a deserialization attack when the parameter value matches the preset protection feature.
6. The device according to claim 5, characterized in that The acquisition module is specifically used for: Obtaining the user input; Preprocessing the user input to obtain a parameter value corresponding to the user input; The preprocessing includes format conversion and decoding.
7. The device according to claim 5, characterized in that The matching module is specifically used for: Matching the parameter value with the serialized structure feature; In case of a match failure, the parameter value is matched with the blacklist-type feature.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for detecting a deserialization attack according to any one of claims 1 to 4 is implemented.
9. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting a deserialization attack according to any one of claims 1 to 4 is implemented.
10. A computer program product, characterized in that include: The computer program product stores a computer program, and when the computer program is executed by a processor, the method for detecting a deserialization attack according to any one of claims 1 to 4 is implemented.
