A fuzzy testing method and device based on multi-dimensional time series abnormal observation
Through the fuzzy testing method of multi-dimensional time series abnormal observation, the problems of high false alarm rate and low efficiency in the existing technology are solved. The multi-dimensional data and abnormal observation model are used to improve the accuracy and efficiency of status judgment, and can quickly locate vulnerabilities.
Patent Information
- Application Number
- CN202411088866.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In existing fuzz testing, the status of the object under test does not support the judgment of complex multiple indicators, resulting in a high false alarm rate and low efficiency.
A fuzzy testing method based on multi-dimensional time series abnormal observation is adopted. By sending abnormal messages in parallel and obtaining the status data of the tested object in multiple dimensions, the abnormal observation model after training is used to determine whether an abnormality has occurred and improve the accuracy of status judgment. sex.
It improves the accuracy and efficiency of fuzz testing, reduces false positives of vulnerabilities, and can more quickly locate target abnormal messages that trigger security vulnerabilities in the objects under test.
Smart Images

Figure CN118606961B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a fuzzy testing method and device based on multi-dimensional time series abnormal observation. Background Art
[0002] Fuzz testing is a method of discovering software vulnerabilities by providing unexpected inputs to the target system and observing abnormal results.
[0003] In the prior art, during fuzz testing, a large amount of deformed data is mainly input into the target under test, and possible security vulnerabilities are discovered by observing whether the target under test has network delays, freezes, restarts and other anomalies.
[0004] However, with this existing method, abnormal situations such as network delays, freezes, and restarts may not necessarily be all malformed data, which may cause false alarms of vulnerabilities and result in low accuracy of fuzz testing. Summary of the invention
[0005] The present application provides a fuzzy testing method and device based on multi-dimensional time series abnormal observation, which is used to solve the problem that the state of the object under test in the existing fuzzy testing does not support the judgment of complex multiple indicators, resulting in high false alarms.
[0006] In a first aspect, an embodiment of the present application provides a fuzzy testing method based on multi-dimensional time series abnormal observation, comprising:
[0007] Obtain abnormal messages for fuzz testing;
[0008] Sending the abnormal message to the object under test in parallel, obtaining multi-dimensional time series data after the object under test receives the abnormal message, wherein the multi-dimensional time series data includes at least one sampling time point after the start of the fuzzy test and state data of the object under test in multiple dimensions at the sampling time point;
[0009] Based on the state data of the measured object in various dimensions at the sampling time point, determining whether the measured object is abnormal at the sampling time point;
[0010] If the measured object is abnormal at the sampling time point, a target abnormal message that triggers the abnormality of the measured object is determined from the abnormal messages that have been sent in parallel;
[0011] Based on the target abnormal message, a fuzzy test result is obtained.
[0012] In a possible design of the first aspect, determining whether an abnormality occurs in the object under test at the sampling time point based on the state data of the object under test in different dimensions at the sampling time point includes:
[0013] Converting the state data of the measured object in each dimension at the sampling time point into corresponding coordinate values to form a multidimensional vector, wherein each coordinate value in the multidimensional vector is used to represent the state data in one dimension;
[0014] Based on the trained abnormal observation model, determining whether each coordinate value in the multidimensional vector matches a reference value range of a corresponding dimension;
[0015] If there is at least one coordinate value in the multidimensional vector that does not match the reference value range of the corresponding dimension, it is determined that the object under test is abnormal.
[0016] In another possible design of the first aspect, forming a multidimensional vector includes:
[0017] Based on the data format and value range of the status data in each dimension, determine the processing method of each status data;
[0018] Based on the processing method, the state data is normalized to form normalized values corresponding to each state data as the coordinate value.
[0019] In another possible design of the first aspect, before determining whether each coordinate value in the multidimensional vector matches a reference value range of a corresponding dimension based on the trained abnormal observation model, the method further includes:
[0020] Acquire first multi-dimensional time series data of the measured object within a first time period before the abnormality;
[0021] Using the first multidimensional time series data as training data, training the abnormal observation model until a training completion condition is met;
[0022] Based on the trained anomaly detection model, the benchmark value range is determined.
[0023] In another possible design of the first aspect, the abnormal observation model is trained until a training completion condition is met, including:
[0024] Acquire second multidimensional time series data of the measured object in a second time period before the abnormality, wherein the first time period and the second time period are different time periods;
[0025] Using the second multidimensional time series data as an input of the trained abnormal observation model, obtaining an output result of the trained abnormal observation model, wherein the output result is used to characterize whether the measured object is normal or abnormal;
[0026] If the output result indicates that the measured object is abnormal, continue to obtain training data and continue to train the abnormal observation model;
[0027] If the output result indicates that the measured object is normal, it is determined that the abnormal observation model meets the training completion condition.
[0028] In another possible design of the first aspect, the acquiring of multidimensional time series data after the measured object receives the abnormal message includes:
[0029] Based on the set sampling interval, determine each sampling time point after the abnormal message is sent in parallel to the measured object;
[0030] At each sampling time point, based on a specific sampling method, the state data of the measured object in each dimension is obtained, and the state data of different dimensions are sampled based on different sampling methods.
[0031] In another possible design of the first aspect, the state data of the measured object in each dimension is obtained based on a specific sampling method, and the state data of different dimensions are sampled based on different sampling methods, including:
[0032] determining whether the specific sampling method is direct sampling or indirect sampling;
[0033] If the specific sampling method is direct sampling, then based on at least one of an Internet Control Message Protocol request, a Transmission Control Protocol request, a Hypertext Transfer Protocol request, a Secure Shell Protocol request, and a Software Development Kit request, the state data of the object under test in multiple dimensions is sampled;
[0034] If the specific sampling method is indirect sampling, the state data of the object under test in multiple dimensions is sampled remotely based on the secure shell protocol, or an agent program is run on the object under test using an injection method to sample the state data of the object under test in multiple dimensions in real time, wherein the state data includes a process identifier, port status, file handle, processor usage, and memory usage.
[0035] In another possible design of the first aspect, determining the target abnormal message that triggers the abnormality of the object under test from the abnormal messages that have been sent in parallel includes:
[0036] Obtaining M first abnormal messages that the measured object last sends to the measured object before the abnormality occurs, where M is a positive integer;
[0037] Based on the original sending order of each first abnormal message, each first abnormal message is sent again in reverse order to the measured object after it returns to normal, and it is determined whether there is a second abnormal message that triggers the abnormality of the measured object again;
[0038] If there is a second abnormal message that triggers the abnormality of the measured object again, the second abnormal message is used as the target abnormal message.
[0039] In another possible design of the first aspect, determining the target abnormal message that triggers the abnormality of the object under test from the abnormal messages that have been sent in parallel includes:
[0040] Obtaining the result fed back by the measured object according to the abnormal message sent in parallel;
[0041] If the feedback result contains abnormal content, it is determined that the object under test is abnormal;
[0042] Sending the candidate abnormal message that triggers the measured object to feedback abnormal content again to the measured object;
[0043] If the candidate abnormal message triggers the abnormality of the measured object again, the candidate abnormal message is used as the target abnormal message.
[0044] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described above.
[0045] The fuzzy testing method and device based on multi-dimensional time series anomaly observation provided in the embodiment of the present application aggregate the state data of the object under test in each dimension by utilizing multi-dimensional time series data, so as to determine whether the state of the object under test is when receiving the abnormal message, so as to more accurately determine whether the object under test is abnormal. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application;
[0047] Figure 1 A schematic diagram of a scenario of a fuzzy testing method based on multidimensional time series abnormal observation provided in an embodiment of the present application;
[0048] Figure 2 A flowchart of a fuzzy testing method based on multidimensional time series abnormal observation provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a flow chart of an abnormality determination method provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the overall process of the abnormal state determination method provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of the model training process provided in the embodiment of the present application;
[0052] Figure 6 A schematic diagram of the overall process of a fuzzy testing method based on multidimensional time series abnormal observation provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structure of a fuzzy testing device based on multi-dimensional time series anomaly observation provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0055] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] Fuzz testing is an effective testing method for discovering security vulnerabilities. The principle of fuzz testing is to input a large amount of deformed data into the object under test, and to discover possible security vulnerabilities in the object under test by observing the anomalies of the object under test. Taking the object under test as program code as an example, in actual applications, due to the diversity of enterprise products, various code versions are used in various product lines, which leads to the problem that the reliability and security issues existing in the traditional manual inspection code can no longer cover all product lines. Since fuzz testing can automatically run batch tests on products, it has received more and more attention in security testing. However, fuzz testing requires a large amount of deformed data to be input into the object under test, and fuzz testing only uses a single request thread, that is, the state of the target program is observed after each deformed data packet is sent. Since most of the data packets received by the target device will not trigger security vulnerabilities, this leads to the low speed and efficiency of detecting problems per unit time in this single-threaded testing method. In addition, due to the lack of multi-source reading records of the network target state, the jams recorded during the test may be problems, or they may just be slow responses caused by insufficient device processing speed, which can easily cause false alarms of security issues. Moreover, since most embedded device protocols cannot read the detailed abnormal information inside the object under test during the fuzz testing process, they can only make judgments based on external observable state characteristics, which can easily lead to inaccurate judgments on the abnormal state of the object under test.
[0058] In response to the above problems, the present application provides a fuzzy testing scheme based on multi-dimensional time series anomaly observation, which is used to solve the current problems of slow fuzzy testing efficiency and inaccurate problem judgment. Specifically, this fuzzy testing scheme is based on sending malformed data packets concurrently and then sending malformed data packets serially to locate the malformed data packets that trigger the anomaly, which can improve efficiency. Then, multi-dimensional data sampling is used to replace single-dimensional sampling in target state observation, and normal state data is used to train the anomaly detection model to obtain the baseline state. The real-time test process sampling data is matched by the anomaly detection model to make a target state judgment, which can enhance the state judgment ability in the fuzzy testing process.
[0059] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0060] Figure 1 A schematic diagram of a fuzzy testing method based on multidimensional time series abnormal observation provided in an embodiment of the present application. The fuzzy testing method can be applied to Figure 1 Fuzz testing system in . Figure 1 As shown, the fuzzy testing system includes a message mutation module, a target observation module, a parallel sending module, and a logic control module.
[0061] Among them, the message mutation module is used to generate abnormal messages for fuzzy testing based on normal data messages. The target observation module is used to observe whether the object under test is normal or abnormal. The parallel sending module is used to send multiple abnormal messages to the object under test in parallel. The logic control module is used to control the message mutation module, the target observation module and the parallel sending module.
[0062] The object under test may be a hardware device or a program code running on the hardware device.
[0063] The fuzz testing solution provided in this application will be described in detail below in combination with the step-by-step process of the fuzz testing method.
[0064] Figure 2 The flowchart of the fuzzy testing method based on multi-dimensional time series abnormal observation provided in the embodiment of the present application is as follows. The fuzzy testing method can be applied to the above-mentioned fuzzy testing system, and can also be applied to other electronic devices (such as mobile terminals, computers, tablet computers, etc.). Taking the electronic device as the execution subject as an example, Figure 2 As shown, the method specifically comprises the following steps:
[0065] Step S210: Obtain an abnormal message for performing fuzz testing.
[0066] In this embodiment, the abnormal message may refer to the above-mentioned malformed data packet, which is used to be sent to the measured object. After the measured object receives the malformed data packet, the malformed data packet may trigger the measured object to be in an abnormal state, or may not trigger the measured object to be abnormal, that is, the measured object can continue to maintain a normal state after receiving the malformed data packet. When the measured object is triggered to be abnormal, the malformed data packet can be recorded for subsequent abnormal analysis.
[0067] Among them, the abnormal message can be converted from a normal message. Specifically, taking the subject of the fuzz test as an electronic device as an example, the electronic device can receive a normal data packet input from the outside, and then convert the normal data packet (the normal data packet can include the above-mentioned normal message) into a variant request packet (the variant request packet can include the above-mentioned variant message) for performing fuzz testing on the target network device and record it in the sending cache list.
[0068] Among them, external devices such as user terminals will pre-construct data packets that comply with the data transmission protocol (also called normal data packets), and send the normal data packets to the above-mentioned electronic devices, which will then be converted into variant request packets. The variant request packets also comply with the data transmission protocol, but are different from normal data packets.
[0069] Among them, the normal data packet is converted to obtain the mutant request packet, which has many specific implementation forms. For example, the normal data packet is converted to obtain the mutant request packet through the trained mutation-based fuzz test generation algorithm, or a part of the data (also called characters) in the normal data packet is modified to obtain the mutant request packet.
[0070] In this embodiment, after the mutation request packet is obtained, the mutation request packet can be recorded in the cache list in order. There are many orders here, such as the order of the sending timestamp or receiving timestamp of the normal data packet corresponding to the mutation request packet, or the order of the timestamp converted into the mutation request packet, etc., which are not specifically limited in this embodiment.
[0071] Among them, caching the mutation request packets in the cache list in order is mainly to facilitate subsequent positioning. For example, 10 mutation request packets are sent to the object under test, and then after the object under test receives the 10th mutation request packet, it has an abnormality. At this time, you only need to check from the 10th mutation request packet forward (that is, check the 1st mutation request packet to the 10th mutation request packet), you can narrow the scope of investigation and quickly find which mutation request packet triggered the abnormality of the object under test.
[0072] Step S220: sending the abnormal messages to the measured object in parallel, and obtaining multi-dimensional time series data after the measured object receives the abnormal messages.
[0073] The multi-dimensional time series data includes at least one sampling time point after the start of the fuzzy test and state data of the object under test in multiple dimensions at the sampling time point.
[0074] In this embodiment, a value N (N is a positive integer greater than 1) can be set, and then N abnormal messages are sent to the object under test in parallel. Compared with the current method of using only a single request thread and sending only one abnormal message at a time, this method can improve the efficiency of sending abnormal messages, thereby quickly triggering the abnormality of the object under test, so as to ensure that the cause of the abnormality can be checked as soon as possible.
[0075] In addition, after N abnormal messages are sent to the object under test in parallel, if the object under test returns the result of any variant message, the electronic device can continue to send the next abnormal message to the object under test in the order of the above cache list, ensuring that the number of abnormal messages that have been sent but are waiting for the return result is N. This can maximize efficiency and trigger the abnormality of the object under test as soon as possible to ensure that the cause of the abnormality can be found as soon as possible afterwards.
[0076] In this embodiment, multiple observation points of different dimensions can be set. Each observation point is used to observe the state data of the measured object in one dimension. Then each sampling time point There are multiple observation points below. For example, at the first sampling time point, the state data of the measured object in multiple dimensions are:
[0077]
[0078] In the above formula, represents the first sampling time point, Represents the state data of the measured object in the first dimension at the first sampling time point, Represents the state data of the measured object in the second dimension at the first sampling time point, Represents the state data of the measured object in the third dimension at the first sampling time point.
[0079] Among them, observations or assignments can be made in chronological order, thus forming a continuous series of matrices that expand horizontally over time. , thus forming multidimensional time series data.
[0080] The time interval between each sampling time point can be adjusted, for example, the time interval between each sampling time point can be set to 1 second.
[0081] The time when the fuzzy test starts may refer to the time when the electronic device sends N abnormal messages to the object under test in parallel. Taking the above time interval of 1 second as an example, if the electronic device sends N abnormal messages to the object under test in parallel at time T0, then after T0, there will be a sampling time point every one second, and at each sampling time point there will be status data of the object under test in multiple dimensions.
[0082] In this embodiment, the state data in each dimension can be understood as the attribute value of a certain attribute of the measured object. Exemplarily, the state data of the measured object in multiple dimensions can specifically include the following:
[0083] Dimension 1: Processor occupancy rate, for example, the value is 80%;
[0084] Dimension 2: Memory usage, for example, the value is 50%;
[0085] Dimension 3: Network delay, for example, the value is 100 milliseconds;
[0086] Dimension 4: process identifier, such as an ID value;
[0087] Dimension 5: Port status, such as whether the port is open, port response status, etc.
[0088] The above examples show the status data in five dimensions. In actual applications, you can set which dimensions of status data to collect based on actual test requirements.
[0089] Among them, since the status data in each dimension may be different, different collection methods can be set to collect the status data in the corresponding dimension, such as sending a ping based on the Internet Control Message Protocol (ICMP) to the object to be measured to detect the network between the object to be measured, and sending a ping based on the Transmission Control Protocol (TCP) to the object to be measured to detect the port status on the object to be measured. That is, the status data in each dimension can be configured with a corresponding collection method to collect.
[0090] Step S230: Based on the state data of the measured object in various dimensions at the sampling time point, determine whether the measured object is abnormal at the sampling time point.
[0091] In this embodiment, at the sampling time point When the processor occupancy rate of the measured object is the state data in one dimension, and the memory occupancy rate is the state data in another dimension, for example, if the processor occupancy rate and / or the memory occupancy rate is abnormal, then it is determined that at the sampling time point The object being measured has an abnormality.
[0092] Among them, after an abnormality occurs in the object under test, the electronic device needs to stop sending abnormal messages to the object under test, and record the last abnormal message sent to the object under test when the abnormality occurs, so as to facilitate the subsequent establishment of an investigation scope and determine which specific abnormal message triggered the abnormality of the object under test.
[0093] In addition, the abnormality of the object under test may refer to pseudo-death, restart, crash, etc. In this embodiment, the state data of each dimension of the object under test when it is normal can be obtained first as a reference state, and then after the test starts (that is, the electronic device starts to send abnormal messages to the object under test in parallel), the state data of the object under test in multiple dimensions at each sampling time point is obtained, and then compared with the reference state, so as to determine whether the object under test has an abnormality.
[0094] Step S240: If the measured object is abnormal at the sampling time point, a target abnormal message that triggers the measured object to be abnormal is determined from the abnormal messages that have been sent in parallel.
[0095] Step S250: Obtain fuzzy test results based on the target abnormal message.
[0096] In this embodiment, if an abnormality occurs in the object under test at the sampling time point, then it is possible to first search whether the electronic device has sent an abnormal message to the object under test at the sampling time point. If an abnormal message is sent to the object under test, then the abnormal message is taken as the last abnormal message sent to the object under test, and then the order in the above cache list is checked forward to find all abnormal messages that have been sent in parallel, and the target abnormal message that triggers the abnormality of the object under test is determined.
[0097] Preferably, a value M can also be set, and M-1 abnormal messages are searched forward from the last abnormal message in the order in the cache list, and then the target abnormal message is checked from the last abnormal message and the previous M-1 abnormal messages. The value of M can be a fixed value, such as twice the above-mentioned N, or it can be determined according to the interval between the sampling time points. For example, the interval between the first sampling time point and the second sampling time point is 1 second, and the object under test has no abnormality at the first sampling time point, and the object under test has an abnormality at the second sampling time point. Then, it is only necessary to check all abnormal messages sent to the object under test between the first sampling time point and the second sampling time point to determine the target abnormal message. These methods can save the amount of investigation to a certain extent and improve efficiency.
[0098] The embodiment of the present application utilizes multi-dimensional time series data to aggregate the status data of the object under test in various dimensions, so as to determine the status of the object under test when receiving the abnormal message. This can more accurately determine whether the object under test has an abnormality, and more quickly locate the target abnormal messages that will trigger security vulnerabilities in the object under test, thereby improving the efficiency of subsequent vulnerability repair.
[0099] The following will further describe how to determine whether the measured object is abnormal at the target sampling time point based on the state data of the measured object in various dimensions at the target sampling time point through some embodiments.
[0100] Figure 3 A schematic diagram of a method for determining an abnormality according to an embodiment of the present application is shown in FIG. Figure 3 As shown, the method can be specifically reported as follows:
[0101] Step S310: converting the state data of the measured object in each dimension at the sampling time point into corresponding coordinate values.
[0102] In this embodiment, when the fuzzy test starts, as time passes, after a time interval (for example, one second), the first sampling time point will be triggered, and the state data of the object under test in multiple dimensions at the first sampling time point needs to be collected. For example, the state data of the object under test in multiple dimensions at the first sampling time point is taken as an example:
[0103]
[0104] At this time, you can , , Convert to the corresponding coordinate value, that is →x1, →y1, →z1. It should be noted that in the process of coordinate value conversion, due to , , It is status data in different dimensions, and their data formats and numerical values may be different. Therefore, in the conversion process, it is necessary to use corresponding methods to convert them into a unified standard as much as possible.
[0105] Step S320: construct a multi-dimensional vector based on all coordinate values.
[0106] Each coordinate value in the multidimensional vector is used to represent state data in one dimension.
[0107] For example, the above , , The corresponding coordinate values are: →x1, →y1, → Taking z1 as an example, the multidimensional vector is (x1, y1, z1).
[0108] Step S330: Based on the trained abnormal observation model, determine whether each coordinate value in the multidimensional vector matches the reference value range of the corresponding dimension.
[0109] Step S340: If there is at least one coordinate value in the multidimensional vector that does not match the reference value range of the corresponding dimension, it is determined that an abnormality occurs in the object under test.
[0110] In this embodiment, continue with , , The corresponding coordinate values are: →x1, →y1, →z1 as an example, and the multidimensional vector is (x1, y1, z1) as an example, a baseline value range can be set for the state data of each dimension, such as → (j0, j1], → (j1, j2], →(j2, j3], then compare whether x1 is in the reference data range (j0, j1], whether y1 is in the reference value range (j1, j2], and whether z1 is in the reference value range (j2, j3]. If any one of x1, y1, and z1 is not in the corresponding reference value range, it is determined that the object under test is abnormal.
[0111] In this embodiment, the status of the measured object can be observed in real time, that is, each time a sampling time point passes, the state data of the measured object in various dimensions is obtained at the sampling time point to determine whether the measured object is abnormal. If an abnormality occurs, starting from the sampling time point, the sending of abnormal messages to the measured object is suspended, and the abnormal messages sent to the measured object at the sampling time point and before the sampling time point are counted to determine the target abnormal message that triggers the abnormality of the measured object.
[0112] The embodiment of the present application converts the state data of multiple dimensions into a multi-dimensional vector, and then uses the trained abnormal observation model to determine whether the state data of these dimensions are within the reference value range, thereby improving the efficiency of abnormality determination, and when the state data of any dimension is not within the reference state range, it is determined that the object under test is abnormal. This can also further improve the accuracy of abnormality determination.
[0113] Furthermore, based on the above embodiments, in other embodiments, since the status data on each dimension may have different data formats and numerical ranges, it is necessary to configure a suitable processing method for the status data on each dimension, and then normalize the status data based on the processing method to form normalized values corresponding to each status data as coordinate values.
[0114] In this embodiment, the processing method includes at least one of weighted differentiation, function transformation, data differentiation, regular expression, and vector conversion. Among them, regular expression (Regular Expression, Regex) is a text pattern used to describe and match specific patterns of strings. Vector conversion can refer to Word2Vector, Word2Vector, or Word2Vec for short, which is a model for generating word vectors, which can map words to points in a high-dimensional space to better capture semantic information.
[0115] In this embodiment, the status data of the two dimensions of memory usage and processor usage are taken as an example. The unit of memory usage is usually gigabytes, such as 1 gigabyte, 2 gigabytes, etc., and the processor usage is usually in the form of percentages, such as 10%, 20%, etc. It can be found that the numerical difference between the memory usage and the processor usage is very large. In order to facilitate the description of multi-dimensional vectors, the memory usage and the processor usage need to be normalized so that they are uniformly in the same range (for example, between 0 and 1).
[0116] In addition, the status data of different dimensions may not have uniform data formats. For example, the status data of one dimension may be numbers, while the status data of another dimension may be strings. Therefore, all of them need to be converted into a uniform format, such as numerical form.
[0117] For example, taking the process identifier (PID) as a dimension of status data, it is suitable to use data differentiation to mark the change of data points. Among them, PID is a number used to uniquely identify the process running in the system. In the operating system, each process has a unique PID so that the system can manage and control these processes. For another example, for the status data of a certain dimension, if it has fields, some fields can be weighted and increased in weight by weighted differentiation. For another example, the memory usage rate mentioned above can be reduced in value by function transformation so that it is in the same range as the status data of other dimensions.
[0118] For example, Figure 4 The overall flow chart of the abnormal state determination method provided in the embodiment of the present application is as follows: Figure 4 As shown, it includes the following steps: 1. Sampling during operation; 2. Data preprocessing; 3. Model verification status; 4. Status abnormality; 5. Notification to the outside that it is normal; 6. Notification to the outside that it is abnormal.
[0119] The data preprocessing is to process the multi-dimensional time series data sampled during the runtime through the above-mentioned processing method to form normalized values corresponding to the state data of each dimension.
[0120] The embodiment of the present application provides a suitable processing method for the status data of each dimension, so as to realize the conversion of the status data of each dimension in different data formats and different numerical ranges into coordinate values in the same format and the same numerical range. In this way, it is more convenient and effective to use the status data of each dimension to determine the status of the object under test, enhance the ability to judge the status of the object under test during the fuzzy test, and solve the problem that the status of the object under test in the fuzzy test does not support the judgment of complex multiple indicators, resulting in high false alarms.
[0121] Furthermore, in some other embodiments, it is mentioned above that the abnormal observation model is used as the main body, and the benchmark value range is used to determine whether the object under test is abnormal. For this purpose, the abnormal observation model needs to be trained in advance. Specifically, the first multidimensional time series data of the object under test in the first time period before the abnormality occurs can be obtained; then the first multidimensional time series data is used as training data to train the abnormal observation model until the training completion condition is met; based on the abnormal detection model after the training is completed, the benchmark value range is determined.
[0122] In this embodiment, a time period can be taken before the fuzzy test begins, such as the time period from t0 to t1. Multiple sampling time points can be set within the time period, and the state data of the object under test in multiple dimensions are obtained at each sampling time point. Then, the state data of the object under test in multiple dimensions at all sampling time points are used as positive samples of training data to train the abnormal observation model.
[0123] Among them, the training completion condition may refer to the judgment success rate of the model being greater than a set threshold. For example, after each training is completed, the status data of the object under test in multiple dimensions at a certain time point can be collected (this time point can be the moment when the object under test becomes abnormal, or it can be the moment when the object under test is normal), and then input into the trained abnormal observation model. If the abnormal observation model gives a judgment result that fits the actual situation, then it can be determined that the training completion condition is met.
[0124] Among them, after the training of the abnormal observation model is completed, the abnormal observation model can give the benchmark value range corresponding to the status data of each dimension. If the status data of this dimension is within the corresponding benchmark value range, it proves that there is no abnormality in the status data of this dimension. Until the status data of all dimensions are within the corresponding benchmark value range, it is determined that the state of the object under test is normal.
[0125] In this embodiment, the aforementioned first multidimensional time series data also needs to be preprocessed using the above processing method, and after preprocessing, the abnormal observation model is used for training. Exemplarily, unsupervised learning OneClassSVM can be used as the abnormal observation model, and in other embodiments, other models can be selected for training.
[0126] The embodiment of the present application uses the first multidimensional time series data before the test starts as a positive sample to train the anomaly observation model, which can reduce the difficulty of obtaining training data (because the possibility of security vulnerabilities (i.e., anomalies) in the object under test is usually relatively small, and it is difficult to find negative samples). At the same time, using the trained anomaly observation model can also improve the accuracy of the state judgment of the object under test.
[0127] Further, on the basis of the above embodiments, in other embodiments, when training the abnormal observation model, the second multidimensional time series data of the measured object in the second time period before the abnormality can be obtained. Among them, the first time period and the second time period are different time periods. Then, the second multidimensional time series data is used as the input of the trained abnormal observation model to obtain the output result of the trained abnormal observation model. If the output result indicates that the measured object is abnormal, continue to obtain training data and continue to train the abnormal observation model; if the output result indicates that the measured object is normal, it is determined that the abnormal observation model meets the training completion condition.
[0128] In this embodiment, multidimensional time series data in the latest second time period that has no intersection with the first time period is used to perform model verification to ensure that all sampling points in the second time period without running the fuzzy test match the trained abnormal observation model, that is, the judgment of the abnormal observation model after training does not drift, and the abnormal observation model before the fuzzy test is completed. If a mismatch occurs, it means that the device status characteristics are still migrating, and it is necessary to re-collect multidimensional time series data in other time periods (that is, the time period before the start of the fuzzy test) and recalibrate the abnormal observation model.
[0129] For example, Figure 5 A schematic diagram of the model training process provided in the embodiment of the present application, such as Figure 5 As shown, it includes the following steps:
[0130] (1) Trigger sampling;
[0131] (2) Multidimensional time series data;
[0132] (3) Sampling point definition;
[0133] (4) Benchmark sampling;
[0134] (5) Data preprocessing;
[0135] (6) Model training calculation;
[0136] (7) Benchmark verification;
[0137] (8) The model determines whether it is drifting;
[0138] Among them, trigger sampling means using the set sampling time interval to cyclically trigger sampling, obtain multi-dimensional state data, put it into the data sequence for subsequent reading, and support the state data of the object under test in multiple dimensions at all sampling time points from the beginning to the latest time.
[0139] The sampling point definition means that at each sampling time point, the state data of each dimension of the object under test comes from a specific sampling method. The sampling methods used include: direct sampling and indirect sampling, and the sampling results can be in the format of numerical values or strings. According to the needs and parameter specifications of the test task, select the appropriate sampling dimension, and use the corresponding sampling method to generate the state data of the corresponding dimension.
[0140] Benchmark sampling refers to taking out target multidimensional time series data (such as first multidimensional time series data) before the global fuzzy test begins, and using the target multidimensional time series data for calibration of the benchmark value range.
[0141] Data preprocessing refers to filtering out significant error values, and normalizing the state data by using weighted differentiation, function transformation, data differentiation, Regex+Word2Vector, etc., when the data format (such as numbers and strings) and value range of the state data obtained by the original sampling are not uniform. For example, PID is suitable for using data differentiation to mark the change of data points, and some fields can be weighted to increase the weight.
[0142] Benchmark verification refers to the use of multidimensional time series data in the latest second time period that has no intersection with the first time period to verify the model, ensuring that all state data in the state without running fuzzy testing matches the trained model, that is, the judgment results after model training do not drift, and the preparation work before the test is completed; if it does not match, it means that the device state characteristics are still migrating, and return to the benchmark sampling step to recalibrate the model.
[0143] The embodiment of the present application verifies the output result of the abnormal observation model by utilizing the second multidimensional time series data of the measured object in the second time period before the abnormality, which can further improve the discrimination accuracy of the abnormal observation model and avoid the drift of the discrimination results.
[0144] The following describes in detail how to obtain multidimensional time series data through some embodiments.
[0145] Specifically, in some embodiments, it is necessary to first set a sampling interval (i.e., the time interval mentioned above, for example, one second). If the sampling interval is one second, then after the fuzz test starts, sampling is triggered once every second. When the sampling is triggered, the sampling time point is recorded, and then the state data of the object under test in each dimension at the sampling time point is obtained.
[0146] Among them, when collecting the status data of each dimension of the measured object at the sampling time point, since the status data of each dimension may be different (for example, the status data of one dimension is memory usage, and the status data of another dimension is network delay), it is necessary to configure a specific sampling method, that is, the status data of each dimension is sampled using its corresponding sampling method.
[0147] In addition, in some other embodiments, the sampling interval of the state data of each dimension may be specified separately, or the same sampling interval may be used globally, that is, the state data of all dimensions use the same sampling interval.
[0148] In this embodiment, it is necessary to determine which sampling method to configure based on the status data required for the fuzz test. For example, if the fuzz test needs to collect the network delay of the object under test, then the Internet Control Message Protocol (ICMP) request message can be sent to the object under test, and the network delay can be obtained based on the response result of the object under test.
[0149] Further, in some embodiments, the specific sampling method can be divided into direct sampling or indirect sampling. Wherein, if the specific sampling method is direct sampling, then based on at least one of the Internet Control Message Protocol request (i.e. Ping,), the Transmission Control Protocol request (i.e. Transmission Control Protocol ping, tcp ping), the Hypertext Transfer Protocol (HTTP) request, the Secure Shell Protocol (SSH) request, and the Software Development Kit (SDK) request, the state data of the object under test in multiple dimensions is sampled. If the specific sampling method is indirect sampling, then based on the secure shell protocol SSH, the state data of the object under test in multiple dimensions is sampled remotely, or an agent program is run on the object under test using an injection method, and the state data of the object under test in multiple dimensions is sampled in real time, and the state data includes a process identifier PID, a port state, a file handle, a processor usage (CPU Usage) and a memory usage (RAM Usage).
[0150] Among them, when the specific sampling method is indirect sampling, if the status data is obtained by remotely executing commands through SSH login to the device, the process status command can be used to obtain status data of certain dimensions. Among them, through the process status command, you can view which processes of the object under test are running, including their PID, resources used, running time and other information. In addition, you can also use the netstat tool to obtain status data of certain dimensions. For example, the netstat tool can display the status of the network interface of the object under test, the routing table, the network connection, and the usage of the port.
[0151] The embodiment of the present application can realize the collection of multi-dimensional state data of the measured object by configuring a variety of different sampling methods, thereby improving the accuracy of the state determination of the measured object. At the same time, through the two methods of direct sampling and indirect sampling, the detailed state information inside the measured object can be read, avoiding the state determination of the measured object only by external observable states (such as freezes, restarts, etc.), and further enhancing the accuracy of the state determination of the measured object.
[0152] The following describes in detail how to search for target abnormal messages after determining that the detected object is abnormal through some embodiments. The specific methods can be divided into the following:
[0153] Method 1: Obtain the M first abnormality messages that the tested object last sent to the tested object before the abnormality occurred; based on the original sending order of each first abnormality message, send each first abnormality message again in reverse order to the tested object after it returns to normal, and determine whether there is a second abnormality message that triggers the abnormality of the tested object again among all the first abnormality messages; if there is a second abnormality message that triggers the abnormality of the tested object again, use the second abnormality message as the target abnormality message. Wherein, M is a positive integer.
[0154] Method 2: Obtain the results fed back by the object under test based on the abnormal messages that have been sent in parallel; if the fed back results contain abnormal content, it is determined that the object under test has an abnormality; then the candidate abnormal message that triggers the object under test to feedback the abnormal content is sent to the object under test again; if the candidate abnormal message triggers the abnormality of the object under test again, the candidate abnormal message is used as the target abnormal message.
[0155] For method one, when an exception occurs in the object under test at the current moment, the last exception message sent to the object under test as of the current moment can be determined first, and then the cache list mentioned above is used (all exception messages are stored in the cache list in order in advance, and the exception messages will also be sent to the object under test in sequence based on this order), and the M-1 exception messages sent before the last exception message are searched in order, and then these M-1 exception messages sent and the last exception message are used as the first exception messages, and then these M first exception messages are re-sent serially to the object under test in reverse order according to the previous sending order.
[0156] When each first abnormal message is sent serially, the object under test may also be detected by the abnormal observation model to determine whether it is abnormal and whether there is a second abnormal message that triggers the abnormality of the object under test again.
[0157] For the second method, taking the case where abnormal message A and abnormal message B are sent in parallel as an example, assuming that the object under test feedbacks a result based on abnormal message A, and this result contains abnormal content, then abnormal message A is regarded as a candidate abnormal message, and then abnormal message A is sent to the object under test again to see whether it will return the same abnormal content (which can be understood as a situation that triggers the abnormality of the object under test). If the abnormality of the object under test is triggered again, the candidate abnormal message is used as the target abnormal message. This is mainly because in the actual test process, there may be some other factors that are not the factors of the object under test itself (such as network fluctuations), causing the object under test to feedback abnormal content. For this reason, it is necessary to resend the candidate abnormal message to the object under test, and then perform another abnormal judgment to determine that the object under test is indeed triggered by the candidate abnormal message, so as to improve the accuracy of the judgment.
[0158] Before sending the candidate abnormal message or the first abnormal message in the above-mentioned method 1 again, it is necessary to wait for the object under test to recover from the abnormal state to the normal state.
[0159] The embodiment of the present application uses the method of retrying in reverse order one by one in method 1 to find the target abnormal message that triggers the problem, thereby achieving a faster test speed while ensuring the positioning capability, and locating the abnormal message that triggers the vulnerability in a limited time. Since method 2 can directly locate the candidate abnormal message, it can locate the target abnormal message faster than method 1.
[0160] For example, Figure 6 The overall flow chart of the fuzzy testing method based on multi-dimensional time series abnormal observation provided by the embodiment of the present application is as follows: Figure 6 As shown, it includes step 1) inputting messages and test targets; step 2) message mutation and use case generation; step 3) model training and benchmark calibration; step 4) determining whether there are use cases (i.e., abnormal messages used for fuzz testing and not yet sent); step 5) parallel sending; step 6) state judgment; step 7) waiting for the object under test to return to normal; step 8) the existence of use cases (i.e., whether there is a first abnormal message or a candidate abnormal message); step 9) serial sending; step 10) state judgment; step 11) vulnerability report; step 12) waiting for the object under test to return to normal.
[0161] Among them, the above steps can be specifically divided into the following actions: ① Provide normal network protocol data packets to the fuzzy testing system from external input; ② Use a mutation-based fuzzy test generation algorithm to generate a mutated protocol data packet sequence (i.e., abnormal packets to be sent to the object under test) from normal data packets or protocols, and save these mutated data packets in an ordered list, which is called a [cache list]; ③ Start the target observation module, perform survival confirmation and preparation work for the object under test, initialize the target profile and training model, and refer to the introduction of the above embodiment for details; ④ Parallel sending, that is, the network requests to send the above-mentioned sequence of mutated data packets through the parallel sending module. Among them, the parallel sending module sends N request messages at the same time. After any request message is returned, the next request message is sent in sequence to ensure that there are N messages that have been sent but are waiting for the return result; ⑤ If a request message returns obvious abnormal content or the target observation module detects that the object under test is in an abnormal working state (such as suspended, restarted, or frozen), the sending process of the parallel sending module is suspended, and the position of the first message that is not currently sent in the cache list is recorded; During the test, the target observation module works using the following method: (1) Read the state data of each dimension of the object under test at the latest sampling time point during runtime; (2) Use the same data preprocessing to obtain a multidimensional vector; (3) Run the model to determine whether the state meets the benchmark state; (4) Notify the outside of the latest state of the target (normal or abnormal); ⑥ Wait for a certain period of time (for example, 1 minute) until the object under test resumes normal working state, which is determined by the target observation module at an interval of 1 second; If the object under test does not resume normal working state for a long time, the test process is terminated and the record is written to a file or database. ⑦ Reproduce the vulnerability: that is, after the object under test returns to normal, select the last M messages from the last message that has been sent, resend them one by one in reverse order, and continuously observe the running status of the object under test in real time. The target observation module extends the observation time before and after sending (for example, 8-20 seconds), so as to locate the mutant message that triggers the problem; ⑧ If the returned request message returns abnormal content or the target observation module detects that the object under test is in an abnormal state, then record the mutant request message that triggers the return result, write the problem into the result set, and record it in the local file or database; ⑨ Clear the record of the sent message, wait until the observation module monitors that the object under test has returned to normal, and restart step ③ from the first message position of the unsent sequence in the previously sent cache list until all the mutant messages to be sent are sent.
[0162] The fuzzy testing solution provided by the embodiment of the present application, on the one hand, can use external characteristics such as TCP, ICMP connection status, use injection means or SSH remote execution to obtain the internal characteristics of the object under test, such as process PID, port number, SSH connection, and then use the state data of multiple dimensions of the object under test to reflect the state changes of the object under test. On the other hand, through the feature training and extraction of multi-dimensional time series data and the state judgment of the object under test, it supports the aggregation and judgment of abnormal states of any multi-dimensional data, and solves the problem that the state of the object under test in the fuzzy test does not support the judgment of complex multiple indicators, resulting in high false positives.
[0163] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0164] Figure 7 A schematic diagram of the structure of a fuzzy testing device based on multi-dimensional time series abnormal observation provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the fuzzy testing device 700 includes a message acquisition module 710, a message parallel sending module 720, an abnormality determination module 730, a target message determination module 740 and a test result acquisition module 750.
[0165] Among them, the message acquisition module 710 is used to obtain abnormal messages for fuzzy testing. The message parallel sending module 720 is used to send abnormal messages to the object under test in parallel, and obtain multi-dimensional time series data after the object under test receives the abnormal message. The multi-dimensional time series data includes at least one sampling time point after the start of the fuzzy test and the state data of the object under test in multiple dimensions at the sampling time point. The abnormality determination module 730 is used to determine whether the object under test has an abnormality at the sampling time point based on the state data of the object under test in various dimensions at the sampling time point. The target message determination module 740 is used to determine the target abnormal message that triggers the abnormality of the object under test in the abnormal messages that have been sent in parallel if the object under test has an abnormality at the sampling time point. The test result acquisition module 750 is used to obtain the fuzzy test result based on the target abnormal message.
[0166] Optionally, the abnormality determination module can be specifically used to: convert the state data of the object under test in each dimension at the sampling time point into corresponding coordinate values to form a multidimensional vector, and each coordinate value in the multidimensional vector is used to represent the state data in one dimension; based on the abnormality observation model after training, determine whether each coordinate value in the multidimensional vector matches the baseline numerical range of the corresponding dimension; if there is at least one coordinate value in the multidimensional vector that does not match the baseline numerical range of the corresponding dimension, it is determined that an abnormality has occurred in the object under test.
[0167] Optionally, the abnormality determination module can be specifically used to: determine the processing method of each state data based on the data format and value range of the state data in each dimension; based on the processing method, normalize the state data to form a normalized value corresponding to each state data as a coordinate value.
[0168] Optionally, it also includes a model training module, which is used to obtain first multidimensional time series data of the object under test in a first time period before the anomaly; use the first multidimensional time series data as training data to train the anomaly observation model until the training completion conditions are met; and determine the benchmark value range based on the anomaly detection model after the training is completed.
[0169] Optionally, the model training module is specifically used to: obtain second multidimensional time series data of the object under test in a second time period before the abnormality, the first time period and the second time period being different time periods; use the second multidimensional time series data as the input of the trained abnormal observation model, and obtain the output result of the trained abnormal observation model, and the output result is used to characterize whether the object under test is normal or abnormal; if the output result characterizes that the object under test is abnormal, continue to obtain training data and continue to train the abnormal observation model; if the output result characterizes that the object under test is normal, determine that the abnormal observation model meets the training completion conditions.
[0170] Optionally, the message parallel sending module can be specifically used to: determine each sampling time point after the abnormal message is sent in parallel to the object under test based on the set sampling interval; at each sampling time point, based on a specific sampling method, obtain the status data of the object under test in each dimension, and the status data of different dimensions are sampled based on different sampling methods.
[0171] Optionally, the message parallel sending module can be specifically used to: determine whether a specific sampling method is direct sampling or indirect sampling; if the specific sampling method is direct sampling, then based on at least one of Internet Control Message Protocol request, Transmission Control Protocol request, Hypertext Transfer Protocol request, Secure Shell Protocol request, and Software Development Kit request, the state data of the object under test in multiple dimensions is sampled; if the specific sampling method is indirect sampling, then based on the Secure Shell Protocol, the state data of the object under test in multiple dimensions is remotely sampled, or an injection method is used to run an agent program on the object under test to sample the state data of the object under test in multiple dimensions in real time, and the state data includes a process identifier, port status, file handle, processor usage, and memory usage.
[0172] Optionally, the target message determination module can be specifically used to: obtain the M first abnormal messages that are last sent to the object under test before the abnormality occurs; based on the original sending order of each first abnormal message, send each first abnormal message serially again to the object under test after it returns to normal in reverse order, and determine whether there is a second abnormal message among all the first abnormal messages that triggers the abnormality of the object under test again; if there is a second abnormal message that triggers the abnormality of the object under test again, use the second abnormal message as the target abnormal message, and M is a positive integer.
[0173] Optionally, the target message determination module can be specifically used to: obtain the results fed back by the object under test based on the abnormal messages that have been sent in parallel; if the fed back results contain abnormal content, determine that the object under test has an abnormality; send the candidate abnormal message that triggers the object under test to feedback the abnormal content to the object under test again; if the candidate abnormal message triggers the abnormality of the object under test again, use the candidate abnormal message as the target abnormal message.
[0174] The device provided in the embodiment of the present application can be used to execute the method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0175] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the message acquisition module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above message acquisition module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0176] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8As shown, the electronic device 800 includes: at least one processor 801, a memory 802, a bus 803 and a communication interface 804. Among them: the processor, the communication interface and the memory communicate with each other through the bus. The communication interface is used to communicate with other devices. The communication interface includes a communication interface for data transmission and a display interface or an operation interface for human-computer interaction.
[0177] The processor is used to execute the computer-executable instructions stored in the memory, and specifically can execute the relevant steps in the method described in the above embodiment.
[0178] The processor may be a central processing unit, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement an embodiment of the present invention. The one or more processors included in the review device may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs. The memory is used to store computer execution instructions. The memory may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
[0179] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When at least one processor of an electronic device executes the computer instructions, the electronic device executes the methods provided in the above-mentioned various implementation modes.
[0180] This embodiment also provides a computer program product, which includes computer instructions stored in a readable storage medium. At least one processor of the electronic device can read the computer instructions from the readable storage medium, and at least one processor executes the computer instructions so that the electronic device implements the methods provided in the above various embodiments.
[0181] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0182] It is to be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the size of the sequence number of each process does not 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 application.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A fuzzy testing method based on multidimensional time series abnormal observation, characterized in that: include: Obtain abnormal messages for fuzz testing; Sending the abnormal message to the object under test in parallel, obtaining multi-dimensional time series data after the object under test receives the abnormal message, wherein the multi-dimensional time series data includes at least one sampling time point after the start of the fuzzy test and state data of the object under test in multiple dimensions at the sampling time point; Based on the state data of the measured object in various dimensions at the sampling time point, determining whether the measured object is abnormal at the sampling time point; If the measured object is abnormal at the sampling time point, a target abnormal message that triggers the abnormality of the measured object is determined from the abnormal messages that have been sent in parallel; Based on the target abnormal message, obtain a fuzzy test result; The determining whether the measured object is abnormal at the sampling time point based on the state data of the measured object in various dimensions at the sampling time point includes: Converting the state data of the measured object in each dimension at the sampling time point into corresponding coordinate values to form a multidimensional vector, wherein each coordinate value in the multidimensional vector is used to represent the state data in one dimension; Based on the trained abnormal observation model, determining whether each coordinate value in the multidimensional vector matches a reference value range of a corresponding dimension; If there is at least one coordinate value in the multidimensional vector that does not match the reference value range of the corresponding dimension, it is determined that the object under test is abnormal.
2. The method according to claim 1, characterized in that The forming of a multi-dimensional vector comprises: Based on the data format and value range of the status data in each dimension, determine the processing method of each status data; Based on the processing method, the state data is normalized to form normalized values corresponding to each state data as the coordinate value.
3. The method according to claim 1, characterized in that Before determining whether each coordinate value in the multidimensional vector matches the reference value range of the corresponding dimension based on the trained abnormal observation model, the method further includes: Acquire first multi-dimensional time series data of the measured object in a first time period before the abnormality; Using the first multidimensional time series data as training data, training the abnormal observation model until a training completion condition is met; Based on the trained anomaly detection model, the benchmark value range is determined.
4. The method according to claim 3, characterized in that The abnormal observation model is trained until the training completion condition is met, including Acquire second multidimensional time series data of the measured object in a second time period before the abnormality, wherein the first time period and the second time period are different time periods; Using the second multidimensional time series data as an input of the trained abnormal observation model, obtaining an output result of the trained abnormal observation model, wherein the output result is used to characterize whether the measured object is normal or abnormal; If the output result indicates that the measured object is abnormal, continue to obtain training data and continue to train the abnormal observation model; If the output result indicates that the measured object is normal, it is determined that the abnormal observation model meets the training completion condition.
5. The method according to claim 1, characterized in that The obtaining of multi-dimensional time series data after the measured object receives the abnormal message includes: Based on the set sampling interval, determine each sampling time point after the abnormal message is sent in parallel to the measured object; At each sampling time point, based on a specific sampling method, the state data of the measured object in each dimension is obtained, and the state data of different dimensions are sampled based on different sampling methods.
6. The method according to claim 5, characterized in that The acquiring of the state data of the measured object in each dimension based on a specific sampling method, wherein the state data of different dimensions are obtained by sampling based on different sampling methods, includes: determining whether the specific sampling method is direct sampling or indirect sampling; If the specific sampling method is direct sampling, then based on at least one of an Internet Control Message Protocol request, a Transmission Control Protocol request, a Hypertext Transfer Protocol request, a Secure Shell Protocol request, and a Software Development Kit request, the state data of the object under test in multiple dimensions is sampled; If the specific sampling method is indirect sampling, the state data of the object under test in multiple dimensions is sampled remotely based on the secure shell protocol, or an agent program is run on the object under test using an injection method to sample the state data of the object under test in multiple dimensions in real time, wherein the state data includes a process identifier, port status, file handle, processor usage, and memory usage.
7. The method according to any one of claims 1 to 6, characterized in that The step of determining the target abnormal message that triggers the abnormality of the object under test from the abnormal messages that have been sent in parallel includes: Obtaining M first abnormal messages that the measured object last sends to the measured object before the abnormality occurs, where M is a positive integer; Based on the original sending order of each first abnormal message, each first abnormal message is sent again in reverse order to the measured object after it returns to normal, and it is determined whether there is a second abnormal message that triggers the abnormality of the measured object again; If there is a second abnormal message that triggers the abnormality of the measured object again, the second abnormal message is used as the target abnormal message.
8. The method according to any one of claims 1 to 6, characterized in that The step of determining the target abnormal message that triggers the abnormality of the object under test from the abnormal messages that have been sent in parallel includes: Obtaining the result fed back by the measured object according to the abnormal message sent in parallel; If the feedback result contains abnormal content, it is determined that the object under test is abnormal; Sending the candidate abnormal message that triggers the measured object to feedback abnormal content again to the measured object; If the candidate abnormal message triggers the abnormality of the measured object again, the candidate abnormal message is used as the target abnormal message.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.
Citation Information
Patent Citations
A method and system for testing network attack of industrial control equipment
CN109104335A
Network equipment concurrent fuzzy testing method and device based on variation strategy
CN113992433A
