Network testing method and device applied to alliance chain, equipment, medium and product

By simulating DDoS attacks and generating attack script files, the alliance chain was tested, and the single problem at the test level in the existing technology was solved, and the comprehensive performance and security evaluation of the alliance chain was achieved, which improved the testing effect.

CN119276453APending Publication Date: 2025-01-07CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411161296.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

There is a lack of dedicated testing tools for alliance chains in the existing technology. Traditional network testing methods can only test performance and cannot comprehensively evaluate the security and performance of alliance chains, resulting in poor testing results.

Method used

Provide a network testing method applied to alliance chains, which can simulate DDoS attacks with multiple attack methods, obtain attack parameter information, generate attack script files, simulate attack processing, obtain network status information, and then evaluate the security of alliance chains and performance.

Benefits of technology

It realizes all-round testing of the alliance chain, improves the authenticity and accuracy of the test, and can effectively evaluate the security and performance of the alliance chain, assist in enhancing its stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276453A_ABST
    Figure CN119276453A_ABST
Patent Text Reader

Abstract

The invention provides a network testing method and device applied to an alliance chain, equipment, a medium and a product, and relates to the technical field of computers. The method comprises the following steps: in response to a simulated attack configuration operation initiated by a user, acquiring attack parameter information matched with the simulated attack configuration operation; determining an attack template and an attack mode matched with the attack type included in the attack parameter information, and determining an attack script file based on the attack template, the attack mode and the attack parameter information; performing simulation attack processing on the alliance chain based on the attack script file, and obtaining network state information of the alliance chain; and determining a test result of the alliance chain based on the network state information of the alliance chain. According to the method, comprehensive testing of the alliance chain can be achieved, and the accuracy and effectiveness of alliance chain testing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a network testing method, device, equipment, medium and product applied to a consortium chain. Background Art

[0002] As the application scope of alliance chains continues to expand, how to ensure the stability and security of alliance chains has become a technical problem that needs to be solved urgently.

[0003] In the existing technology, there is a lack of dedicated testing tools for consortium chains / blockchains, and traditional network testing methods generally test the network's transaction load and performance indicators by synthesizing a large number of legitimate transaction requests.

[0004] This test method only tests the performance of the network, and the test level is relatively single, resulting in a one-sided network test result. At the same time, this test method does not test the security of the network, so it cannot effectively determine the security risks in the network, thus affecting the network test effect. Summary of the invention

[0005] The present application provides a network testing method, device, equipment, medium and product applied to a consortium chain, which is used to solve the problem that network testing in the prior art is relatively one-sided and cannot effectively determine the security risks existing in the network.

[0006] In a first aspect, the present application provides a network testing method applied to a consortium chain, comprising:

[0007] In response to a simulated attack configuration operation initiated by a user, acquiring attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node, and attack intensity of the simulated attack configured by the simulated attack configuration operation;

[0008] Determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack and / or the attack path; the attack data indicates transaction data that can be uploaded to the alliance chain;

[0009] Based on the attack script file, simulate the attack process on the alliance chain and obtain the network status information of the alliance chain;

[0010] Based on the network status information of the alliance chain, a test result of the alliance chain is determined.

[0011] In a possible design, the simulated attack indicates an attack in a transaction flood attack scenario; based on the attack script file, the alliance chain is subjected to a simulated attack process, including:

[0012] Generate first transaction data based on the attack script file; wherein the first transaction data indicates invalid transaction data and / or forged transaction data;

[0013] The first transaction data is uploaded to the alliance chain through the attack node in the attack parameter information, and the first transaction data is broadcast to other nodes included in the alliance chain except the attack node.

[0014] In a possible design, the simulated attack indicates an attack in a smart contract attack scenario; based on the attack script file, the alliance chain is subjected to a simulated attack process, including:

[0015] Based on the attack script file, generating second transaction data matching the vulnerability information of the smart contract included in the alliance chain; wherein the second transaction data indicates function call data;

[0016] After uploading the second transaction data to the alliance chain through the attack node in the attack parameter information, calling the target function in the smart contract included in the alliance chain; wherein the target function indicates a function for modifying the contract state of the smart contract;

[0017] Modify the contract state of the smart contract based on the objective function.

[0018] In one possible design, the method further includes:

[0019] If the contract state of the smart contract is not successfully modified based on the objective function, determining a smart contract call frequency;

[0020] According to the calling frequency of the smart contract, the second transaction data generated by the attack script file is uploaded to the alliance chain.

[0021] In a possible design, there are multiple attack scripts; based on the attack script files, the alliance chain is subjected to simulated attack processing, including:

[0022] Determining an attack sequence corresponding to a plurality of the attack script files;

[0023] Based on each of the attack script files and the attack sequence corresponding to each of the attack scripts, a simulated attack process is performed on the alliance chain.

[0024] In a possible design, the simulated attack includes an attack in a transaction flood attack scenario and an attack in a smart contract attack scenario; obtaining the network status information of the alliance chain includes:

[0025] Obtaining contract call information and contract broadcast information of each smart contract included in the alliance chain; and obtaining network performance indicator information of the alliance chain;

[0026] Based on the contract call information, the contract broadcast information and the network performance indicator information, the network status information of the alliance chain is determined.

[0027] In a second aspect, the present application provides a network testing device applied to a consortium chain, comprising:

[0028] A response unit, configured to respond to a simulated attack configuration operation initiated by a user and obtain attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node, and attack intensity of the simulated attack configured by the simulated attack configuration operation;

[0029] A first determination unit is used to determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack and / or the attack path; the attack data indicates transaction data that can be uploaded to the alliance chain;

[0030] An attack unit, used to perform a simulated attack process on the alliance chain based on the attack script file;

[0031] An acquisition unit, used to acquire network status information of the alliance chain;

[0032] The second determining unit is used to determine the test result of the alliance chain based on the network status information of the alliance chain.

[0033] In a possible design, the simulated attack indicates an attack in a transaction flood attack scenario; the attack unit includes a first attack module, which is used to:

[0034] Generate first transaction data based on the attack script file; wherein the first transaction data indicates invalid transaction data and / or forged transaction data;

[0035] The first transaction data is uploaded to the alliance chain through the attack node in the attack parameter information, and the first transaction data is broadcast to other nodes included in the alliance chain except the attack node.

[0036] In one possible design, the simulated attack indicates an attack in a smart contract attack scenario; the attack unit includes a second attack module, which is used to:

[0037] Based on the attack script file, generating second transaction data matching the vulnerability information of the smart contract included in the alliance chain; wherein the second transaction data indicates function call data;

[0038] After uploading the second transaction data to the alliance chain through the attack node in the attack parameter information, calling the target function in the smart contract included in the alliance chain; wherein the target function indicates a function for modifying the contract state of the smart contract;

[0039] Modify the contract state of the smart contract based on the objective function.

[0040] In a possible design, the second attack module is further used to:

[0041] If the contract state of the smart contract is not successfully modified based on the objective function, determining a smart contract call frequency;

[0042] According to the calling frequency of the smart contract, the second transaction data generated by the attack script file is uploaded to the alliance chain.

[0043] In a possible design, there are multiple attack scripts; the attack unit is used to:

[0044] Determining an attack sequence corresponding to a plurality of the attack script files;

[0045] Based on each of the attack script files and the attack sequence corresponding to each of the attack scripts, a simulated attack process is performed on the alliance chain.

[0046] In a possible design, the simulated attack includes an attack in a transaction flood attack scenario and an attack in a smart contract attack scenario; the acquisition unit is used to:

[0047] Obtaining contract call information and contract broadcast information of each smart contract included in the alliance chain; and obtaining network performance indicator information of the alliance chain;

[0048] Based on the contract call information, the contract broadcast information and the network performance indicator information, the network status information of the alliance chain is determined.

[0049] In a third aspect, an embodiment of the present application provides a computer device, comprising: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the network testing method applied to the alliance chain as described in the first aspect and various possible designs of the first aspect.

[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the network testing method applied to the alliance chain as described in the first aspect and various possible designs of the first aspect is implemented.

[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the network testing method applied to the alliance chain as described in the first aspect and various possible designs of the first aspect.

[0052] The network testing method, device, equipment, medium and product applied to the alliance chain provided by the present application can respond to the simulated attack configuration operation initiated by the user, and obtain the attack parameter information matching the simulated attack configuration operation. At this time, various types of simulated attacks can be customized by initiating the simulated attack configuration operation, so that the comprehensive test of the alliance chain can be realized based on the configured simulated attack. Then, the attack template and attack method matching the attack type included in the attack parameter information are determined, and the attack script file is determined based on the attack template, the attack method and the attack parameter information, so that the attack script file can execute the corresponding simulated attack through the pre-set attack method, so that the malicious logic of the attack can be introduced to improve the authenticity of the network test of the alliance chain, and then improve the test effect. Afterwards, the alliance chain can be simulated based on the attack script file, and the network status information of the alliance chain can be obtained, so that the test result of the alliance chain can be determined based on the network status information of the alliance chain, so that the performance and security analysis of the alliance chain can be performed according to the test result of the alliance chain, so as to help enhance the security and performance of the alliance chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] Figure 1 A flowchart of a network testing method applied to a consortium chain provided in an embodiment of the present application;

[0055] Figure 2A flowchart of another network testing method applied to a consortium chain provided in an embodiment of the present application;

[0056] Figure 3 A schematic diagram of the structure of a network testing system applied to a consortium chain provided in an embodiment of the present application;

[0057] Figure 4 A schematic diagram of an implementation flow of an attack scenario generator provided in an embodiment of the present application;

[0058] Figure 5 A schematic diagram of an implementation flow of an attack script engine provided in an embodiment of the present application;

[0059] Figure 6 A schematic diagram of the implementation process of a real-time monitoring and feedback device provided in an embodiment of the present application;

[0060] Figure 7 A schematic diagram of a transaction flood attack process provided by an embodiment of the present application;

[0061] Figure 8 A schematic diagram of a process of a smart contract attack provided in an embodiment of the present application;

[0062] Fig. 9 A schematic diagram of the structure of a network testing device applied to a consortium chain provided in an embodiment of the present application;

[0063] Fig.10 A schematic diagram of the structure of another network testing device applied to a consortium chain provided in an embodiment of the present application;

[0064] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.

[0065] 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

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0067] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0068] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0069] Terminology explanation:

[0070] Consortium chain: It is a blockchain between public chain and private chain. It is only for members of a specific group and limited third parties. It designates multiple pre-selected nodes as bookkeepers. The generation of each block is jointly decided by all pre-selected nodes. Other access nodes can participate in transactions but do not inquire about the accounting process. Other third parties can conduct limited queries through the open API of the blockchain.

[0071] DDoS attack: Distributed denial of service attack is an attack behavior in which multiple computers work together to send a large number of invalid requests to the target system, exceeding the system resource load and making the target system unable to provide services normally.

[0072] Smart Contract: A self-executing contract running on a blockchain. It is a computer program that exists in the form of code on the blockchain, which contains the rules and logic of the contract. Smart contracts are verified and executed through the consensus mechanism of the blockchain network.

[0073] As the application scope of alliance chains continues to expand, how to ensure the stability and security of alliance chains has become a technical problem that needs to be solved urgently.

[0074] In the existing technology, there is a lack of dedicated testing tools for consortium chains / blockchains, and traditional network testing methods generally test the network's transaction load and performance indicators by synthesizing a large number of legitimate transaction requests.

[0075] This test method only tests the performance of the network, and the test level is relatively single, resulting in a one-sided network test result. At the same time, this test method does not test the security of the network, so it cannot effectively determine the security risks in the network, thus affecting the network test effect.

[0076] In response to the above technical problems, this application proposes the following technical concept: by using a testing tool suitable for the alliance chain to simulate DDoS attacks of various attack methods, the alliance chain can be tested based on various types of DDoS attacks, so as to comprehensively evaluate the network security and performance of the alliance chain. In this way, the problem of single testing level and poor testing effect in the existing technology can be solved.

[0077] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0078] See also Figure 1 , Figure 1 A flowchart of a network testing method applied to a consortium chain provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0079] S101. In response to a simulated attack configuration operation initiated by a user, acquire attack parameter information matching the simulated attack configuration operation.

[0080] Among them, the simulated attack configuration operation is used to configure a simulated attack on the alliance chain; the attack parameter information includes the attack type, attack node and attack intensity of the simulated attack configured by the simulated attack configuration operation.

[0081] In one example, a user can initiate a simulated attack configuration operation through a pre-set user configuration interface to configure a simulated attack against the alliance chain. At this time, the simulated attack against the alliance chain configured by the simulated attack configuration operation initiated by the user can be any type of DDoS attack. For example, the simulated attack can indicate a transaction flood attack, that is, a simulated attack in a transaction flood attack scenario. For example, the attack type in the transaction flood attack scenario can be HTTPFlood, TCP SYN Flood, etc., or the simulated attack can also indicate a smart contract attack, that is, a simulated attack in a smart contract attack scenario, etc. There is no limitation on the scenario and type of the simulated attack.

[0082] At this time, the attack type of the simulated attack configured by the simulated attack configuration operation can be HTTP Flood, TCPSYN Flood, smart contract attack, etc. The attack node of the simulated attack configured by the simulated attack configuration operation indicates the upload node of the test data corresponding to the simulated attack. At this time, the attack node can be at least one node in the alliance chain. The attack intensity of the simulated attack configured by the simulated attack configuration operation can indicate the attack frequency, attack duration, attack bandwidth, attack payload, etc. of the simulated attack.

[0083] In an example, the attack parameter information may include not only the attack type, attack node, and attack intensity of the simulated attack, but also the concurrent number of simulated attacks, the number of attack sources, etc. The specific content of the attack intensity is not limited here and is subject to implementation.

[0084] In one example, the simulated attack configuration operation can configure one or more simulated attacks at the same time, so that the alliance chain can be tested at the same time according to different types of simulated attacks, thereby achieving a full range of testing of the alliance chain.

[0085] S102: Determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information.

[0086] Among them, the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack, and / or the attack path; the attack data indicates the transaction data that can be uploaded to the alliance chain.

[0087] In one example, multiple attack templates can be pre-set for various attack types, and the attack types can be associated with the attack templates, so that after obtaining attack parameter information matching the simulated attack configuration operation, the matching attack template can be determined according to the attack type in the attack parameter information.

[0088] In one example, the attack mode that matches the attack type may indicate the attack logic of the simulated attack that matches the attack type. For example, the attack mode may indicate the mode of generating test data according to the attack template and the attack parameter information, for example, the attack mode may indicate the type and / or quantity of test data generated according to the attack template and the attack parameter information. Alternatively, the attack mode may also indicate the attack path of the simulated attack, for example, the attack mode may indicate that under the first preset condition, attack path 1 is executed, under the second preset condition, attack path 2 is executed, etc. In this case, attack path 1 and attack path 2 indicate different attack modes.

[0089] S103. Based on the attack script file, simulate the attack on the alliance chain and obtain the network status information of the alliance chain.

[0090] In one example, while simulating an attack on the alliance chain based on the attack script file, the alliance chain can be monitored in real time to obtain the network status information of the alliance chain. At this time, the network status information of the alliance chain may include but is not limited to: the call status of the smart contract in the alliance chain, the broadcast status of the smart contract, the response time of the alliance chain network, the throughput, the network bandwidth usage, etc.

[0091] S104. Determine the test result of the alliance chain based on the network status information of the alliance chain.

[0092] In one example, the test result of the alliance chain can be determined based on the network status information of the alliance chain. For example, the abnormal call of the smart contract can be determined based on the call of the smart contract of the alliance chain, so as to determine the test result of the smart contract in the alliance chain. Alternatively, the network performance test result of the alliance chain can be determined based on the performance indicators of the alliance chain network (such as the response time, throughput, and network bandwidth usage mentioned above). At the same time, by conducting network tests on the alliance chain through various types of simulated attacks, the robustness of the alliance chain to various types of simulated attacks can be determined.

[0093] It can be seen from the above description that the embodiment of the present application can respond to the simulated attack configuration operation initiated by the user, and obtain the attack parameter information matching the simulated attack configuration operation. At this time, various types of simulated attacks can be customized by initiating the simulated attack configuration operation, so that the comprehensive test of the alliance chain can be realized based on the configured simulated attack. Then, the attack template and attack method matching the attack type included in the attack parameter information are determined, and the attack script file is determined based on the attack template, the attack method and the attack parameter information, so that the attack script file can execute the corresponding simulated attack through the pre-set attack method, so that the malicious logic of the attack can be introduced to improve the authenticity of the network test of the alliance chain, and then improve the test effect. After that, the alliance chain can be simulated based on the attack script file, and the network status information of the alliance chain can be obtained, so that the test result of the alliance chain can be determined based on the network status information of the alliance chain, so that the performance and security analysis of the alliance chain can be performed according to the test result of the alliance chain, so as to help enhance the security and performance of the alliance chain.

[0094] See also Figure 2 , Figure 2 This is a flowchart of another network testing method applied to a consortium chain provided in an embodiment of the present application. Figure 2 As shown, the network testing method applied to the alliance chain includes the following steps:

[0095] S201. In response to a simulated attack configuration operation initiated by a user, acquire attack parameter information matching the simulated attack configuration operation.

[0096] Among them, the simulated attack configuration operation is used to configure a simulated attack on the alliance chain; the attack parameter information includes the attack type, attack node and attack intensity of the simulated attack configured by the simulated attack configuration operation.

[0097] In an example, this step can refer to the content described in S101 above, and will not be described in detail here.

[0098] S202: Determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information.

[0099] Among them, the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack, and / or the attack path; the attack data indicates the transaction data that can be uploaded to the alliance chain.

[0100] In an example, this step can refer to the content described in S102 above, and will not be described in detail here.

[0101] S203. Based on the attack script file, simulate the attack on the alliance chain.

[0102] In one example, the simulated attack may indicate an attack in a transaction flood attack scenario. At this time, when the alliance chain is simulated and attacked based on the attack script file, the first transaction data may be generated based on the attack script file, and then the first transaction data may be uploaded to the alliance chain through the attack node in the attack parameter information, and the first transaction data may be broadcast to other nodes included in the alliance chain except the attack node. The first transaction data indicates invalid transaction data and / or forged transaction data.

[0103] At this time, the attack method can be used to determine the transaction data. For example, the attack method can be a forged transaction attack method, an invalid transaction attack method, etc. At this time, the first transaction data generated according to the attack script file can be forged transaction data, or invalid transaction data containing an invalid signature, or invalid transaction data with a format error, or invalid transaction data containing malicious content, etc.

[0104] In one example, after uploading the first transaction data to the alliance chain through the attack node (i.e., broadcasting to each attack node), the transaction data broadcasting frequency can be set so that the first transaction data is frequently broadcast to other nodes included in the alliance chain except the attack node, so as to increase the transaction traffic of the alliance chain network, thereby affecting the transaction speed of the alliance chain.

[0105] In one example, if the attack type of the simulated attack configured by the simulated attack configuration operation indicates a smart contract attack, then different attack paths, that is, attack methods, can be formulated according to the contract status of the smart contract.

[0106] Attack method 1: First, based on the attack script file, generate the second transaction data that matches the vulnerability information of the smart contract included in the alliance chain, then upload the second transaction data to the alliance chain through the attack node in the attack parameter information, and call the target function in the smart contract included in the alliance chain, thereby modifying the contract status of the smart contract based on the target function. The second transaction data indicates the function call data; the target function indicates the function used to modify the contract status of the smart contract.

[0107] In one example, vulnerability information of a smart contract may include, but is not limited to, the following information: overflow or underflow vulnerabilities, reentrancy vulnerabilities, access control vulnerabilities, time dependency vulnerabilities, contract design logic vulnerabilities, etc.

[0108] At this time, the corresponding second transaction data can be generated according to the vulnerability information of the smart contract, so as to simulate the attack processing on the alliance chain according to the second transaction data, so as to modify the contract status of the smart contract. For example, the variables of the smart contract can be modified, the data stored in the smart contract can be modified, etc., thereby affecting the normal function of the smart contract, and then testing the security of the smart contract.

[0109] In one example, after calling the target function in the smart contract based on the second transaction data, if it is determined that the contract state of the smart contract has not been successfully modified based on the target function, the attack method can be changed to attack method two: determine the frequency of smart contract calls, and then, according to the frequency of smart contract calls, upload the second transaction data generated by the attack script file to the alliance chain, thereby realizing continuous calls to the smart contract.

[0110] Among them, the smart contract calling frequency can be determined according to the response speed of the smart contract. For example, when the response speed of the smart contract is faster, a higher smart contract calling frequency can be set. When the response speed of the smart contract is slower, a lower smart contract calling frequency can be set to ensure that the smart contract is in a state of being constantly called, thereby testing the performance of the smart contract in the alliance chain.

[0111] In the embodiment of the present application, the simulated attack configured by the user indicates an attack in a transaction flood attack scenario and / or an attack in a smart contract attack scenario, and both the transaction flood attack scenario and the smart contract attack scenario include simulated attacks of multiple attack types. In this case, the number of attack script files determined according to the attack template, attack method, and attack parameter information is multiple. In this case, when performing a simulated attack process on the alliance chain according to multiple attack script files, the attack order corresponding to the multiple attack script files can be determined first, and then, based on each attack script file and the attack order corresponding to each attack script, the alliance chain can be simulated.

[0112] Among them, the attack script file can be used to indicate the source of the attack. At this time, the alliance chain is simulated by using multiple attack script files to simulate attacks from multiple attack sources, thereby realizing distributed attack testing on the alliance chain.

[0113] In the above implementation, multiple simulated attacks can be performed on the alliance chain at the same time, so as to simulate more realistic attack scenarios, thereby improving the effectiveness and accuracy of the test. In addition, by performing multiple simulated attacks on the alliance chain at the same time, it is also possible to test the alliance chain's handling of resource competition and conflicts, thereby making the alliance chain test more comprehensive and further improving the accuracy of the alliance chain test.

[0114] In one example, after a simulated attack on a consortium chain, the network status information of the consortium chain can be obtained, and the security and performance of the consortium chain can be determined based on the network status information of the consortium chain. At this time, if the simulated attack includes an attack under a transaction flood attack scenario and an attack under a smart contract attack scenario, the network status information of the consortium chain can be obtained through the steps described below.

[0115] S204. Obtain the contract call information and contract broadcast information of each smart contract included in the alliance chain; and obtain the network performance indicator information of the alliance chain.

[0116] Among them, the contract call information of the smart contract can indicate the information of the function called by the smart contract, the response time of the smart contract calling the function, the return value of the function called by the smart contract, the error information when the smart contract calls the function, etc.

[0117] The contract broadcast information of the smart contract can indicate the relevant information of the node broadcasting the smart contract.

[0118] The network performance indicators of the alliance chain may include but are not limited to: response time, throughput, network bandwidth usage, etc.

[0119] S205. Determine the network status information of the alliance chain based on the contract call information, contract broadcast information and network performance indicator information.

[0120] S206. Determine the test result of the alliance chain based on the network status information of the alliance chain.

[0121] At this time, the test results of the alliance chain include the smart contract test results and the network performance test results. For example, it is possible to determine whether the smart contract has abnormal behavior based on the contract call information and contract broadcast information of the smart contract, and determine the attack type corresponding to the smart contract based on the abnormal behavior of the smart contract, thereby determining the smart contract test results. At the same time, the congestion and delay phenomena in the network topology of the alliance chain can be determined based on the network performance indicator information, thereby determining the network performance test results.

[0122] This implementation method can determine the test results of the alliance chain from multiple levels, making the alliance chain test more comprehensive. It also helps to perform comprehensive maintenance on the alliance chain, which helps to improve the security and network performance of the alliance chain.

[0123] See also Figure 3 , Figure 3 A schematic diagram of the structure of a network testing system applied to a consortium chain provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the system includes: an attack scenario generator 301, an attack script engine 302 and a real-time monitoring and feedback device 303.

[0124] The attack scenario generator 301 includes a user configuration module 3011 and an attack scenario generation module 3012, wherein the user configuration module 3011 is used to provide a user configuration interface, receive a simulated attack configuration operation initiated by a user through the user configuration interface, and obtain attack parameter information matching the simulated attack configuration operation. The attack scenario generation module 3012 is used to generate a corresponding attack script file according to the attack configuration parameter information, that is, first determine a matching attack template and attack method according to the attack type in the attack configuration parameter, and then determine the attack script file according to the attack template, attack method and attack configuration parameter.

[0125] See also Figure 4 , Figure 4 A schematic diagram of an implementation flow of an attack scenario generator provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the attack scenario generator can obtain the attack parameter information configured by the user through the simulated attack configuration operation initiated by the user interface. For example, the attack type, attack node, and attack intensity of the simulated attack can be configured through the user configuration interface. After that, the attack template can be determined according to the configured attack type. At this time, the attack parameter information can be added to the attack template, and the attack method can be added to generate an attack script file.

[0126] Afterwards, if Figure 3As shown, the attack scenario generator 301 can send the generated attack script file to the attack script engine 302, and send the simulated attack configured by the user (ie, attack parameter information) to the real-time monitoring and feedback device 303.

[0127] The attack script engine 302 includes a script interpretation module 3021, a distributed simulated attack module 3022 and a transaction broadcast module 3023, wherein the script interpretation module 3021 is used to interpret and execute attack script files; the distributed simulated attack module 3022 is used to simulate distributed attacks from multiple sources and can execute multiple attack script files simultaneously; the transaction broadcast module 3023 is used to broadcast simulated transactions to each node in the alliance chain to simulate the transaction process in a real scenario.

[0128] See also Figure 5 , Figure 5 A schematic diagram of an implementation flow of an attack script engine provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, after the script interpretation module interprets each attack script file, a simulated attack corresponding to each attack script file can be executed, for example, it can include executing a transaction flood attack and executing a smart contract call. Afterwards, the distributed simulated attack module can simulate each executed attack script file as a multi-source, distributed attack, and execute multiple attack script files at the same time, for example, attack script file 1 can be executed with attack source 1, attack script file 2 can be executed with attack source 2, attack script file 3 can be executed with attack source 3, etc. At this time, the alliance chain can consider the concurrency of the attack and the resource competition between each attack script file, thereby ensuring the accuracy of the test results. After the distributed simulated attack, the transaction data corresponding to each simulated attack can be broadcast to each node in the alliance chain through the transaction broadcast module.

[0129] The real-time monitoring and feedback device 303 includes a smart contract monitoring module 3031, a network performance monitoring module 3032 and a feedback report generation module 3033. Among them, the smart contract monitoring module 3031 is used to monitor the contract call information of the smart contract and the contract broadcast information in the smart contract; the network performance monitoring module 3032 is used to monitor the network performance indicator information of the alliance chain network in real time; the feedback report generation module 3033 is used to collect the monitored data and generate a network test report. For example, it is possible to determine whether there is abnormal behavior in the smart contract based on the data monitored in the collected smart contract monitoring module, and then determine the simulated attack that may exist in the smart contract. For another example, the performance of the alliance chain network can be determined based on the data monitored in the collected network performance monitoring module, for example, the congestion and delay of the alliance chain network, the network bandwidth usage, etc. can be determined. At the same time, according to the various types of simulated attacks suffered by the alliance chain, the robustness of the alliance chain under various types of simulated attacks can be determined.

[0130] See also Figure 6 , Figure 6 A schematic diagram of the implementation process of a real-time monitoring and feedback device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown in the figure, the real-time monitoring and feedback device can monitor the calling process and broadcasting process of the smart contract through the smart contract monitoring module, so as to obtain the contract calling information and contract broadcasting information. At the same time, the performance of the alliance chain network is monitored through the network performance monitoring module to obtain the network performance index information. After that, the feedback report generation module can be used to generate a network test report based on the contract calling information, contract broadcasting information and network performance index information.

[0131] The following describes the process of simulating attacks on the alliance chain based on the above application functions and the network testing system of the alliance chain.

[0132] See also Figure 7 , Figure 7 A flow chart of a transaction flood attack provided in an embodiment of the present application is as follows: Figure 7 As shown, a large amount of first transaction data can be generated according to the interpreted attack script file, and then the first transaction data can be broadcast to the configured attack node, so as to realize the simulated attack processing on the alliance chain. At the same time, the first transaction data can also be simulated as a distributed attack from multiple sources to simulate the attack processing on the alliance chain. In addition, the first transaction data can also be broadcast to the alliance chain according to the set transaction data broadcast frequency, so as to realize the frequent broadcast of the first transaction data, and then realize the transaction flood attack on the alliance chain.

[0133] See also Figure 8 , Figure 8 A flowchart of a smart contract attack provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, in the smart contract attack scenario, the vulnerability information of the smart contract can be determined first, and the second transaction data can be generated, so that the target function in the smart contract can be called through the second transaction data. At this time, the contract state of the smart contract can be modified through the target function. If it is determined that the contract state of the smart contract is successfully modified, it means that the attack is effective, and at this time, the normal function of the smart contract is affected. If it is determined that the contract state of the smart contract is not successfully modified, the frequency of smart contract calls can be determined, and then, according to the frequency of smart contract calls, the second transaction data generated by the attack script file is uploaded to the alliance chain to continuously call the smart contract.

[0134] In one example, you can Figure 3The attack script engine in the network test system applied to the alliance chain shown simultaneously executes simulated attacks under one or more transaction flood attack scenarios and simulated attacks under smart contract attack scenarios, which will not be described in detail here.

[0135] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a network testing device applied to a consortium chain provided in an embodiment of the present application. Fig. 9 As shown, the network testing device 900 applied to the alliance chain includes:

[0136] The response unit 901 is used to respond to the simulated attack configuration operation initiated by the user and obtain attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node and attack intensity of the simulated attack configured by the simulated attack configuration operation.

[0137] The first determination unit 902 is used to determine the attack template and attack method that match the attack type included in the attack parameter information, and determine the attack script file based on the attack template, attack method and attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack, and / or the attack path; the attack data indicates the transaction data that can be uploaded to the alliance chain.

[0138] The attack unit 903 is used to simulate the attack processing on the alliance chain based on the attack script file.

[0139] The acquisition unit 904 is used to acquire the network status information of the alliance chain.

[0140] The second determining unit 905 is used to determine the test result of the alliance chain based on the network status information of the alliance chain.

[0141] See also Fig.10 , Fig.10 This is a schematic diagram of the structure of another network testing device applied to the alliance chain provided in an embodiment of the present application. Fig.10 As shown, the network testing device 1000 applied to the alliance chain includes:

[0142] The response unit 1001 is used to respond to the simulated attack configuration operation initiated by the user and obtain attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node and attack intensity of the simulated attack configured by the simulated attack configuration operation.

[0143] The first determination unit 1002 is used to determine the attack template and attack method that match the attack type included in the attack parameter information, and determine the attack script file based on the attack template, attack method and attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack, and / or the attack path; the attack data indicates the transaction data that can be uploaded to the alliance chain.

[0144] The attack unit 1003 is used to simulate the attack processing on the alliance chain based on the attack script file.

[0145] The acquisition unit 1004 is used to acquire the network status information of the alliance chain.

[0146] The second determining unit 1005 is used to determine the test result of the alliance chain based on the network status information of the alliance chain.

[0147] In a possible design, the simulated attack indicates an attack in a transaction flood attack scenario; the attack unit 1003 includes a first attack module 10031, which is used to:

[0148] Generate first transaction data based on the attack script file; wherein the first transaction data indicates invalid transaction data and / or forged transaction data;

[0149] The first transaction data is uploaded to the alliance chain through the attack node in the attack parameter information, and the first transaction data is broadcast to other nodes included in the alliance chain except the attack node.

[0150] In one possible design, the simulated attack indicates an attack in a smart contract attack scenario; the attack unit includes a second attack module 10032, which is used to:

[0151] Based on the attack script file, second transaction data matching the vulnerability information of the smart contract included in the alliance chain is generated; wherein the second transaction data indicates function call data;

[0152] After uploading the second transaction data to the alliance chain through the attack node in the attack parameter information, calling the target function in the smart contract included in the alliance chain; wherein the target function indicates a function for modifying the contract state of the smart contract;

[0153] Modify the contract state of the smart contract based on the target function.

[0154] In a possible design, the second attack module 10032 is further used to:

[0155] If the contract state of the smart contract is not successfully modified based on the target function, the smart contract call frequency is determined;

[0156] According to the calling frequency of the smart contract, the second transaction data generated by the attack script file is uploaded to the alliance chain.

[0157] In a possible design, there are multiple attack scripts; the attack unit 1003 is used to:

[0158] Determine the attack sequence corresponding to multiple attack script files;

[0159] Based on each attack script file and the attack sequence corresponding to each attack script, a simulated attack is performed on the alliance chain.

[0160] In a possible design, the simulated attack includes an attack in a transaction flood attack scenario and an attack in a smart contract attack scenario; the acquisition unit 1004 is used to:

[0161] Obtain the contract call information and contract broadcast information of each smart contract included in the alliance chain; and obtain the network performance indicator information of the alliance chain;

[0162] Based on the contract call information, contract broadcast information and network performance indicator information, the network status information of the alliance chain is determined.

[0163] The network testing device applied to the alliance chain provided in the embodiment of the present application can be used to execute the technical solution of the network testing method applied to the alliance chain in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0164] It should be noted that it should be understood that the division of the various units / modules of the above devices 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 units / modules can be implemented in the form of software; they can also be implemented in the form of hardware; some units / modules can be implemented in the form of software, and some units / modules can be implemented in the form of hardware. In the implementation process, each step of the above method or each of the above units / modules can be completed by the hardware integrated logic circuit in the processor or the instructions in the form of software.

[0165] See also Fig.11 , Fig.11 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.11 As shown, the computer device 1100 may include: a transceiver 1101 , a processor 1102 , and a memory 1103 .

[0166] The processor 1102 executes the computer execution instructions stored in the memory, so that the processor 1102 executes the scheme in the above embodiment. The processor 1102 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0167] The memory 1103 is connected to the processor 1102 via a system bus and completes communication between them. The memory 1103 is used to store computer program instructions.

[0168] The transceiver 1101 may be used to obtain attack parameter information that matches the simulated attack configuration operation.

[0169] The system bus can be a peripheral component interconnect (PCI) bus, an industry standard architecture (ISA) bus, or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.

[0170] An embodiment of the present application also provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are run on a computer, the computer executes the technical solution of the network testing method applied to the alliance chain in the above embodiment.

[0171] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor can read the computer program from the computer-readable storage medium. When the processor executes the computer program, the technical solution of the network testing method applied to the alliance chain in the above embodiment can be implemented.

[0172] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0173] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0174] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0175] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0176] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0177] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0178] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0179] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0180] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0181] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0182] 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 network testing method applied to a consortium chain, characterized in that: include: In response to a simulated attack configuration operation initiated by a user, acquiring attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node, and attack intensity of the simulated attack configured by the simulated attack configuration operation; Determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack and / or the attack path; the attack data indicates transaction data that can be uploaded to the alliance chain; Based on the attack script file, simulate the attack process on the alliance chain and obtain the network status information of the alliance chain; Based on the network status information of the alliance chain, a test result of the alliance chain is determined.

2. The method according to claim 1, characterized in that The simulated attack indicates an attack under a transaction flood attack scenario; Based on the attack script file, a simulated attack process is performed on the alliance chain, including: Generate first transaction data based on the attack script file; wherein the first transaction data indicates invalid transaction data and / or forged transaction data; The first transaction data is uploaded to the alliance chain through the attack node in the attack parameter information, and the first transaction data is broadcast to other nodes included in the alliance chain except the attack node.

3. The method according to claim 1, characterized in that The simulated attack indicates an attack in a smart contract attack scenario; Based on the attack script file, a simulated attack process is performed on the alliance chain, including: Based on the attack script file, generating second transaction data matching the vulnerability information of the smart contract included in the alliance chain; wherein the second transaction data indicates function call data; After uploading the second transaction data to the alliance chain through the attack node in the attack parameter information, calling the target function in the smart contract included in the alliance chain; wherein the target function indicates a function for modifying the contract state of the smart contract; Modify the contract state of the smart contract based on the objective function.

4. The method according to claim 3, characterized in that The method further comprises: If the contract state of the smart contract is not successfully modified based on the objective function, determining a smart contract call frequency; According to the calling frequency of the smart contract, the second transaction data generated by the attack script file is uploaded to the alliance chain.

5. The method according to any one of claims 1 to 4, characterized in that There are multiple attack scripts; based on the attack script files, a simulated attack process is performed on the alliance chain, including: Determining an attack sequence corresponding to a plurality of the attack script files; Based on each of the attack script files and the attack sequence corresponding to each of the attack scripts, a simulated attack process is performed on the alliance chain.

6. The method according to any one of claims 1 to 4, characterized in that The simulated attack includes an attack under a transaction flood attack scenario and an attack under a smart contract attack scenario; obtaining the network status information of the alliance chain, including: Obtaining contract call information and contract broadcast information of each smart contract included in the alliance chain; and obtaining network performance indicator information of the alliance chain; Based on the contract call information, the contract broadcast information and the network performance indicator information, the network status information of the alliance chain is determined.

7. A network testing device applied to a consortium chain, characterized in that: include: A response unit, configured to respond to a simulated attack configuration operation initiated by a user and obtain attack parameter information matching the simulated attack configuration operation; wherein the simulated attack configuration operation is used to configure a simulated attack against the alliance chain; the attack parameter information includes the attack type, attack node, and attack intensity of the simulated attack configured by the simulated attack configuration operation; A first determination unit is used to determine an attack template and an attack method that match the attack type included in the attack parameter information, and determine an attack script file based on the attack template, the attack method and the attack parameter information; wherein the attack template is used to generate a simulated attack; the attack method is used to determine the attack data corresponding to the simulated attack and / or the attack path; the attack data indicates transaction data that can be uploaded to the alliance chain; An attack unit, used to perform a simulated attack process on the alliance chain based on the attack script file; An acquisition unit, used to acquire network status information of the alliance chain; The second determining unit is used to determine the test result of the alliance chain based on the network status information of the alliance chain.

8. A computer 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 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.