CN113326181A - Fuzzy test method, device and storage medium for stateful network protocol - Google Patents

Fuzzy test method, device and storage medium for stateful network protocol Download PDF

Info

Publication number
CN113326181A
CN113326181A CN202010132978.9A CN202010132978A CN113326181A CN 113326181 A CN113326181 A CN 113326181A CN 202010132978 A CN202010132978 A CN 202010132978A CN 113326181 A CN113326181 A CN 113326181A
Authority
CN
China
Prior art keywords
protocol
protocol state
test
test case
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010132978.9A
Other languages
Chinese (zh)
Inventor
栾俊超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010132978.9A priority Critical patent/CN113326181A/en
Publication of CN113326181A publication Critical patent/CN113326181A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers

Abstract

The application discloses a fuzzy test method, a fuzzy test device and a storage medium of a stateful network protocol, and belongs to the field of security test. The method is applied to a fuzz tester and comprises the following steps: generating a test case for carrying out fuzzy test on a first protocol state of a stateful network protocol, and determining program execution information corresponding to the first protocol state; sending the test case to a target program to perform fuzzy test on the state of the first protocol, wherein the target program uses a stateful network protocol; sending the program execution information to a monitor, and determining the quality score of the test case by the monitor according to the program execution information and the execution path of the target program; and when the quality score sent by the monitor is received, if the quality score is greater than or equal to a score threshold value, generating a new test case for carrying out the fuzzy test on the first protocol state according to the test case. The method and the device can improve the quality of the test case, and therefore the fuzzy test efficiency can be improved.

Description

Fuzzy test method, device and storage medium for stateful network protocol
Technical Field
The present application relates to the field of security testing, and in particular, to a method and an apparatus for fuzzy testing of stateful network protocols, and a storage medium.
Background
With the complexity and importance of various network services increasing, the security of the network protocol on which the network service depends also becomes more and more important. However, due to the complexity of network protocols, security holes are inevitably introduced in the design and implementation of network protocols. The fuzzy test is an important means for discovering the security vulnerability, and plays an important role in vulnerability mining of the network protocol. The basic principle of the fuzz test is to discover the security vulnerability by constructing a large amount of variant data to send to a target program and monitoring whether the target program is abnormal.
In order to perform a fuzzy test on a stateful network protocol, at present, a finite state machine model is used to generate all state transition paths of the stateful network protocol, and then a fuzzy test is performed on each state transition path, and a monitor is responsible for monitoring whether network traffic and a process state are abnormal or not. The test cases are generated based on the raw data samples and the finite state machine model, and can be covered with each protocol state of the state network protocol.
However, in the above manner, the generation of the test case mainly depends on the original sample data and the finite-state machine model, and the generation manner is simple, so that the quality of the generated test case is low.
Disclosure of Invention
The application provides a fuzzy test method and device of a stateful network protocol and a computer storage medium, which can improve the fuzzy test efficiency. The technical scheme is as follows:
in a first aspect, a fuzzy test method of a stateful network protocol is provided, which is applied to a fuzzy tester.
Generating a test case for carrying out fuzzy test on a first protocol state of a stateful network protocol, and determining program execution information corresponding to the first protocol state; sending a test case to the target program to perform fuzzy test on the first protocol state, wherein the target program uses the stateful network protocol; sending the program execution information to a monitor, and determining the quality score of the test case by the monitor according to the program execution information and the execution path of the target program; and when the quality score sent by the monitor is received, if the quality score is greater than or equal to a score threshold value, generating a new test case for performing fuzzy test on the first protocol state according to the test case.
In the application, when the fuzzy tester receives the quality score sent by the monitor, if the quality score is greater than or equal to the score threshold value, which indicates that the quality of the test case is better, a new test case for carrying out the fuzzy test on the first protocol state is generated according to the test case, and the quality of the new test case is better at this time, so that the fuzzy test efficiency can be improved.
Optionally, the method further comprises: and constructing a Petri network model according to the description information of the stateful network protocol, wherein the Petri network model is used for describing a protocol state, a migration relation and program execution information corresponding to the protocol state. Correspondingly, the determining the program execution information corresponding to the first protocol state includes: and acquiring program execution information corresponding to the first protocol state from the Petri network model.
In the embodiment of the application, the program execution information corresponding to the first protocol state is accurately acquired through the Petri network model by constructing the Petri network model, so that the actual execution effect of the test case can be accurately determined in the following process, namely the quality of the test case is determined.
Optionally, the method further comprises: if the fuzzy test on the first protocol state meets a preset condition, determining one protocol state in the adjacent reachable protocol states of the first protocol state as a second protocol state through the Petri network model; and carrying out fuzzing test on the second protocol state.
It should be noted that there may be one or more protocol states that are reachable adjacent to the first protocol state. In this case, when there is only one adjacent reachable protocol state of the first protocol state, the one can be directly regarded as the second protocol state. When there are a plurality of adjacent reachable protocol states of the first protocol state, one of the plurality may be selected as the second protocol state.
In addition, preset conditions may be set in advance, and the preset conditions include at least one of the following three items: a new path is not triggered within a preset time length; the coverage rate of the program code of the target program reaches a preset proportion; the number of the executed test cases reaches the preset number.
In the present application, when the fuzz test on the first protocol state meets the preset condition, it indicates that the fuzz test on the first protocol state is sufficient, so the fuzz test on the second protocol state can be continued.
Optionally, the quality score of the test case is determined by the monitor according to the detection result after detecting whether the test case reaches an adjacent reachable protocol state, whether a new path is triggered, and whether a program is triggered abnormally according to the program execution information and the execution path of the target program.
In a second aspect, a fuzzy test apparatus of a stateful network protocol is provided, where the fuzzy test apparatus of the stateful network protocol has a function of implementing the behavior of the fuzzy test method of the stateful network protocol in the first aspect. The fuzzy test device for the stateful network protocol comprises at least one module, and the at least one module is used for implementing the fuzzy test method for the stateful network protocol provided by the first aspect.
In a third aspect, a fuzzy test apparatus for a stateful network protocol is provided, where the structure of the fuzzy test apparatus for a stateful network protocol includes a processor and a memory, and the memory is configured to store a program for the fuzzy test apparatus supporting the stateful network protocol to execute the fuzzy test method for the stateful network protocol provided in the first aspect, and store data used for implementing the fuzzy test method for the stateful network protocol in the first aspect. The processor is configured to execute programs stored in the memory. The fuzzy test device of the stateful network protocol may further include a communication bus for establishing a connection between the processor and the memory.
In a fourth aspect, a computer-readable storage medium is provided, which has instructions stored therein, which when run on a computer, cause the computer to perform the fuzz testing method of a stateful network protocol according to the first aspect described above.
In a fifth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for fuzz testing of a stateful network protocol according to the first aspect described above.
The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.
Drawings
FIG. 1 is a schematic diagram of a test system provided in an embodiment of the present application;
FIG. 2 is a flowchart of a fuzzy testing method for a stateful network protocol according to an embodiment of the present application;
fig. 3 is a schematic diagram of a stateful network protocol provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a Petri Net model provided by an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a fuzzy test apparatus for a stateful network protocol according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, an application scenario of the embodiments of the present application will be described.
Fig. 1 is a schematic diagram of a test system according to an embodiment of the present application. Referring to fig. 1, the test system includes a fuzz tester 101 and a tested machine 102. The fuzz tester 101 includes a test portion 1011 and an auxiliary portion 1012. The tested machine 102 includes an object 1021 and a monitor 1022.
The test section 1011 is used for generating test cases and session management. The test case can be generated by mutating the protocol message, or can be generated by combining a plurality of test cases and utilizing a genetic algorithm. Session management is responsible for managing which protocol states are fuzzed. The auxiliary portion 1012 is used to send test cases to the target program 1021, and specifically, the auxiliary portion 1012 includes a controller 10121 and a driving module 10122. The controller 10121 is configured to process the test case into a message that can be transmitted to the tested machine 102, and the driver module 10122 is configured to send the message processed by the controller 10121 to the target program 1021 in the tested machine 102. The monitor 1022 is responsible for monitoring and controlling the operating status of the object 1021.
Fig. 2 is a flowchart of a fuzz testing method for a stateful network protocol according to an embodiment of the present disclosure. Referring to fig. 2, the method includes:
step 201: the fuzzy tester generates a test case for carrying out fuzzy test on a first protocol state of the stateful network protocol, and determines program execution information corresponding to the first protocol state.
It should be noted that a network protocol refers to a set of rules that must be followed when exchanging information between peer entities communicating with each other in a computer network. Stateful network protocols refer to protocols whose protocol states are related to previous requests. That is, after receiving the request from the client, the server returns a corresponding response, and the response of the next request is affected by the current request. A request can only be properly responded to if the server is in a particular protocol state.
The program execution information corresponding to a certain protocol state refers to information related to program codes that can be executed in the protocol state, and may include a program execution function, a program execution address, and the like. And after the program code indicated by the corresponding program execution information is executed in a certain protocol state, the protocol state which is adjacent to and reachable to the protocol state can be reached. The protocol state that can be reached next to a certain protocol state is the next protocol state that can be reached directly by the corresponding mutual information in this protocol state.
For example, the program execution information corresponding to the first protocol state refers to information related to program codes executable in the first protocol state. After the program code indicated by the corresponding program execution information is executed in the first protocol state, the protocol state that is adjacent to and reachable from the first protocol state can be reached.
When the fuzzy tester generates a test case for carrying out fuzzy test on a first protocol state of a stateful network protocol, a protocol message in the first protocol state can be mutated to obtain the test case for carrying out the fuzzy test on the first protocol state; or, the old test case used for the fuzzing test of the first protocol state before can be modified to obtain the test case to be used this time. Of course, the test case for performing the fuzz test on the first protocol state may also be generated in other ways, which is not limited in this application.
When determining the program execution information corresponding to the first protocol state, the fuzzy tester may obtain the program execution information corresponding to the first protocol state from the Petri net model.
It should be noted that the Petri net model may be constructed by the fuzz tester according to the specification information of the stateful network protocol. The Petri network model is used for describing a protocol state, a migration relation and program execution information corresponding to the protocol state.
In addition, the Petri network model comprises a library set, a transition set and a flow relation. In the present application, a library pool comprises a plurality of libraries, each library indicating a protocol state; the transition set comprises a plurality of transitions, each transition indicating program execution information; one library has a flow relationship with one transition, and the protocol state indicated by the one library corresponds to the program execution information indicated by the one transition; the method comprises the steps that a library has a flow relationship with a transition, the transition has a flow relationship with another library, and the flow relationship represents that the protocol state indicated by the library has a flow relationship with the protocol state indicated by the other library, namely, the protocol state indicated by the library is adjacent to the reachable protocol state which is the protocol state indicated by the other library.
When the fuzzy tester constructs the Petri network model according to the description information of the stateful network protocol, determining all protocol states in the stateful network protocol and the migration relationship among the protocol states according to the description information of the stateful network protocol, determining relevant information of program codes capable of being executed in each protocol state as corresponding program execution information, then taking the protocol states as libraries, taking the program execution information as transitions, and constructing the flow relationship between the libraries and the transitions according to the migration relationship and the correspondence relationship between the protocol states and the program execution information to obtain the Petri network model.
For example, in the stateful network protocol shown in fig. 3, it may be determined that there are five protocol states in the stateful network protocol: protocol state 1: receive request 1 and return response 1; protocol state 2: receive request 2 and return response 2; protocol state 3: receive request 3 and return response 3 and message 1; protocol state 4: receiving message 2 and returning message 3; protocol state 5: a message 4 is received. And, the transition relationship of these five protocol states is from protocol state 1 to protocol state 5 in sequence. At this time, program execution information corresponding to each of the five protocol states may be obtained, so as to obtain five program execution information. Then, taking the protocol states 1 to 5 as the library locations 0 to 4 one by one, taking the five program execution information as the transitions 0 to 4 one by one, and constructing the flow relationship between the library locations and the transitions according to the transition relationship and the corresponding relationship between the five protocol states and the five program execution information to obtain the Petri network model shown in fig. 4.
Step 202: and the fuzzing tester sends the test case to the target program so as to carry out fuzzing test on the first protocol state.
It should be noted that the target program uses the stateful network protocol. After receiving the test case, the target program triggers the running of the target program, specifically, triggers the execution of the corresponding program code in the target program. Therefore, whether the abnormity occurs can be monitored in the running process of the target program, and the fuzzy test of the first protocol state can be realized.
Step 203: and the fuzzy tester sends the program execution information corresponding to the first protocol state to the monitor.
It should be noted that the monitor may monitor the operation of the target program. That is, after the target program receives the test case sent by the fuzz tester, the monitor may monitor an execution path of the target program, where the execution path is a program code executed by the target program.
Step 204: and when the monitor receives program execution information corresponding to the first protocol state sent by the fuzzy tester, determining the quality score of the test case according to the program execution information and the execution path of the target program.
It should be noted that the quality score of the test case may reflect the quality of the test case. That is, the higher the quality score of the test case is, the better the quality of the test case is, that is, the test case can more effectively cause an error in the target program, that is, a fault can be more easily caused. Therefore, the test case with higher quality can be used, and the test efficiency can be greatly improved.
In this embodiment of the present application, the monitor may accurately evaluate the quality of the test case according to the program execution information that should be triggered in the first protocol state and the actual execution path of the target program, so as to obtain the quality score of the test case.
Specifically, the monitor may detect whether the test case reaches an adjacent reachable protocol state, whether a new path is triggered, and whether a program exception is triggered according to the program execution information and an execution path of the target program, and determine a quality score of the test case according to a detection result.
It should be noted that, when the execution path of the target program includes the program indication information, the monitor may determine that the test case reaches the adjacent reachable protocol state. And when the execution path of the target program comprises a path which does not appear when the fuzzing test is carried out on the first protocol state, determining that the test case triggers a new path. And when the execution path of the target program is abnormal, determining that the test case triggers the program abnormality.
In addition, when the quality score of the test case is determined according to the detection result, a corresponding relationship between the detection result and the quality score may be preset, and then the quality score corresponding to the detection result is obtained from the corresponding relationship and is used as the quality score of the test case.
In one possible mode, the monitor may first detect whether the test case reaches an adjacent reachable protocol state according to the program execution information and an execution path of the target program; if the test case reaches the adjacent reachable protocol state, the quality score of the test case can be directly determined to be a first score; if the test case does not reach the adjacent reachable protocol state, determining whether the test case triggers a new path or not; if the test case triggers a new path, continuously monitoring whether the test case triggers program abnormity; if the test case does not trigger program abnormity, determining that the quality score of the test case is a second score; if the test case triggers a program exception, the quality score of the test case can be determined to be the third score.
It should be noted that the first score, the second score, and the third score may be preset, and the first score is smaller than the second score, and the second score is smaller than the third score. That is, the quality of the test case that does not reach the adjacent reachable protocol state, but triggers a new path and triggers a program exception is the best; the quality of the test case which does not trigger program abnormity is good, but a new path is triggered without reaching the adjacent reachable protocol state; the quality of test cases that reach the adjacent reachable protocol state is the worst. For example, the first score may be 1, the second score may be 3, and the third score may be 5.
Step 203: the monitor sends the quality score of the test case to the fuzz tester.
Step 204: when the fuzzy tester receives the quality score of the test case sent by the monitor, if the quality score of the test case is greater than or equal to a score threshold value, a new test case for carrying out fuzzy test on the first protocol state is generated according to the test case.
It should be noted that the score threshold may be set in advance, and the score threshold may be set to be larger, for example, when the first score is 1 point, the second score is 3 points, and the third score is 5 points, the score threshold may be set to be 3 points.
If the quality score of the test case is greater than or equal to the score threshold, the quality of the test case is better, and therefore the quality of a new test case which is generated according to the test case and used for performing the fuzz test on the first protocol state is also better. And with the increase of the number of the test cases, the quality of the test cases can be continuously improved, so that the overall quality of the test cases and the efficiency of the fuzzy test are greatly improved.
When a new test case for performing the fuzzy test on the first protocol state is generated according to the test case, the test case can be modified to obtain the new test case for performing the fuzzy test on the first protocol state.
It should be noted that, when the test case is modified, the test case may be directly modified. And obtaining a new test case for performing the fuzz test on the first protocol state through a genetic algorithm according to the test case and other test cases which are used for performing the fuzz test on the first protocol state and have the quality scores larger than the score threshold.
Notably, after obtaining the new test case, the step 202 can be returned to continue the fuzz testing of the first protocol state using the new test case.
Further, the fuzzy tester may determine one protocol state of the adjacent reachable protocol states of the first protocol state as a second protocol state through the Petri net model when the fuzzy test of the first protocol state satisfies a preset condition, and then perform the fuzzy test on the second protocol state.
It should be noted that there may be one or more protocol states that are reachable adjacent to the first protocol state. In this case, when there is only one adjacent reachable protocol state of the first protocol state, the one can be directly regarded as the second protocol state. When there are a plurality of adjacent reachable protocol states of the first protocol state, one of the plurality may be selected as the second protocol state.
In addition, the way of performing the fuzz test on the second protocol state is similar to the way of performing the fuzz test on the first protocol state in the present application, and details thereof are not described in this embodiment of the present application.
Furthermore, the preset condition can be preset, and when the fuzz test of the first protocol state meets the preset condition, the fuzz test of the first protocol state is shown to be sufficient, so that the fuzz test of the second protocol state can be continuously carried out.
For example, the preset condition may include at least one of the following three items: a new path is not triggered within a preset time length; the coverage rate of the program code of the target program reaches a preset proportion; the number of the executed test cases reaches the preset number.
It should be noted that the preset time period may be preset, and the preset time period may be set to be larger, for example, the preset time period may be 24 hours. The preset proportion may also be preset, and the preset proportion may be set to be larger, for example, the preset proportion may be 80%. The preset number may also be preset, and the preset number may be larger, for example, the preset number may be 10 ten thousand.
In addition, the monitor can count and return the information of the new path triggering condition, the coverage rate of the program code of the target program and the number of the executed test cases in the preset time length to the fuzzy tester.
In the embodiment of the application, a test case for performing the fuzzy test on the first protocol state of the stateful network protocol is generated, and after program execution information corresponding to the first protocol state is determined, the test case is sent to a target program so as to perform the fuzzy test on the first protocol state. And then, the fuzzy tester sends the program execution information to a monitor, and the monitor determines the quality score of the test case according to the program execution information and the execution path of the target program and sends the quality score to the fuzzy tester. When the fuzzy tester receives the quality score sent by the monitor, if the quality score is greater than or equal to the score threshold, the quality of the test case is better, a new test case for carrying out the fuzzy test on the first protocol state is generated according to the test case, the quality of the new test case is better at this time, and therefore the fuzzy test efficiency can be improved.
Fig. 5 is a schematic structural diagram of a fuzzy test apparatus for a stateful network protocol according to an embodiment of the present application. As shown in fig. 5, the apparatus 500 includes:
a generating module 501, configured to generate a test case for performing a fuzzy test on a first protocol state of a stateful network protocol, and determine program execution information corresponding to the first protocol state;
a sending module 502, configured to send the test case to a target program to perform a fuzzy test on a first protocol state, where the target program uses a stateful network protocol;
the sending module 501 is further configured to send the program execution information to a monitor, and the monitor determines the quality score of the test case according to the program execution information and the execution path of the target program;
the generating module 502 is further configured to, when the quality score sent by the monitor is received, generate a new test case for performing a fuzzy test on the first protocol state according to the test case if the quality score is greater than or equal to the score threshold.
Optionally, the apparatus 500 further comprises:
the system comprises a building module, a state network module and a migration module, wherein the building module is used for building a Petri network model according to the description information of the stateful network protocol, and the Petri network model is used for describing a protocol state, a migration relation and program execution information corresponding to the protocol state;
the generation module is to:
and acquiring program execution information corresponding to the first protocol state from the Petri network model.
Optionally, the apparatus 500 further comprises:
the determining module is used for determining one protocol state in the adjacent reachable protocol states of the first protocol state as a second protocol state through the Petri network model if the fuzzy test of the first protocol state meets the preset condition;
and the test module is used for carrying out fuzzing test on the second protocol state.
Optionally, the preset condition includes at least one of the following three items:
a new path is not triggered within a preset time length;
the coverage rate of the program code of the target program reaches a preset proportion;
the number of the executed test cases reaches the preset number.
Optionally, the quality score of the test case is determined by the monitor according to the detection result after detecting whether the test case reaches the adjacent reachable protocol state, whether a new path is triggered, and whether a program is triggered abnormally according to the program execution information and the execution path of the target program.
In the embodiment of the application, a test case for performing the fuzzy test on the first protocol state of the stateful network protocol is generated, and after program execution information corresponding to the first protocol state is determined, the test case is sent to a target program so as to perform the fuzzy test on the first protocol state. And then, the fuzzy tester sends the program execution information to a monitor, and the monitor determines the quality score of the test case according to the program execution information and the execution path of the target program and sends the quality score to the fuzzy tester. When the fuzzy tester receives the quality score sent by the monitor, if the quality score is greater than or equal to the score threshold, the quality of the test case is better, a new test case for carrying out the fuzzy test on the first protocol state is generated according to the test case, the quality of the new test case is better at this time, and therefore the fuzzy test efficiency can be improved.
It should be noted that: in the fuzzy test device of the stateful network protocol provided in the foregoing embodiment, when performing the fuzzy test of the stateful network protocol, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the fuzzy test apparatus of the stateful network protocol provided in the above embodiments and the fuzzy test method embodiment of the stateful network protocol belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. Referring to fig. 6, the computer device comprises at least one processor 601, a communication bus 602, a memory 603 and at least one communication interface 604.
The processor 601 may be a microprocessor (including a Central Processing Unit (CPU), etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of programs according to the present disclosure.
The communication bus 602 may include a path for communicating information between the aforementioned components.
The memory 603 may be, but is not limited to, a read-Only memory (ROM), a Random Access Memory (RAM), an electrically erasable programmable read-Only memory (EEPROM), an optical disk (including a compact disc read-Only memory (CD-ROM), a compact disc, a laser disk, a digital versatile disk, a blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 603 may be separate and coupled to the processor 601 through a communication bus 602. The memory 603 may also be integrated with the processor 601.
The communication interface 604 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
In particular implementations, processor 601 may include one or more CPUs such as CPU0 and CPU1 shown in fig. 6 as an example.
In particular implementations, a computer device may include multiple processors, such as processor 601 and processor 605 shown in FIG. 6, as an example. Each of these processors may be a single core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, a computer device may also include an output device 606 and an input device 607, as one embodiment. The output device 606 is in communication with the processor 601 and may display information in a variety of ways. For example, the output device 606 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 607 is in communication with the processor 601 and may receive user input in a variety of ways. For example, the input device 607 may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.
The computer device may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device may be a desktop computer, a laptop computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, and the embodiment of the present application does not limit the type of the computer device.
The memory 603 is used for storing the program code 610 for executing the scheme of the present application, and the processor 601 is used for executing the program code 610 stored in the memory 603. The computer device may implement the fuzz testing method for stateful network protocols provided by the embodiment of fig. 2 above, via the processor 601 and the program code 610 in the memory 603.
In the above embodiments, the implementation may be wholly or partly realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A fuzz testing method of a stateful network protocol, applied to a fuzz tester, the method comprising:
generating a test case for carrying out fuzzy test on a first protocol state of a stateful network protocol, and determining program execution information corresponding to the first protocol state;
sending a test case to the target program to perform fuzzy test on the first protocol state, wherein the target program uses the stateful network protocol;
sending the program execution information to a monitor, and determining the quality score of the test case by the monitor according to the program execution information and the execution path of the target program;
and when the quality score sent by the monitor is received, if the quality score is greater than or equal to a score threshold value, generating a new test case for performing fuzzy test on the first protocol state according to the test case.
2. The method of claim 1, wherein the method further comprises:
constructing a Petri network model according to the description information of the stateful network protocol, wherein the Petri network model is used for describing a protocol state, a migration relation and program execution information corresponding to the protocol state;
the determining of the program execution information corresponding to the first protocol state includes:
and acquiring program execution information corresponding to the first protocol state from the Petri network model.
3. The method of claim 2, wherein the method further comprises:
if the fuzzy test on the first protocol state meets a preset condition, determining one protocol state in the adjacent reachable protocol states of the first protocol state as a second protocol state through the Petri network model;
and carrying out fuzzing test on the second protocol state.
4. The method of claim 3, wherein the preset condition comprises at least one of:
a new path is not triggered within a preset time length;
the coverage rate of the program code of the target program reaches a preset proportion;
the number of the executed test cases reaches the preset number.
5. The method according to any of claims 1-4, wherein the quality score of the test case is determined by the monitor according to the detection result after detecting whether the test case reaches the adjacent reachable protocol state, whether a new path is triggered, and whether a program exception is triggered, according to the program execution information and the execution path of the target program.
6. A fuzz testing apparatus for stateful network protocols, the apparatus comprising:
the system comprises a generating module, a judging module and a processing module, wherein the generating module is used for generating a test case for carrying out fuzzy test on a first protocol state of a stateful network protocol and determining program execution information corresponding to the first protocol state;
a sending module, configured to send a test case to the target program to perform a fuzzy test on the first protocol state, where the target program uses the stateful network protocol;
the sending module is further configured to send the program execution information to a monitor, and the monitor determines the quality score of the test case according to the program execution information and the execution path of the target program;
the generating module is further configured to, when the quality score sent by the monitor is received, generate a new test case for performing a fuzzy test on the first protocol state according to the test case if the quality score is greater than or equal to a score threshold.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the building module is used for building a Petri network model according to the description information of the stateful network protocol, and the Petri network model is used for describing a protocol state, a migration relation and program execution information corresponding to the protocol state;
the generation module is configured to:
and acquiring program execution information corresponding to the first protocol state from the Petri network model.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the determining module is used for determining one protocol state in the adjacent reachable protocol states of the first protocol state as a second protocol state through the Petri network model if the fuzzy test of the first protocol state meets the preset condition;
and the test module is used for carrying out fuzzy test on the second protocol state.
9. The apparatus of claim 8, wherein the preset condition comprises at least one of:
a new path is not triggered within a preset time length;
the coverage rate of the program code of the target program reaches a preset proportion;
the number of the executed test cases reaches the preset number.
10. The apparatus according to any of claims 6-9, wherein the quality score of the test case is determined by the monitor according to the program execution information and the execution path of the target program after detecting whether the test case reaches the adjacent reachable protocol state, whether a new path is triggered, and whether a program exception is triggered.
11. A computer-readable storage medium having stored therein instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1-5.
12. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 5.
CN202010132978.9A 2020-02-29 2020-02-29 Fuzzy test method, device and storage medium for stateful network protocol Pending CN113326181A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010132978.9A CN113326181A (en) 2020-02-29 2020-02-29 Fuzzy test method, device and storage medium for stateful network protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010132978.9A CN113326181A (en) 2020-02-29 2020-02-29 Fuzzy test method, device and storage medium for stateful network protocol

Publications (1)

Publication Number Publication Date
CN113326181A true CN113326181A (en) 2021-08-31

Family

ID=77413109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010132978.9A Pending CN113326181A (en) 2020-02-29 2020-02-29 Fuzzy test method, device and storage medium for stateful network protocol

Country Status (1)

Country Link
CN (1) CN113326181A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205340A (en) * 2021-12-23 2022-03-18 绿盟科技集团股份有限公司 Fuzzy test method and device based on intelligent power equipment
CN114328173A (en) * 2021-10-27 2022-04-12 清华大学 Software fuzzing test method and device, electronic equipment and storage medium
CN114944997A (en) * 2022-03-24 2022-08-26 浙江大华技术股份有限公司 Protocol detection method, protocol detection device and computer readable storage medium
CN115174441A (en) * 2022-09-06 2022-10-11 中国汽车技术研究中心有限公司 State machine based TCP fuzzy test method, equipment and storage medium
CN115225551A (en) * 2022-07-14 2022-10-21 北京邮电大学 Fuzzy test method, device, equipment and storage medium
CN115576852A (en) * 2022-11-21 2023-01-06 博智安全科技股份有限公司 Quality evaluation method, device, equipment and storage medium of fuzzy test case

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328173A (en) * 2021-10-27 2022-04-12 清华大学 Software fuzzing test method and device, electronic equipment and storage medium
CN114205340A (en) * 2021-12-23 2022-03-18 绿盟科技集团股份有限公司 Fuzzy test method and device based on intelligent power equipment
CN114205340B (en) * 2021-12-23 2024-04-02 绿盟科技集团股份有限公司 Fuzzy test method and device based on intelligent power equipment
CN114944997A (en) * 2022-03-24 2022-08-26 浙江大华技术股份有限公司 Protocol detection method, protocol detection device and computer readable storage medium
CN114944997B (en) * 2022-03-24 2024-02-20 浙江大华技术股份有限公司 Protocol detection method, protocol detection device and computer readable storage medium
CN115225551A (en) * 2022-07-14 2022-10-21 北京邮电大学 Fuzzy test method, device, equipment and storage medium
CN115225551B (en) * 2022-07-14 2024-03-29 北京邮电大学 Fuzzy test method, device, equipment and storage medium
CN115174441A (en) * 2022-09-06 2022-10-11 中国汽车技术研究中心有限公司 State machine based TCP fuzzy test method, equipment and storage medium
CN115576852A (en) * 2022-11-21 2023-01-06 博智安全科技股份有限公司 Quality evaluation method, device, equipment and storage medium of fuzzy test case

Similar Documents

Publication Publication Date Title
CN113326181A (en) Fuzzy test method, device and storage medium for stateful network protocol
US9384114B2 (en) Group server performance correction via actions to server subset
US11706079B2 (en) Fault recovery method and apparatus, and storage medium
US20160224400A1 (en) Automatic root cause analysis for distributed business transaction
US20130212257A1 (en) Computer program and monitoring apparatus
CN110784374A (en) Method, device, equipment and system for monitoring operation state of service system
CN113342559A (en) Diagnostic framework in a computing system
JP2018028783A (en) System state visualization program, system state visualization method, and system state visualization device
US8301605B2 (en) Managing maintenance tasks for computer programs
US10019309B2 (en) Analytics-based dynamic adaptation of client-server mobile applications
CN107783844A (en) A kind of computer program operation exception detection method, device and medium
CN111240876A (en) Fault positioning method and device for microservice, storage medium and terminal
US10191844B2 (en) Automatic garbage collection thrashing monitoring
CN110287049B (en) Data processing method, device and storage medium
CN115037653B (en) Service flow monitoring method, device, electronic equipment and storage medium
CN108390770B (en) Information generation method and device and server
CN114827157A (en) Cluster task processing method, device and system, electronic equipment and readable medium
CN114896128A (en) Application program performance testing method and device based on block chain
CN113132431B (en) Service monitoring method, service monitoring device, electronic device, and medium
US20080125878A1 (en) Method and system to detect application non-conformance
JP6926646B2 (en) Inter-operator batch service management device and inter-operator batch service management method
CN113778780A (en) Application stability determination method and device, electronic equipment and storage medium
CN111784174A (en) Method and device for managing risk policy based on user portrait and electronic equipment
CN111708649B (en) Attack detection method and system for service application system
CN115150253B (en) Fault root cause determining method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination