A method and system for detecting abnormal URL parameter values

By analyzing real-time request logs and using the parameter feature library generated by historical request logs, URL parameter value abnormalities are identified, which solves the problem that traditional protection strategies cannot cope with strange attacks, and achieves high accuracy and rapid detection of abnormality handling effects.

CN117955711BActive Publication Date: 2024-09-24ICLOUDSHIELD SECURITY TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410080426.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2024-09-24
Estimated Expiration
2044-01-19

AI Technical Summary

Technical Problem

Traditional rule-based protection strategies cannot effectively deal with bizarre and featureless web attacks, making it difficult to detect and defend against these attacks.

Method used

By obtaining real-time request logs, analyze and generate parameter value categories, and use the pre-stored parameter feature library for matching. If there is no match, it will be determined as an exception and exception handling will be performed. The system includes data acquisition, analysis, preprocessing, signature database generation and anomaly detection modules. It generates a parameter signature database based on historical request logs to identify anomalies in real-time request logs.

Benefits of technology

It achieves high-accuracy detection and rapid response to strange and non-obvious attacks, improves the efficiency of abnormal processing, and can effectively deal with various strange and non-obvious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117955711B
    Figure CN117955711B
Patent Text Reader

Abstract

The present invention relates to the field of network security technology, and provides a method and system for detecting abnormal URL parameter values. The method comprises: obtaining a real-time request log; analyzing the real-time request log to generate one or more parameter values; dividing the categories based on preset parameter values, classifying each parameter value, and determining the parameter value category of the request URL in the real-time request log; generating a key according to the domain name, request URI and parameter name in the real-time request log; extracting the target data set corresponding to the key from a pre-stored parameter feature library; matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, determining that the parameter value of the request URL in the real-time request log is abnormal. The present invention can effectively deal with various strange attacks without obvious features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security, and in particular relates to a method and a system for detecting abnormal URL parameter values. Background Art

[0002] With the development of the Internet, Web application services have penetrated into all areas of society and become an important part of people's work and life. While Web application services have brought great convenience to people, Web attacks have also increased rapidly.

[0003] In order to defend against Web attacks, the traditional solution is to deploy rule-based protection strategies on WAF (Web Application Firewall), which can effectively block malicious attacks with obvious characteristics. However, rule-based protection strategies cannot effectively deal with various strange and featureless attack tests. Summary of the invention

[0004] In order to solve at least one technical problem in the background technology, the present invention proposes a URL parameter value anomaly detection method and system thereof, which can effectively deal with various strange attacks without obvious features.

[0005] According to a first aspect of the present invention, the present invention first provides a method for detecting abnormal URL parameter values, comprising:

[0006] Obtaining a real-time request log, wherein the real-time request log includes current http request data;

[0007] Analyze the real-time request log to generate one or more parameter values;

[0008] Classify the parameters based on the preset parameter values, classify each parameter value, and determine the parameter value category of the request URL in the real-time request log;

[0009] Generate a key according to the domain name, request URI and parameter name in the real-time request log;

[0010] Extracting a target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and categories and category confidences of data sets generated based on historical request logs;

[0011] The parameter value category of the request URL in the real-time request log is matched with the category and category confidence of the target data set; if there is no match, it is determined that the parameter value of the request URL in the real-time request log is abnormal.

[0012] Furthermore, before analyzing the real-time request log, the method further includes:

[0013] Performing data cleaning on the real-time request log; the data cleaning includes:

[0014] If the key data of the real-time request log does not exist in the parameter feature library, filter the current real-time request log;

[0015] If there is no parameter in the request URL in the real-time request log, filtering the current real-time request log; and

[0016] If the http request in the real-time request log is detected and not intercepted by Cloud Protection, the current real-time request log is filtered.

[0017] Further, the analyzing the real-time request log to obtain one or more parameter values ​​includes:

[0018] Perform parameter key-value pair splitting processing on the real-time request log to obtain one or more parameter names and parameter values;

[0019] According to the character features of the parameter names, invalid filtering is performed on all parameters to obtain one or more parameter values ​​of valid parameters.

[0020] Furthermore, the preset parameter value classification categories include pure number category, pure English category, URL category, and EMAIL= category.

[0021] Furthermore, the process of generating a mapping relationship between multiple keys and categories and category confidences of data sets based on historical request logs includes:

[0022] Obtain historical request logs, where the historical request logs include http request data at historical moments;

[0023] Performing data preprocessing on the historical request log to determine the parameter value category of the request URL in the historical request log; wherein the data preprocessing includes parameter key-value pair splitting, invalid parameter filtering, and parameter value classification;

[0024] Data merging is performed on all pre-processed historical request logs, and the data merging includes:

[0025] Generate a key from the domain name, request URI and parameter name in each historical request log;

[0026] Select data with the same key and merge them to generate a data set;

[0027] Determining the category and category confidence of the data set based on the consistency of the parameter value categories in the data set;

[0028] The mapping relationship between the key and the category and category confidence of the data set is stored to generate the parameter feature library.

[0029] Further, the determining the category and category confidence of the data set based on the consistency of the parameter value categories in the data set includes:

[0030] Determining whether the parameter value categories in the data set are the same;

[0031] If all are the same, the category of the data set is determined to be the current parameter value category, and the category confidence is set to 100; or,

[0032] If the parameter value categories in the data set are different and only include pure numeric categories and pure English categories, the category of the data set is determined to be a combination of numeric and English character categories, and the category confidence is set to 100; or, if the parameter value categories in the data set are different and do not include pure numeric categories and pure English categories or include not only pure numeric categories and pure English categories, the parameter value category with the largest proportion is selected as the category of the data set, and the category confidence is set to the proportion ratio value of the parameter value category with the largest proportion.

[0033] Furthermore, before performing data preprocessing on the historical request log, the method further includes:

[0034] Performing data cleaning on the historical request log, the data cleaning comprising:

[0035] The request is forwarded to the origin site and the origin site responds normally; the request URL contains parameter-value pairs; the request URL path does not contain special characters; if any of the above conditions is not met, the current historical request log is filtered.

[0036] Furthermore, matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set includes:

[0037] Determine whether the category confidence of the target data set is 100;

[0038] If the category confidence is 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if not, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormal confidence to 100; or,

[0039] If the category confidence is not 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if not, determine whether the parameter value of the request URL in the real-time request log contains special characters; if it contains special characters, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormal confidence to the difference between 100 and the category confidence.

[0040] Further, the method comprises:

[0041] According to the abnormal confidence, abnormal handling is performed on the http request with abnormal URL parameter value; wherein different abnormal handling is performed according to the value of the abnormal confidence.

[0042] According to a second aspect of the present invention, the present invention further provides a URL parameter value anomaly detection system, comprising:

[0043] A data acquisition module is used to acquire a real-time request log, wherein the real-time request log includes current http request data;

[0044] A data analysis module, used for analyzing the real-time request log and generating one or more parameter values;

[0045] A data preprocessing module, used to classify the parameters based on the preset parameter values, classify each parameter value, and determine the parameter value category of the request URL in the real-time request log;

[0046] A key generation module, used to generate a key according to the domain name, request URI and parameter name in the real-time request log;

[0047] A data extraction module, used to extract the target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and categories and category confidences of data sets generated based on historical request logs;

[0048] The anomaly detection module is used to match the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, it is determined that the parameter value of the request URL in the real-time request log is abnormal.

[0049] Through the technical solution of the present invention, the following technical effects can be obtained:

[0050] The URL parameter value anomaly detection method and system provided by the present invention analyze historical request logs offline, perform statistical analysis on each request parameter value, identify each parameter value category, generate a parameter feature library, detect real-time access logs based on the parameter feature library, and determine whether the current request is abnormal, thereby effectively detecting various strange attacks without obvious features with high accuracy; in addition, anomaly detection is performed based on the parameter feature library generated offline, with fast detection speed, thereby improving the efficiency of anomaly handling. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0052] Figure 1 A flowchart of a method for detecting abnormal URL parameter values ​​provided by an embodiment of the present invention;

[0053] Figure 2 A flow chart of a method for analyzing the real-time request log provided by an embodiment of the present invention;

[0054] Figure 3 A flow chart of a method for generating a parameter feature library provided in an embodiment of the present invention;

[0055] Figure 4 A flow chart of a method for determining the category and category confidence of the data set based on the consistency of parameter value categories in the data set provided by an embodiment of the present invention;

[0056] Figure 5 A flow chart of a method for matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set provided by an embodiment of the present invention;

[0057] Figure 6 A structural diagram of a URL parameter value anomaly detection system provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.

[0059] It should be noted that the terms "first", "second", "third" and "fourth" in the specification and claims of this application are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of this application and any variations thereof are intended to cover non-exclusive inclusions.

[0060] According to one embodiment of the present invention, Figure 1 The following is a flowchart of a method for detecting abnormal URL parameter values ​​provided by an embodiment of the present invention. The method can be deployed in a cloud WAF system. The method is aimed at detecting abnormal URL parameter values ​​of a single real-time request log. Of course, in actual applications, abnormal URL parameter value detection can be performed on multiple real-time request logs simultaneously. Specifically, Figure 1 As shown, an embodiment of the present invention provides a method for detecting abnormal URL parameter values, including:

[0061] S100, obtaining a real-time request log, wherein the real-time request log includes current http request data;

[0062] Specifically, each time the client requests access via http, a real-time request log will be generated on the server to record the user request information, wherein the current http request data includes the domain name, URI, parameter name, and parameter value.

[0063] S200, analyzing the real-time request log to generate one or more parameter values;

[0064] Before step S200, the method further includes:

[0065] S700, performing data cleaning on the real-time request log; the data cleaning includes: if the key data of the real-time request log does not exist in the parameter feature library, filtering the current real-time request log; if there are no parameters in the request URL in the real-time request log, filtering the current real-time request log; and if the http request in the real-time request log is detected by cloud protection and not intercepted, filtering the current real-time request log.

[0066] If the key does not exist in the parameter feature library, it is impossible to determine the data set to which the parameter value belongs, so filtering is required; if the http request is intercepted by other strategies, there is no need to perform anomaly detection, so the http request is detected by cloud protection and is not intercepted. This step S210 filters the data that is unnecessary or unnecessary to be processed in advance to avoid invalid processing, further improve the processing speed of subsequent data, and improve the efficiency of anomaly detection.

[0067] Since each real-time request log must contain the parameter name and corresponding parameter value of the request, an http request may carry one parameter name and parameter value, or may carry more than two parameter names and parameter values, so the present invention performs anomaly detection based on parameter values.

[0068] Figure 2 A flow chart of the method for analyzing the real-time request log is shown. Figure 2 As shown, the analyzing the real-time request log includes:

[0069] S210, performing parameter key-value pair splitting processing on the real-time request log to obtain one or more parameter names and parameter values;

[0070] In this step, the parameter key-value pair splitting process includes: splitting all parameters in the request URL according to "&", for example, "keyword=programming" and "category=web" are two parameters in a split http request, that is, a key-value pair can be considered as a parameter; then splitting the key-value pair of each parameter according to "=" to obtain a parameter name field and a parameter value field.

[0071] S220: Determine invalid parameters according to the character features of the parameter names and filter them to obtain one or more parameter values ​​of valid parameters.

[0072] This step filters the key-value pairs after the splitting. Specifically: check whether the parameter name is normal characters. If it contains abnormal characters, such as non-numbers, letters, dashes, and underscores, the current parameter is considered invalid and filtered out. If the parameter name is normal characters, it is considered a valid parameter, and the corresponding parameter value is Urldecoded to convert the encoded characters in the URL back to the original character form, such as decoding "%20" into a space character and decoding "%3D" into an equal sign character. If the encoded characters do not exist in the parameter value, the decoded parameter value string is the same as before decoding.

[0073] S300, classifying each parameter value based on preset parameter value classification, and determining the parameter value category of the request URL in the real-time request log;

[0074] After obtaining one or more parameter values ​​in step S200 or S220, each parameter value is classified to obtain the category to which the parameter value belongs, thereby determining the category to which the parameter in the current real-time request log belongs. Each parameter will be assigned to a category, and different parameters in an http request will be assigned to different categories.

[0075] In this embodiment, the parameter values ​​are classified according to a preset category feature method, which can be generated based on data learning / expert experience, and is used to determine which of the preset parameter value classification categories the parameter value belongs to, thereby obtaining the parameter value category of each parameter, and then knowing one or more parameter value categories corresponding to a real-time request log. Optionally, the preset parameter value classification categories include pure digital categories, pure English categories, URL categories, and EMAIL= categories. In other embodiments, the preset parameter value classification categories can also be expanded on the basis of the aforementioned four categories according to actual conditions, and are not limited here.

[0076] S400, generating a key according to the domain name, request URI and parameter name in the real-time request log;

[0077] In this step, the domain name, request URI and parameter name are input into the preset key generation condition, and the corresponding key can be output. The preset key generation condition is used to aggregate the domain name, request URI and parameter name, and finally represent them with the key string to facilitate subsequent anomaly detection. In this embodiment, the preset key generation condition is the MD5 algorithm, which generates a hash value for the three parameters of the domain name, request URI and parameter name.

[0078] S500, extracting a target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and categories and category confidences of data sets generated based on historical request logs;

[0079] The parameter feature library is generated offline, and the parameter features are obtained through historical request logs. Figure 3 The flowchart of the method for generating the parameter feature library is shown, that is, the process of generating a mapping relationship between multiple keys and the categories and category confidences of the data set based on the historical request log. Figure 3 As shown, the process of generating a mapping relationship between multiple keys and categories and category confidences of a data set based on historical request logs includes:

[0080] S510, obtaining a historical request log, wherein the historical request log includes http request data at historical moments;

[0081] S520, perform data preprocessing on the historical request log to determine the parameter value category of the request URL in the historical request log; wherein, the data preprocessing includes parameter key-value pair splitting, invalid parameter filtering, and parameter value classification; the parameter key-value pair splitting process refers to the above step S210, the invalid parameter filtering process refers to the above step S220, and the parameter value classification refers to the above step S300.

[0082] Before step S520, the method further includes: S550, performing data cleaning on the historical request log. Specifically, the data cleaning includes:

[0083] The request is forwarded to the source station and the source station responds normally; the request URL contains a parameter value pair; the request URL path part does not contain special characters; if any of the above conditions is not met, the current historical request log is filtered. Among them, the special characters are not commonly used by technical personnel in this field. The present application cleans multiple historical request logs and filters out data that does not need to be processed, so that the features of the parameter feature library are more accurate and the accuracy of subsequent anomaly detection is improved.

[0084] S530: Merging all pre-processed historical request logs. The data merging includes:

[0085] Step 1: Generate a key from the domain name, request URI and parameter name in each historical request log; this step refers to the above step S400.

[0086] Step 2: select data with the same key and merge them to generate a data set. In this step, when the domain name, request URI and parameter name are the same, the generated key is the same key. The corresponding data under the same key, such as parameter values ​​and parameter value categories, are gathered together to form a data set. This process does not change each field, and each field is independent of each other. This step 2 will eventually present different data sets corresponding to different keys, and each key corresponds to a data set.

[0087] Step three, based on the consistency of the parameter value categories in the data set, determine the category and category confidence of the data set; specifically, after multiple data sets are obtained by the binary clustering step, set the category and category confidence of each data set respectively, Figure 4 A flow chart of a method for determining the category and category confidence of the data set based on the consistency of the parameter value category in the data set is shown, as shown in FIG. Figure 4 As shown, the step three specifically includes:

[0088] S531, determining whether the parameter value categories in the data sets are the same; this step determines whether multiple parameter value categories in each data set are the same.

[0089] S532, if all are the same, then determine that the category of the data set is the current parameter value category, and set the category confidence to 100; wherein, in each data set, if multiple parameter value categories are consistent, for example, all are pure numbers, then set the category of the current data set to a pure number category, and give a category confidence of 100, which is used to indicate that the parameter value category in the data set is uniquely determined.

[0090] S533: If the parameter value categories in the data set are different and only include pure numeric categories and pure English categories, the category of the data set is determined as a combination of numeric and English character categories, and the category confidence is set to 100; or, if the parameter value categories in the data set are different and do not include pure numeric categories and pure English categories or include not only pure numeric categories and pure English categories, the parameter value category with the largest proportion is selected as the category of the data set, and the category confidence is set to the proportion ratio value of the parameter value category with the largest proportion.

[0091] Specifically, when multiple parameter value categories in a data set are different, if it can be determined that the multiple parameter value categories are a combination of pure numbers and pure English categories, then the category of the current data set is considered to be uniquely determined, that is, the pure numbers and pure English categories, and a category confidence of 100 is given; if the multiple parameter value categories in the data set do not include pure numbers and pure English categories or are not just pure numbers and pure English categories, then the category with the largest number of identical categories among the multiple parameter value categories is calculated, for example, URL categories account for 6 of 10 parameter value categories, then the URL category is determined as the category of the current data set, and the category confidence is calculated as the proportion of the number of URLs, which is 60.

[0092] S540, storing the mapping relationship between the key and the category and category confidence of the data set, and generating the parameter feature library.

[0093] Specifically, the data merged in step S530 is used to generate a parameter feature library, which is generated according to the built-in data format and contains the key, the category of the data set, and the category confidence. It can be understood that the parameter feature library is generated by analyzing the characteristics of historical data, and then matching and judging abnormalities are performed based on the parameter feature library.

[0094] In other optional embodiments, the method further comprises: regularly updating the parameter feature library. Specifically, regularly generating the parameter features based on historical data and then merging the parameter features generated historically.

[0095] After the parameter feature library is generated through steps S510-S540, step S500 searches for the key of the current real-time request log in the parameter feature library. After finding the key, the data set corresponding to the key can be extracted, and the data set is the target data set.

[0096] S600, matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, determining that an abnormality occurs in the parameter value of the request URL in the real-time request log.

[0097] Specifically, Figure 5 A flow chart of a method for matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set is shown, as shown in FIG. Figure 5 As shown, step S600 includes:

[0098] S610, determine whether the category confidence of the target data set is 100; the category confidence can be used to determine whether the parameter value category of the current real-time request log is determined, and then further judgment is made based on the parameter value category determination method. Different category confidences correspond to different parameter value category determination methods.

[0099] S620, if the category confidence is 100, determine whether the category of the parameter value of the request URL in the real-time request log is consistent with the category of the target data set; if not, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormality confidence to 100;

[0100] S630, if the category confidence is not 100, then determine whether the category of the parameter value of the request URL in the real-time request log is consistent with the category of the target data set; if not, then determine whether the parameter value of the request URL in the real-time request log contains special characters, and if it contains special characters, then determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormal confidence to the difference between 100 and the category confidence. The special characters are characters that are considered not to appear in the URL parameter value.

[0101] In other optional embodiments, the method further comprises:

[0102] S640, according to the abnormal confidence, perform abnormal handling on the http request with abnormal URL parameter value; wherein, different abnormal handling is performed according to the value of the abnormal confidence. The abnormal handling includes interception, redirection, JS verification, image verification, and slider verification. In this embodiment, the higher the abnormal confidence, the more inclined to active interception handling, and the lower the abnormal confidence, the more inclined to verification handling. In other words, severe abnormalities are intercepted and handled, and minor abnormalities are verified.

[0103] The URL parameter value anomaly detection method provided by the present invention generates a parameter feature library based on historical request logs, identifies abnormal requests based on real-time request logs and the parameter feature library, and can effectively detect various strange attacks without obvious features with high accuracy; secondly, anomaly detection is performed based on the parameter feature library generated offline, with a fast detection speed, thereby improving the efficiency of anomaly handling; finally, the present invention performs anomaly handling for abnormal requests and can respond to abnormal requests in a timely manner.

[0104] According to the second aspect of the present invention, an embodiment of the present invention further provides a system corresponding to the above-mentioned URL parameter value anomaly detection method, and the same contents will not be repeated here, please refer to the above-mentioned embodiment. Figure 6 A URL parameter value anomaly detection system provided by an embodiment of the present invention is shown, and the system includes:

[0105] The data acquisition module 10 is used to acquire the real-time request log, wherein the real-time request log includes the current http request data;

[0106] A data analysis module 20, configured to analyze the real-time request log and generate one or more parameter values;

[0107] The data preprocessing module 30 is used to classify each parameter value based on the preset parameter value classification, and determine the parameter value category of the request URL in the real-time request log; wherein the preset parameter value classification categories include pure digital category, pure English category, URL category, and EMAIL= category;

[0108] Key generation module 40, used to generate a key according to the domain name, request URI and parameter name in the real-time request log;

[0109] A data extraction module 50 is used to extract the target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and data set categories and category confidences generated based on historical request logs;

[0110] The anomaly detection module 60 is used to match the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, it is determined that the parameter value of the request URL in the real-time request log is abnormal.

[0111] Furthermore, the system further includes: a data cleaning module 70, the data cleaning module 70 is used to clean the real-time request log; the data cleaning includes:

[0112] If the key data of the real-time request log does not exist in the parameter feature library, filter the current real-time request log; if there are no parameters in the request URL in the real-time request log, filter the current real-time request log; and if the http request in the real-time request log is detected by cloud protection and not intercepted, filter the current real-time request log.

[0113] Furthermore, the data analysis module 20 is also used to: split the parameter key-value pairs of the real-time request log to obtain one or more parameter names and parameter values; and perform invalid filtering on all parameters according to the character features of the parameter names to obtain one or more parameter values ​​of valid parameters.

[0114] Furthermore, the system also includes a feature library generation module 80, which is used to: obtain historical request logs, which include http request data at historical moments; perform data preprocessing on the historical request logs to determine the parameter value category of the request URL in the historical request logs; wherein the data preprocessing includes parameter key-value pair splitting, invalid parameter filtering, and parameter value classification; perform data merging on all preprocessed historical request logs, and the data merging includes: generating a key from the domain name, request URI and parameter name in each historical request log; selecting data with the same key for merging to generate a data set; determining the category and category confidence of the data set based on the consistency of the parameter value category in the data set; storing the mapping relationship between the key and the category and category confidence of the data set to generate the parameter feature library.

[0115] Further, the feature library generation module 80 is also used to: determine whether the parameter value categories in the data set are the same; if all are the same, determine the category of the data set to be the current parameter value category, and set the category confidence to 100; or, if the parameter value categories in the data set are different and are only pure numeric and pure English categories, determine the category of the data set to be a combination of numbers and English characters, and set the category confidence to 100; or, if the parameter value categories in the data set are different and do not include pure numeric and pure English categories or include not only pure numeric and pure English categories, select the parameter value category with the largest proportion as the category of the data set, and set the category confidence to the proportion ratio value of the parameter value category with the largest proportion.

[0116] Furthermore, the feature library generation module 80 is also used to: perform data cleaning on the historical request log, and the data cleaning includes: the request is forwarded to the source station and the source station responds normally; the request URL contains a parameter value pair; the request URL path part does not contain special characters; if any of the above conditions is not met, the current historical request log is filtered.

[0117] Further, the anomaly detection module 60 is also used to: determine whether the category confidence of the target data set is 100; if the category confidence is 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if inconsistent, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the anomaly confidence to 100; or, if the category confidence is not 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if inconsistent, determine whether the parameter value of the request URL in the real-time request log contains special characters, and if it contains special characters, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the anomaly confidence to the difference between 100 and the category confidence.

[0118] Furthermore, the system also includes an exception handling module 90, and the exception handling module 90 is used to perform exception handling on http requests with abnormal URL parameter values ​​according to the exception confidence; wherein different exception handling is performed according to the value of the exception confidence.

[0119] The URL parameter value anomaly detection system provided by the present invention generates a parameter feature library based on historical request logs, identifies abnormal requests based on real-time request logs and the parameter feature library, and can effectively detect various strange attacks without obvious features with high accuracy; secondly, anomaly detection is performed based on the parameter feature library generated offline, with a fast detection speed, thereby improving the efficiency of anomaly handling; finally, the present invention performs anomaly handling for abnormal requests and can respond to abnormal requests in a timely manner.

[0120] Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described device and equipment can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0121] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative.

[0122] Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.

[0123] It should be understood that the size of the serial numbers of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

Claims

1. A method for detecting abnormal URL parameter values, characterized in that: The method comprises: Obtaining a real-time request log, wherein the real-time request log includes current http request data; Analyze the real-time request log to generate one or more parameter values; Classify the parameters based on the preset parameter values, classify each parameter value, and determine the parameter value category of the request URL in the real-time request log; Generate a key according to the domain name, request URI and parameter name in the real-time request log; Extracting a target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and categories and category confidences of data sets generated based on historical request logs; Matching the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, determining that an abnormality occurs in the parameter value of the request URL in the real-time request log; The process of generating a mapping relationship between multiple keys and categories and category confidences of data sets based on historical request logs includes: obtaining historical request logs, wherein the historical request logs include http request data at historical moments; performing data preprocessing on the historical request logs to determine the parameter value categories of the request URLs in the historical request logs; wherein the data preprocessing includes parameter key-value pair splitting, invalid parameter filtering and parameter value classification; performing data merging on all preprocessed historical request logs, wherein the data merging includes: generating keys from the domain name, request URI and parameter name in each historical request log; selecting data with the same key for merging to generate a data set; determining the category and category confidence of the data set based on the consistency of the parameter value categories in the data set; storing the mapping relationship between the key and the category and category confidence of the data set to generate the parameter feature library.

2. The URL parameter value anomaly detection method according to claim 1, characterized in that: Before analyzing the real-time request log, the method further includes: Performing data cleaning on the real-time request log; the data cleaning includes: If the key data of the real-time request log does not exist in the parameter feature library, filter the current real-time request log; If there is no parameter in the request URL in the real-time request log, filtering the current real-time request log; and If the http request in the real-time request log is detected and not intercepted by Cloud Protection, the current real-time request log is filtered.

3. The URL parameter value anomaly detection method according to claim 1, characterized in that: The analyzing the real-time request log to obtain one or more parameter values ​​includes: Perform parameter key-value pair splitting processing on the real-time request log to obtain one or more parameter names and parameter values; According to the character features of the parameter names, invalid filtering is performed on all parameters to obtain one or more parameter values ​​of valid parameters.

4. The URL parameter value anomaly detection method according to claim 1, characterized in that: The preset parameter value classification categories include pure number category, pure English category, URL category and EMAIL category.

5. The URL parameter value anomaly detection method according to claim 1, characterized in that: The determining the category and category confidence of the data set based on the consistency of the parameter value category in the data set includes: Determining whether the parameter value categories in the data set are the same; If all are the same, the category of the data set is determined to be the current parameter value category, and the category confidence is set to 100; or, If the parameter value categories in the data set are different and only include pure numeric categories and pure English categories, the category of the data set is determined to be a combination of numeric and English character categories, and the category confidence is set to 100; or, if the parameter value categories in the data set are different and do not include pure numeric categories and pure English categories or include not only pure numeric categories and pure English categories, the parameter value category with the largest proportion is selected as the category of the data set, and the category confidence is set to the proportion ratio value of the parameter value category with the largest proportion.

6. The URL parameter value anomaly detection method according to claim 1, characterized in that: Before performing data preprocessing on the historical request log, the method further includes: Performing data cleaning on the historical request log, the data cleaning comprising: The request is forwarded to the origin site and the origin site responds normally; the request URL contains parameter-value pairs; the request URL path does not contain special characters; if any of the above conditions is not met, the current historical request log is filtered.

7. The URL parameter value anomaly detection method according to claim 1, characterized in that: The matching of the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set includes: Determine whether the category confidence of the target data set is 100; If the category confidence is 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if not, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormal confidence to 100; or, If the category confidence is not 100, determine whether the parameter value category of the request URL in the real-time request log is consistent with the category of the target data set; if not, determine whether the parameter value of the request URL in the real-time request log contains special characters; if it contains special characters, determine that the parameter value of the request URL in the real-time request log is abnormal, and set the abnormal confidence to the difference between 100 and the category confidence.

8. The URL parameter value anomaly detection method according to claim 7, characterized in that: The method further comprises: According to the abnormal confidence, abnormal handling is performed on the http request with abnormal URL parameter value; wherein different abnormal handling is performed according to the value of the abnormal confidence.

9. A URL parameter value anomaly detection system, characterized in that: The system comprises: A data acquisition module is used to acquire a real-time request log, wherein the real-time request log includes current http request data; A data analysis module, used for analyzing the real-time request log and generating one or more parameter values; A data preprocessing module, used to classify the parameters based on the preset parameter values, classify each parameter value, and determine the parameter value category of the request URL in the real-time request log; A key generation module, used to generate a key according to the domain name, request URI and parameter name in the real-time request log; A data extraction module, used to extract the target data set corresponding to the key from a pre-stored parameter feature library; wherein the parameter feature library stores a mapping relationship between multiple keys and categories and category confidences of data sets generated based on historical request logs; an anomaly detection module, used to match the parameter value category of the request URL in the real-time request log with the category and category confidence of the target data set; if there is no match, determining that the parameter value of the request URL in the real-time request log is abnormal; A feature library generation module is used to obtain historical request logs, which include http request data at historical moments; perform data preprocessing on the historical request logs to determine the parameter value category of the request URL in the historical request logs; wherein the data preprocessing includes parameter key-value pair splitting, invalid parameter filtering and parameter value classification; perform data merging on all preprocessed historical request logs, wherein the data merging includes: generating a key from the domain name, request URI and parameter name in each historical request log; selecting data with the same key for merging to generate a data set; determining the category and category confidence of the data set based on the consistency of the parameter value category in the data set; storing the mapping relationship between the key and the category and category confidence of the data set to generate the parameter feature library.

Citation Information

Patent Citations

  • Detecting method and device of Web attack

    CN105516128A

  • Method and device for detecting Web anomaly

    CN106131071A

  • Log data anomaly pointing-direction identification method and device

    CN107423190A

  • HTTP request exception detection method and system

    CN111585955A

  • Test method and device and electronic equipment

    CN112416739A