JAVA fuzzy test method and device based on process isolation

By adopting process isolation and gateway reverse proxy methods in Java fuzz testing, the problem of test process resource competition is solved, the testing efficiency and security is improved, and each test process runs independently, achieving faster testing speed and Better mispositioning.

CN118964209AInactive Publication Date: 2024-11-15SHANGHAI ANBAN INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411168998.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In Java fuzzing, multiple test processes share the same resource, resulting in resource competition and conflicts, such as memory leaks and inconsistent memory state, affecting testing efficiency and security.

Method used

Using a process isolation method, the gateway serves the target under test through the reverse proxy, starts multiple test engines to generate test cases, and distributes the test cases to different targets under test according to pre-set rules, and sets unique ID value to track execution, ensure each test process runs independently, preventing exceptions from affecting other parts.

Benefits of technology

Enhance testing efficiency and security, prevent abnormalities or crashes during the testing process from affecting other parts of the system, improve test speed and stability, and facilitate error analysis and repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964209A_ABST
    Figure CN118964209A_ABST
Patent Text Reader

Abstract

The invention provides a JAVA fuzzy test method and device based on process isolation, and the method comprises the steps: starting a plurality of test engines, and generating a plurality of test cases; the gateway receives the plurality of test cases and distributes the plurality of test cases to different tested targets according to a preset rule, each of the plurality of test cases is provided with a unique ID value, and the unique ID value is used for tracking the execution condition of each of the plurality of test cases; and carrying out fuzzy testing on the tested target by the plurality of test cases. According to the JAVA fuzzy test method and device based on process isolation provided by the invention, the gateway is used as a reverse proxy to provide services for the tested target, so that the test efficiency and security can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of network information security technology, and in particular to a JAVA fuzzy testing method and device based on process isolation. Background Art

[0002] Multiple test processes share the same resources, such as memory, files, network ports, etc., which will lead to resource competition and conflicts. Java's garbage collection mechanism will cause problems when multiple processes share memory, such as memory leaks and inconsistent memory states. Shared memory space will cause memory problems in one process to affect other processes.

[0003] Therefore, it is necessary to provide a JAVA fuzz testing method and device based on process isolation to solve the above problems. Summary of the invention

[0004] The present invention provides a JAVA fuzzy testing method and device based on process isolation, which uses a gateway as a reverse proxy to provide services for a tested target, thereby enhancing testing efficiency and security.

[0005] The embodiment of the present invention provides a JAVA fuzz testing method based on process isolation, comprising: Start multiple test engines and generate multiple test cases; The gateway receives the multiple test cases, and distributes the multiple test cases to different tested targets according to a preset rule, each of the multiple test cases is provided with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; The multiple test cases perform fuzz testing on the target under test.

[0006] Preferably, the plurality of test engines include: A first test engine, wherein the test cases generated by the first test engine include rapid generation of random input data, wherein the random input data base covers various boundary conditions and abnormal conditions encountered by the system, and wherein the configuration file of the first test engine includes generation strategy, data format, and generation quantity; A second test engine, wherein the test cases generated by the second test engine include various malicious inputs and attack vectors for testing the system's defense capabilities and vulnerability repair conditions, and the configuration file of the second test engine includes attack vectors and test strategies; A third test engine, which generates test cases for performing path exploration and symbolic execution, helps discover logical errors and boundary problems in the system, and generates test cases covering all possible paths by traversing the execution path of the system. The configuration file of the third test engine includes a path exploration strategy and symbolic execution settings; The fourth test engine is used for in-depth testing of specific functional modules. By generating test cases in a targeted manner, it deeply tests specific parts of the system and discovers detailed problems and defects. The configuration file of the fourth test engine includes target functional modules and test strategies.

[0007] Preferably, the pre-set rules include: Feature matching rules, which are used to decide whether to route the request to the corresponding backend service according to the characteristics of the request, including URL path, request header, request parameters, header specified fields, body field, query field, cookie field, IP, and domain name; A polling distribution rule, which is used to evenly distribute the multiple test cases to the different tested targets in sequence; The weight allocation rule is used to allocate different numbers of test cases according to the processing capabilities of the different tested targets.

[0008] Preferably, before the gateway receives the multiple test cases, the gateway is further configured as follows: Basic configuration, which is used to set the gateway's IP address, port, and concurrent processing capacity; Security configuration, which is used to configure the gateway's security policy, including firewall rules and SSL certificates; The log configuration is used to set the gateway logging function to track and audit the receiving and distributing process of the multiple test cases.

[0009] Preferably, log information of starting the multiple test engines is recorded to track the startup process and status of the multiple test engines.

[0010] Preferably, before the gateway receives the multiple test cases, the gateway also includes performing the following configuration on the tested target: Environment preparation, which is used to configure the operating environment required by the target under test, and the operating environment includes an operating system, dependent libraries and configuration files; Program deployment, which is used to deploy the target under test into a preset environment to ensure that it can be started and run correctly; The network configuration is used to configure the network so that the target under test can communicate with the gateway.

[0011] Preferably, the method further comprises performing the following configuration on the target to be measured: Receiving configuration, which is used to set the receiving port and protocol of the target under test so that it can receive test cases; Processing logic, which is used to ensure that the target under test has logic for processing test cases, including parsing inputs, executing tests, and generating results; Return configuration, which is used to set the address and format of the returned result so that the gateway can correctly receive and process the returned result.

[0012] Preferably, after the test case is executed, the target under test returns the result to the gateway to determine the potential loopholes or defects in the system.

[0013] Preferably, when there are potential vulnerabilities or defects in the system, memory dumps and stack trace data are captured, and a detailed test report is automatically generated, which includes the problems found, detailed descriptions, reproduction steps, and repair suggestions.

[0014] The embodiment of the present invention also provides a JAVA fuzzy testing device based on process isolation, comprising: A test case generation module, which is used to start multiple test engines and generate multiple test cases; A test case distribution module, which is used to receive the multiple test cases through the gateway, and distribute the multiple test cases to different tested targets according to a preset rule, each of the multiple test cases is set with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; A fuzz testing module is used to perform fuzz testing on the target under test using the multiple test cases.

[0015] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects: The JAVA fuzz testing method and device based on process isolation of the embodiment of the present invention comprises: starting multiple test engines and generating multiple test cases; a gateway receives the multiple test cases and distributes the multiple test cases to different targets under test according to preset rules, each of the multiple test cases is provided with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; the multiple test cases perform fuzzy testing on the targets under test, and use the gateway as a reverse proxy to provide services for the targets under test, which can enhance the test efficiency and security; Furthermore, by isolating the processes between the targets under test, it is possible to prevent exceptions or crashes generated during the test from affecting other parts of the system, thus ensuring the security and stability of the test process. Furthermore, each test process runs independently and can execute multiple test cases in parallel, thus speeding up the test and improving the test efficiency; Furthermore, since each test process is independent, when an error occurs, it is easier to locate the specific test case and test environment, facilitating subsequent error analysis and repair. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, not all embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0017] Figure 1 A schematic diagram of a process isolation-based JAVA fuzz testing method according to an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a JAVA fuzzy testing device based on process isolation provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0020] Based on the problems existing in the prior art, an embodiment of the present invention provides a JAVA fuzzy testing method and device based on process isolation, which uses a gateway as a reverse proxy to provide services for the target under test, thereby enhancing testing efficiency and security.

[0021] Figure 1 A flowchart of a JAVA fuzzy testing method based on process isolation provided by an embodiment of the present invention. Figure 1 , provides a JAVA fuzz testing method based on process isolation, including: Step S101: start multiple test engines and generate multiple test cases; Step S102: The gateway receives the multiple test cases, and distributes the multiple test cases to different targets according to a preset rule, wherein each of the multiple test cases is provided with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; Step S103: The multiple test cases perform fuzzy testing on the target under test.

[0022] Specifically, using a gateway as a reverse proxy to provide services for the target under test can enhance test efficiency and security. Test traffic first passes through the gateway, which processes the traffic as an intermediary and then forwards it to the target under test. The gateway device as a reverse proxy can also achieve load balancing, distributing the test traffic to multiple target program instances, improving the concurrency and coverage of the test. At the same time, the gateway can record all passing traffic, providing valuable data support for subsequent vulnerability analysis and test optimization. In addition, the gateway can also integrate security policies, such as IP filtering, access control lists, etc., to further enhance the security of the test environment.

[0023] In a specific implementation, the multiple test engines include: A first test engine, wherein the test cases generated by the first test engine include rapid generation of random input data, wherein the random input data base covers various boundary conditions and abnormal conditions encountered by the system, and wherein the configuration file of the first test engine includes generation strategy, data format, and generation quantity; A second test engine, wherein the test cases generated by the second test engine include various malicious inputs and attack vectors for testing the system's defense capabilities and vulnerability repair conditions, and the configuration file of the second test engine includes attack vectors and test strategies; A third test engine, which generates test cases for performing path exploration and symbolic execution, helps discover logical errors and boundary problems in the system, and generates test cases covering all possible paths by traversing the execution path of the system. The configuration file of the third test engine includes a path exploration strategy and symbolic execution settings; The fourth test engine is used for in-depth testing of specific functional modules. By generating test cases in a targeted manner, it deeply tests specific parts of the system and discovers detailed problems and defects. The configuration file of the fourth test engine includes target functional modules and test strategies.

[0024] Specifically, the first test engine, the second test engine, the third test engine and the fourth test engine are mobilized through the engine scheduling platform. After starting each test engine, these test engines will work together to complete the fuzz testing task. The test cases generated by each test engine will be uniformly converged to the gateway, and the gateway will distribute the test cases to the tested targets according to pre-set rules to ensure the comprehensiveness and effectiveness of the test. The engine scheduling platform is used for test case generation, scheduling and execution, gateway rule configuration, and real-time monitoring. The test case generator can adopt a completely random generation, a grammar rule-based generation, or a mutation generation strategy based on existing test cases. The intelligent generator uses known input formats and protocol specifications to improve test efficiency and the probability of discovering complex vulnerabilities. The first test engine, the second test engine, the third test engine and the fourth test engine are respectively provided with their own test case generators and intelligent generators.

[0025] The scheduling and execution module manages and allocates test tasks through the task scheduler, supporting distributed systems to improve test coverage and speed. The scheduler supports task priority and resource allocation to ensure efficient testing. The scheduling and execution module includes an engine scheduling platform and case generation and execution. The engine scheduling platform is responsible for scheduling the first test engine, the second test engine, the third test engine, and the fourth test engine. The first test engine, the second test engine, the third test engine, and the fourth test engine generate test cases and execute them respectively.

[0026] Specifically, each test engine is used to generate a certain number of test cases, for example, each test engine can generate 1,000 test cases. These test cases can be randomly generated input data, covering different boundary conditions and abnormal conditions to comprehensively test the robustness and error handling capabilities of the target under test. After each test case is generated, it will be assigned a unique ID value. This ID value not only serves as an identification, but also ensures that the test case can be accurately identified and tracked throughout the test process.

[0027] First test engine: generates 1000 test cases, with IDs from 1 to 1000; Second test engine: generates 1000 test cases with IDs from 1001 to 2000; The third test engine: generates 1000 test cases with tag IDs from 2001 to 3000; Fourth test engine: Generates 1000 test cases with tag IDs from 3001 to 4000.

[0028] In a specific implementation, the pre-set rules include: Feature matching rules, which are used to decide whether to route the request to the corresponding backend service according to the characteristics of the request, including URL path, request header, request parameters, header specified fields, body field, query field, cookie field, IP, and domain name; A polling distribution rule, which is used to evenly distribute the multiple test cases to the different tested targets in sequence; The weight allocation rule is used to allocate different numbers of test cases according to the processing capabilities of the different tested targets.

[0029] In the specific implementation, feature matching rules are used first to assign corresponding requests to corresponding backend services. Then these test cases are polled and distributed and executed in batches. During the polling and distribution process, when the load is high, weight distribution is performed.

[0030] Specifically, the gateway is not only a gathering point for test cases, but also bears the responsibility of distribution and management. After receiving all test cases, the gateway will distribute the test cases to different test targets according to pre-set rules. When each test case is distributed, it will carry its unique ID value to ensure that the execution of each test case can be accurately tracked.

[0031] After the gateway receives all the test cases, the next step is to distribute these test cases to n targets under test according to the preset distribution rules. The gateway will ensure that each test case is distributed to a target under test, and each target under test can evenly receive the test case for processing. During the distribution process, the gateway will record the distribution of each test case, including which test case is distributed to which target under test, to ensure that each test case has a clear destination.

[0032] Test target 1: receives test cases 1, 5, 9, ... from each engine; Test target 2: receives test cases 2, 6, 10, ... from each engine; Test target 3: receives test cases 3, 7, 11, ... from each engine; Target n: receives test cases 4, 8, 12, ... from each engine.

[0033] In a specific implementation, before the gateway receives the multiple test cases, the gateway is further configured as follows: Basic configuration, which is used to set the gateway's IP address, port, and concurrent processing capacity; Security configuration, which is used to configure the gateway's security policy, including firewall rules and SSL certificates; The log configuration is used to set the gateway logging function to track and audit the receiving and distributing process of the multiple test cases.

[0034] In a specific implementation, log information of the startup of the multiple test engines is recorded to track the startup process and status of the multiple test engines.

[0035] In a specific implementation, before the gateway receives the multiple test cases, it also includes performing the following configuration on the tested target: Environment preparation, which is used to configure the operating environment required by the target under test, and the operating environment includes an operating system, dependent libraries and configuration files; Program deployment, which is used to deploy the target under test into a preset environment to ensure that it can be started and run correctly; The network configuration is used to configure the network so that the target under test can communicate with the gateway.

[0036] In a specific implementation, the following configuration is also performed on the target to be measured: Receiving configuration, which is used to set the receiving port and protocol of the target under test so that it can receive test cases; Processing logic, which is used to ensure that the target under test has logic for processing test cases, including parsing inputs, executing tests, and generating results; Return configuration, which is used to set the address and format of the returned result so that the gateway can correctly receive and process the returned result.

[0037] In a specific implementation, after the test case is executed, the target under test returns the result to the gateway to determine the potential loopholes or defects in the system.

[0038] In a specific implementation, when there are potential vulnerabilities or defects in the system, memory dumps and stack trace data are captured, and a detailed test report is automatically generated. The test report includes the problems found, detailed descriptions, reproduction steps, and repair suggestions.

[0039] Figure 2 A schematic diagram of the structure of a JAVA fuzzy testing device based on process isolation provided by an embodiment of the present invention. Figure 2 ,Provide a JAVA fuzz testing device based on process isolation, including: A test case generation module 21 is used to start multiple test engines and generate multiple test cases; A test case distribution module 22, which is used to receive the multiple test cases through the gateway, and distribute the multiple test cases to different targets under test according to a preset rule, each of the multiple test cases is set with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; The fuzz testing module 23 is used to perform fuzz testing on the target under test using the multiple test cases.

[0040] In summary, the JAVA fuzz testing method and device based on process isolation of the embodiment of the present invention comprises: starting multiple test engines and generating multiple test cases; a gateway receives the multiple test cases and distributes the multiple test cases to different targets under test according to preset rules, each of the multiple test cases is provided with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; the multiple test cases perform fuzzy testing on the targets under test, and use the gateway as a reverse proxy to provide services for the targets under test, which can enhance the test efficiency and security; Furthermore, by isolating the processes between the targets under test, it is possible to prevent exceptions or crashes generated during the test from affecting other parts of the system, thus ensuring the security and stability of the test process. Furthermore, each test process runs independently and can execute multiple test cases in parallel, thus speeding up the test and improving the test efficiency; Furthermore, since each test process is independent, when an error occurs, it is easier to locate the specific test case and test environment, facilitating subsequent error analysis and repair.

[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 invention.

Claims

1. A JAVA fuzz testing method based on process isolation, characterized in that: include: Start multiple test engines and generate multiple test cases; The gateway receives the multiple test cases, and distributes the multiple test cases to different tested targets according to a preset rule, each of the multiple test cases is provided with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; The multiple test cases perform fuzz testing on the target under test.

2. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: The multiple test engines include: A first test engine, wherein the test cases generated by the first test engine include rapid generation of random input data, wherein the random input data base covers various boundary conditions and abnormal conditions encountered by the system, and wherein the configuration file of the first test engine includes generation strategy, data format, and generation quantity; A second test engine, wherein the test cases generated by the second test engine include various malicious inputs and attack vectors for testing the system's defense capabilities and vulnerability repair conditions, and the configuration file of the second test engine includes attack vectors and test strategies; A third test engine, which generates test cases for performing path exploration and symbolic execution, helps discover logical errors and boundary problems in the system, and generates test cases covering all possible paths by traversing the execution path of the system. The configuration file of the third test engine includes a path exploration strategy and symbolic execution settings; The fourth test engine is used for in-depth testing of specific functional modules. By generating test cases in a targeted manner, it deeply tests specific parts of the system and discovers detailed problems and defects. The configuration file of the fourth test engine includes target functional modules and test strategies.

3. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: The pre-set rules include: Feature matching rules, which are used to decide whether to route the request to the corresponding backend service according to the characteristics of the request, including URL path, request header, request parameters, header specified fields, body fields, query fields, cookie fields, IP, and domain names; A polling distribution rule, which is used to evenly distribute the multiple test cases to the different tested targets in sequence; The weight allocation rule is used to allocate different numbers of test cases according to the processing capabilities of the different tested targets.

4. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: Before the gateway receives the multiple test cases, the gateway is further configured as follows: Basic configuration, which is used to set the gateway's IP address, port, and concurrent processing capacity; Security configuration, which is used to configure the gateway's security policy, including firewall rules and SSL certificates; The log configuration is used to set the gateway logging function to track and audit the receiving and distributing process of the multiple test cases.

5. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: The log information of the startup of the multiple test engines is recorded to track the startup process and status of the multiple test engines.

6. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: Before the gateway receives the multiple test cases, the gateway also includes performing the following configuration on the tested target: Environment preparation, which is used to configure the operating environment required by the target under test, and the operating environment includes an operating system, dependent libraries and configuration files; Program deployment, which is used to deploy the target under test into a preset environment to ensure that it can be started and run correctly; The network configuration is used to configure the network so that the target under test can communicate with the gateway.

7. The JAVA fuzz testing method based on process isolation according to claim 6 is characterized in that: It also includes the following configuration of the target under test: Receiving configuration, which is used to set the receiving port and protocol of the target under test so that it can receive test cases; Processing logic, which is used to ensure that the target under test has logic for processing test cases, including parsing inputs, executing tests, and generating results; Return configuration, which is used to set the address and format of the returned result so that the gateway can correctly receive and process the returned result.

8. The JAVA fuzz testing method based on process isolation according to claim 1 is characterized in that: After the test case is executed, the target under test returns the result to the gateway to determine the potential loopholes or defects in the system.

9. The JAVA fuzz testing method based on process isolation according to claim 8 is characterized in that: When there are potential vulnerabilities or defects in the system, memory dumps and stack trace data are captured, and a detailed test report is automatically generated. The test report includes the problems found, detailed descriptions, reproduction steps, and repair suggestions.

10. A JAVA fuzzy testing device based on process isolation, characterized in that: include: A test case generation module, which is used to start multiple test engines and generate multiple test cases; A test case distribution module, which is used to receive the multiple test cases through the gateway, and distribute the multiple test cases to different tested targets according to a preset rule, each of the multiple test cases is set with a unique ID value, and the unique ID value is used to track the execution status of each of the multiple test cases; A fuzz testing module is used to perform fuzz testing on the target under test using the multiple test cases.

Citation Information

Patent Citations

  • Fuzzy test method, storage medium and electronic device

    CN117648262A

  • Database cluster fuzzy test method and system, computer equipment and storage medium

    CN117992340A

  • Windows platform parallel fuzzy testing method and system based on selective instrumentation

    CN118503097A

  • Intelligent Service Test Engine

    US20210216903A1