Application program testing method and device

By mirroring and combining the target parameters in the application operation request and combining vulnerability testing rules, the problem of time-consuming and resource-consuming reproducing the data processing process in the existing technology is solved, and the vulnerability identification is efficiently identified during the application operation process test results.

CN113111005BActive Publication Date: 2024-11-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110490817.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-06
Publication Date
2024-11-01
Estimated Expiration
2041-05-06

AI Technical Summary

Technical Problem

The prior art requires the reproducibility of the application's process of processing data when testing an application, resulting in wasting time and resources.

Method used

By obtaining the target parameters in the application run request, mirroring and combining them with vulnerability testing rules, the combined results are processed based on the application's processing method of the target parameters, and the application's test results are determined, so that during the application run, the application's running results are performed. Test vulnerabilities to avoid reproducing data processing.

Benefits of technology

Save a lot of time and resources, and realize the test results of efficiently identifying vulnerabilities during application operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113111005B_ABST
    Figure CN113111005B_ABST
Patent Text Reader

Abstract

The present application provides an application testing method and device. The method includes: obtaining an application running request, the running request includes a target parameter passed to a target function in the application; mirroring the target parameter to obtain a mirror parameter corresponding to the target parameter, combining the mirror parameter with a vulnerability testing rule of the corresponding target function to obtain a combined result; processing the combined result based on the application's processing method for the target parameter before passing it into the target function to obtain a processing result; determining the test result of the application based on the processing result, so as to achieve efficient testing of the application, effectively protect the user's privacy, and ensure the user's network security.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the increasing development of the Internet, Internet security has received more and more attention. In the prior art, applications can be tested, and applications with no loopholes in the test results are provided to users, which can greatly improve the security of the Internet.

[0003] The existing testing method usually reproduces the process of application processing data to check whether the application has any vulnerabilities in the reproduction. However, the process of application processing data may be very complicated, and reproducing it requires a lot of time and resources. Summary of the invention

[0004] The present application aims to provide an application testing method and device, which can save time and resources spent on testing the application to a certain extent.

[0005] According to one aspect of an embodiment of the present application, there is provided an application testing method, comprising: obtaining an application running request, the running request including a target parameter to be passed to a target function in the application; mirroring the target parameter to obtain a mirror parameter corresponding to the target parameter, combining the mirror parameter with a vulnerability testing rule corresponding to the target function to obtain a combined result; processing the combined result based on the way the application processes the target parameter before passing it to the target function to obtain a processing result; and determining a test result of the application based on the processing result.

[0006] According to one aspect of an embodiment of the present application, an application testing device is provided, including: an acquisition module, configured to acquire an application running request, the running request including a target parameter to be passed to a target function in the application; a mirroring module, configured to mirror the target parameter to obtain a mirroring parameter corresponding to the target parameter, and combine the mirroring parameter with a vulnerability testing rule corresponding to the target function to obtain a combined result; a processing module, configured to process the combined result based on a processing method of the application on the target parameter before passing it to the target function to obtain a processing result; and a testing module, configured to determine a test result of the application based on the processing result.

[0007] In one embodiment of the present application, based on the aforementioned scheme, the test module is configured to: obtain the vulnerability testing rules in the processing result as the result vulnerability testing rules; if the vulnerability testing rules are the same as the result vulnerability testing rules in the processing result, then determine that the test result of the application is vulnerable; if the vulnerability testing rules are different from the result vulnerability testing rules in the processing result, then determine that the test result of the application is free of vulnerabilities.

[0008] In one embodiment of the present application, based on the aforementioned scheme, the test module is configured to: obtain the vulnerability testing rules in the processing result as the result vulnerability testing rules; if the vulnerability testing rules corresponding to the target function are command injection vulnerability testing rules or query injection vulnerability testing rules, the processing result is split to obtain a split result; if in the split result, the result vulnerability testing rule and other contents in the processing result except the result vulnerability testing rule are located in a grammatical unit, then it is determined that the test result of the application is vulnerable; if in the split result, the result vulnerability testing rule is independent of other contents in the processing result except the result vulnerability testing rule, then it is determined that the test result of the application is free of vulnerabilities.

[0009] In one embodiment of the present application, based on the aforementioned scheme, the test module is configured as follows: if the vulnerability test rule corresponding to the target function is a file read vulnerability test rule, then based on the processing result, the path information corresponding to the file read vulnerability test is obtained; if the scopes in the path information are not unified, then the scopes in the path information are unified to obtain unified path information; if the unified path information is the target path, it is determined that the application has a vulnerability; if the unified path information is not the target path, it is determined that the application has no vulnerability.

[0010] In one embodiment of the present application, based on the aforementioned scheme, the processing method includes detection processing, correction processing, and transfer processing, and the processing module is configured to: perform detection processing on the combination result to obtain a detection result; if the detection result is that the combination result does not comply with the detection rule corresponding to the detection processing, then based on the correction processing corresponding to the detection processing in the processing method, the combination result is corrected to obtain a combination result that complies with the detection rule corresponding to the detection processing; transfer processing is performed on the combination result that complies with the detection rule corresponding to the detection processing; and the processing result is obtained based on the transferred combination result that complies with the detection rule corresponding to the detection processing.

[0011] In one embodiment of the present application, based on the aforementioned scheme, the test module is further configured to: obtain a vulnerability test tag corresponding to the vulnerability test rule; add the vulnerability test tag to the combined result; based on the way the application processes the target parameter before passing it into the target function, process the combined result with the vulnerability test tag added to obtain a tag processing result; and determine the test result of the application based on the tag processing result.

[0012] In one embodiment of the present application, based on the aforementioned scheme, the test module is configured as follows: if the vulnerability test mark exists in the mark processing result, then based on the mark processing result, the test result of the application is determined; if the vulnerability test mark does not exist in the mark processing result, then the test result of the application is determined to be free of vulnerabilities.

[0013] In one embodiment of the present application, based on the aforementioned scheme, the test module is configured as follows: if the vulnerability test mark exists in the mark processing result, and the vulnerability test rule corresponding to the vulnerability test mark is a vulnerability test rule other than the preset vulnerability test rule, then the test result of the application is determined to be that a vulnerability exists.

[0014] In one embodiment of the present application, based on the aforementioned scheme, the mirroring module is further configured to: obtain the number of vulnerability testing rules corresponding to the target parameters; mirror the target parameters to obtain mirroring parameters that are the same as the number of vulnerability testing rules; combine the mirroring parameters with the vulnerability testing rules one by one to obtain a combination result that is the same as the number of vulnerability testing rules.

[0015] According to one aspect of an embodiment of the present application, a computer-readable program medium is provided, which stores computer program instructions. When the computer program instructions are executed by a computer, the computer executes any of the above methods.

[0016] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in any one of the above items is implemented.

[0017] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional embodiments.

[0018] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0019] In the technical solutions provided in some embodiments of the present application, an application running request is obtained, and the running request includes a target parameter to be passed to a target function in the application; the target parameter is mirrored to obtain a mirror parameter corresponding to the target parameter, and the mirror parameter is combined with a vulnerability test rule of the corresponding target function to obtain a combined result, so that the combined result can carry vulnerability test features while avoiding contamination of the application; based on the way the application processes the target parameter before passing it to the target function, the combined result is processed to obtain a processing result; based on the processing result, the test result of the application is determined, and the vulnerability of the application can be tested during the running of the application without reproducing the process of the application processing data, saving a lot of time and resources.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1A A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0023] Figure 1B A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0024] Figure 2A A schematic diagram showing a data sharing system to which the technical solution of an embodiment of the present application can be applied;

[0025] Figure 2B A schematic diagram of a blockchain to which an embodiment of the present application can be applied is shown;

[0026] Figure 2C A schematic diagram showing the generation of a new block in a blockchain to which an embodiment of the present application can be applied is shown;

[0027] Figure 3 A flowchart of an application testing method according to an embodiment of the present application is schematically shown;

[0028] Figure 4 A block diagram of an application testing device according to an embodiment of the present application is schematically shown;

[0029] Figure 5 The figure is a hardware diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0031] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the present application.

[0032] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0033] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0034] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0035] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0036] Cloud security refers to the general term for security software, hardware, users, organizations, and security cloud platforms based on cloud computing business model applications. Cloud security integrates emerging technologies and concepts such as parallel processing, grid computing, and unknown virus behavior judgment. Through a large number of networked clients, it monitors abnormal software behavior in the network, obtains the latest information on Trojans and malicious programs on the Internet, and sends it to the server for automatic analysis and processing, and then distributes virus and Trojan solutions to each client.

[0037] The main research directions of cloud security include: 1. Cloud computing security, which mainly studies how to ensure the security of the cloud itself and various applications on the cloud, including cloud computer system security, secure storage and isolation of user data, user access authentication, information transmission security, network attack protection, compliance auditing, etc.; 2. Cloudification of security infrastructure, which mainly studies how to use cloud computing to build and integrate security infrastructure resources and optimize security protection mechanisms, including building a large-scale security event, information collection and processing platform through cloud computing technology, realizing the collection and correlation analysis of massive information, and improving the control ability of security events and risk control capabilities of the entire network; 3. Cloud security services, which mainly studies various security services provided to users based on cloud computing platforms, such as antivirus services.

[0038] The solution provided in the embodiment of the present application relates to cloud security technology in the field of cloud technology. By using the application testing method of the present application to implement cloud security services, application vulnerabilities can be efficiently and accurately identified, which is specifically described by the following embodiments:

[0039] Figure 1A A schematic diagram of an exemplary system architecture 100A to which the technical solution of the embodiments of the present application can be applied is shown.

[0040] like Figure 1A As shown, the system architecture 100A may include a client 101A, a network 102A, and a server 103A. The network 102A is used to provide a medium for a communication link between the client 101A and the server 103A. The network 102A may include various connection types, such as a wired communication link, a wireless communication link, etc., which are not limited in this application.

[0041] It should be understood that Figure 1AThe number of clients 101A, networks 102A, and servers 103A in the embodiment is only illustrative. Depending on the implementation requirements, there may be any number of clients 101A, networks 102A, and servers 103A. For example, server 103A may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Client 101A may be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto.

[0042] In one embodiment of the present application, the server 103A obtains an application running request sent by the client 101A, where the running request includes a target parameter to be passed to a target function in the application; mirroring is performed on the target parameter to obtain a mirror parameter corresponding to the target parameter, and the mirror parameter is combined with a vulnerability test rule of the corresponding target function to obtain a combined result, so that the combined result can carry the corresponding features of the vulnerability test while avoiding contamination of the application; based on the way the application processes the target parameter before passing it to the target function, the combined result is processed to obtain a processing result; based on the processing result, the test result of the application is determined, and the vulnerability of the application can be tested during the running of the application without having to reproduce the process of the application processing data, thereby saving a lot of time and resources.

[0043] It should be noted that the application testing method provided in the embodiment of the present application is generally executed by the server 103A, and accordingly, the application testing device is generally set in the server 103A. However, in other embodiments of the present application, the client 101A may also have similar functions to the server 103A, thereby executing the application testing method provided in the embodiment of the present application.

[0044] Figure 1B A schematic diagram of an exemplary system architecture 100B to which the technical solution of the embodiments of the present application can be applied is shown.

[0045] like Figure 1B As shown, the system architecture 100B may include a request client 101B, a Web server 102B, a parser 103B, an interactive scanning agent (Interactive Application Security Testing agent, IASTagent) 104B and an analysis terminal 105B. It should be understood that Figure 1BThe number of request clients 101B, Web servers 102B, parsers 103B, interactive scanning agents 104B, and analysis terminals 105B in FIG. 1 is merely illustrative. Depending on the implementation requirements, there may be any number of request clients 101B, Web servers 102B, parsers 103B, interactive scanning agents 104B, and analysis terminals 105B.

[0046] In one embodiment of the present application, the Web server 102B obtains an application running request sent by the request client 101B, and the running request includes a target parameter passed to a target function in the application; the Web server 102B sends the running request to the parser 103B, and the parser 103B parses the running request to obtain the target parameter passed to the target function in the function called by the application running; the parser 103B sends the target parameter and to the interactive scanning agent 104B, and the interactive scanning agent 104B pre-stores a vulnerability testing rule corresponding to the target function, and the interactive scanning agent 104B performs mirror processing on the target parameter to obtain a mirror parameter corresponding to the target parameter; the interactive scanning agent 104B The image parameters are combined with the vulnerability test rules of the corresponding target function to obtain a combined result, which enables the combined result to carry the corresponding features of the vulnerability test while avoiding contamination of the application; the interactive scanning agent 104B processes the combined result based on the processing method of the target parameter before the application is passed into the target function to obtain the processing result; the interactive scanning agent 104B sends the processing result to the analysis terminal 105B, and the analysis terminal 105B determines the test result of the application based on the processing result. The analysis terminal 105B returns the test result to the request client 101B in the form of a work order, and the vulnerability of the application can be tested during the application operation process, without having to reproduce the process of the application processing the operation request, saving a lot of time and resources. At the same time, the parser 103B parses the operation request and returns the operation result to the request client 101B through the Web server 102B, and the test process does not interfere with the operation process of the application.

[0047] In one embodiment of the present application, the Web server 102B is used to provide Web services and receive all external HyperText Transfer Protocol (HTTP) requests sent by the requesting client 101B. The business can deploy its own Web application on the Web server to form a business Web application testing environment. The Web server forwards the request belonging to the dynamic script to the back-end parser 103B for processing, and then feeds back the parser processing results to the requesting client 101B.

[0048] In one embodiment of the present application, the parser 103B is a script parsing engine for a dynamic language. The dynamic language may be English Hypertext Preprocessor (PHP), Java, Go Programming Language (golang), a JavaScript interpreter running on a server (node.js), an object-oriented programming script language (ruby), python, etc. The parser 103B processes dynamic script requests forwarded by the Web server 102B. The parser 103B parses the content of the dynamic script request and returns the processing result to the Web server 102B.

[0049] In one embodiment of the present application, the interactive scanning agent 104B is an extension module of the parser 103B and is started together with the parser 103B.

[0050] Figure 2A A schematic diagram of an exemplary data sharing system 200 to which the technical solution of an embodiment of the present invention can be applied is shown.

[0051] See also Figure 2A The data sharing system 200 shown is a system for sharing data between nodes. Each node 201 can receive input information when performing normal work, and maintain the shared data in the data sharing system 200 based on the received input information. In order to ensure the information intercommunication within the data sharing system 200, there can be an information connection between each node 201 in the data sharing system 200, and information can be transmitted between the nodes 201 through the above information connection. For example, when any node 201 in the data sharing system 200 receives input information, other nodes 201 in the data sharing system 200 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes 201 in the data sharing system 200 are consistent.

[0052] Each node 201 in the data sharing system 200 has a node identifier corresponding thereto, and each node 201 in the data sharing system 200 can store the node identifiers of other nodes 201 in the data sharing system 200, so that the generated blocks can be broadcast to other nodes 201 in the data sharing system 200 according to the node identifiers of other nodes 201. A node identifier list as shown in the following table can be maintained in each node 201, and the node name and the node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address and any other information that can be used to identify the node. Table 1 only uses the IP address as an example for illustration.

[0053] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258

[0054] Table 1

[0055] Figure 2B A schematic diagram of a blockchain to which an embodiment of the present application can be applied is shown.

[0056] Each node in the data sharing system 200 stores an identical blockchain. The blockchain consists of multiple blocks, see Figure 2B The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0057] Figure 2C A schematic diagram of generating a new block in a blockchain to which an embodiment of the present application can be applied is shown.

[0058] When generating each block in the blockchain, see Figure 2C When the node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, the input information is stored in the memory pool and the hash tree used to record the input information is updated. After that, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:

[0059] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET

[0060] Among them, SH256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hsh is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TRGET is the eigenvalue threshold, which can be determined based on nbits.

[0061] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and the block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes 201 in the data sharing system 200 according to the node identifiers of other nodes 201 in the data sharing system 200, and the other nodes 201 verify the newly generated block and add the newly generated block to the blockchain stored in it after the verification is completed.

[0062] In one embodiment of the present application, the input information stored in the data sharing system 200 may be vulnerability testing rules, target parameters, combination results, or processing results. The application testing method of the present application using blockchain as a basis can improve the accuracy of the acquired data, thereby improving the accuracy of the application testing.

[0063] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0064] Figure 3 The flowchart of the application testing method according to an embodiment of the present application is schematically shown. The execution subject of the application testing method may be a server, for example, Figure 1A Server 103A shown in .

[0065] Reference Figure 3 As shown, the application testing method at least includes steps S310 to S340, which are described in detail as follows:

[0066] In step S310, an application execution request is obtained, where the execution request includes target parameters passed to a target function in the application.

[0067] In one embodiment of the present application, the application may be a Web application, and the application running request may be a functional test request sent to the application in order to test the application function.

[0068] In one embodiment of the present application, the target function can be selected from the functions called when the application executes the run request, and the function that determines whether the application executes the run request process to continue or end can be selected as the target function, which can be a sensitive function among the functions called by the application when executing the run request. For example, the target function can be the exec function, the system function, the popen function, the mysql_query function, the mysqli_query function, the eval function, the assert function, the readfile function, the file_get_contents function, the curl_exec function or the file_get_contents function, etc.

[0069] In one embodiment of the present application, the target parameter may be a parameter passed into the target function by the application in response to a run request, that is, a parameter executed by the target function when the application responds to a run request and causes the target function to be called.

[0070] In one embodiment of the present application, a run request can be sent to an application. During the process of the application executing the run request, the transmission path of all parameters contained in the run request is monitored, and the parameters passed to the target function among all the parameters are used as target parameters.

[0071] In other embodiments of the present application, the transmission paths of all parameters included in the running request can be predicted based on the application and the running request, and the parameters passed to the target function among all the predicted parameters are used as target parameters.

[0072] In step S320, the target parameter is mirrored to obtain a mirror parameter corresponding to the target parameter, and the mirror parameter is combined with a vulnerability test rule corresponding to the target function to obtain a combination result.

[0073] In one embodiment of the present application, the mirroring parameter may be the same parameter as the target parameter.

[0074] In one embodiment of the present application, the correspondence between the target function and the vulnerability testing rule can be determined based on experience. For example, if the target function can be an exec function, a system function or a popen function, the vulnerability testing rule is a command injection vulnerability testing rule; if the target function is a mysql_query function or a mysqli_query function, the vulnerability testing rule can be an SQL injection vulnerability testing rule; if the target function is an eval function or an assert function, the vulnerability testing rule can be a code injection vulnerability testing rule; if the target function is a readfile function or a file_get_contents function, the vulnerability testing rule can be a file reading vulnerability testing rule; if the target function is a curl_exec function or a file_get_contents function, the vulnerability testing rule can be a server-side cross-site request forgery vulnerability testing rule.

[0075] In one embodiment of the present application, the number of vulnerability testing rules corresponding to the target parameters can be obtained; the target parameters can be mirrored to obtain mirror parameters equal to the number of vulnerability testing rules; the mirror parameters are combined with the vulnerability testing rules one by one to obtain combination results equal to the number of vulnerability testing rules, thereby determining the test results of the run requests corresponding to the vulnerability testing rules included in the combination results based on each combination result. When the application responds to different run requests, the obtained combination results are different, so as to avoid confusion when the application executes multiple run requests and facilitate the execution of each run request.

[0076] In one embodiment of the present application, the vulnerability test rules and the mirror parameters can be spliced ​​or otherwise combined to achieve the combination of the vulnerability test rules and the mirror parameters. The splicing method can be to connect the vulnerability test rules after the mirror parameters, or the splicing method can be to connect the vulnerability test rules before the mirror parameters. The vulnerability test rules and the mirror parameters have the same format, and both can be character formats, so that the obtained combination results can smoothly perform the processing originally performed on the parameters. Combining the mirror parameters instead of directly combining the target parameters can avoid contaminating the running process of the application, and can enable the requesting client 101B to accurately obtain the test results. In addition, since the combination result carries the vulnerability test rule, which corresponds to the vulnerability test, the test result determined based on the combination result can accurately reflect the test result of the running request.

[0077] In step S330, based on the processing method of the application program on the target parameter before it is passed into the target function, the combination result is processed to obtain a processing result.

[0078] In one embodiment of the present application, the processing method of the target parameter by the application program before it is passed into the target function may include detection processing, correction processing corresponding to the detection processing, transfer processing corresponding to the detection processing, and operation processing, etc. The operation processing may include arithmetic operation, connection operation, relational operation, assignment operation, and logical operation, etc.

[0079] In one embodiment of the present application, the relationship between the detection processing, the correction processing corresponding to the detection processing, and the transfer processing corresponding to the detection processing can be: if the processing result obtained by the detection processing of the combined result is that the combined result complies with the detection rule corresponding to the detection processing, the transfer processing of the detection processing is performed on the combined result; if the processing result obtained by the detection processing of the combined result is that the combined result does not comply with the detection rule corresponding to the detection processing, the correction processing of the detection processing is performed on the combined result to obtain the combined result that complies with the detection rule corresponding to the detection processing, and then the transfer processing of the detection processing is performed on the combined result.

[0080] In one embodiment of the present application, the combination result can be detected and processed to obtain a detection result; if the detection result is that the combination result does not comply with the detection rule corresponding to the detection processing, the combination result is corrected based on the correction processing of the corresponding detection processing in the processing method to obtain a combination result that complies with the detection rule corresponding to the detection processing; the combination result that complies with the detection rule corresponding to the detection processing is transferred; and the processing result is obtained based on the transferred combination result that complies with the detection rule corresponding to the detection processing.

[0081] In one embodiment of the present application, the combination result can be detected based on the detection processing that first appears in the processing method in the order in which the processing method of the target parameter appears before the target function is passed into the target function, and the detection result is obtained; if the detection result is that the combination result does not meet the detection rule corresponding to the detection processing that first appears, the combination result is corrected based on the correction processing corresponding to the detection processing that first appears in the processing method to obtain a combination result that meets the detection rule corresponding to the detection processing that first appears; based on the transfer processing corresponding to the detection processing that first appears in the processing method, the combination result that does not need to be corrected and meets the detection rule corresponding to the detection processing that first appears after the correction processing is transferred to the next detection processing adjacent to the first detection processing in the processing method for detection, and the combination result that does not meet the detection rule of the next detection processing is subjected to the next correction processing corresponding to the next detection processing in the processing method to obtain the combination result that meets the detection rule corresponding to the next detection processing, and the combination result that does not need to be corrected and meets the detection rule corresponding to the next detection processing after the correction processing is subjected to the next transfer processing corresponding to the next detection processing in the processing method, until the combination result is transferred based on the last transfer processing in the processing method to obtain the processing result.

[0082] In one embodiment of the present application, a detection process may detect a certain vulnerability. If the detection result is that the combined result does not meet the detection rules for detecting the vulnerability, the detection result is sent to the correction process for repairing the vulnerability, that is, the detection process and the correction process that can detect and repair the same vulnerability can be determined to have a corresponding relationship. If the detection result is that the combined result meets the detection rules for detecting the vulnerability, the detection result is sent to the transfer process that meets the detection rules, and the transfer process for delivering the results that meet the detection rules can be used as the transfer process corresponding to the detection of the vulnerability. In other embodiments of the present application, the detection result can also be sent to the transfer process for delivering the combined result without the vulnerability, and the transfer process for delivering the combined result without the vulnerability can be used as the transfer process corresponding to the detection of the vulnerability.

[0083] In one embodiment of the present application, when the combination result is in character format, the detection processing may be to detect whether the characters of the combination result comply with the detection rules of the detection processing. For example, the detection rule may be to detect whether a specific character is included in the combination result. If the specific character is included in the combination result, it is determined that the combination result does not comply with the detection rules of the detection processing. The correction processing corresponding to the detection processing may be to delete or replace the specific character in the combination result.

[0084] In one embodiment of the present application, the process of processing the combined result based on the application's processing method of the target parameter before passing it into the target function to obtain the processing result can be executed by passing the combined result into the application. However, when the application passes the combined result to the target function, the target function can detect that what is passed in is the combined result. At this time, the target function stops executing the combined result to prevent the generation of dirty data, and reports the combined result to the interactive scanning agent 104B. The interactive scanning agent 104B checks the target function in the parser 103B and reports the parameter information containing the mirror parameter when the target function is executed.

[0085] In one embodiment of the present application, the interactive scanning agent 104B needs to be developed and adapted for different programming languages, such as PHP / Java / Golang / node.js / ruby / python, etc. When the programming language is PHP, the functions checked by the interactive scanning agent 104B may include: mysql_query, mysqli_query, mysqli::query, mysqli_real_query, mysqli::real_query, mysqli_prepare, mysqli::prepare, PDO::query, PDO::exec, PDO::prepare, pg_query, pg_send_query, pg_prepare, SQ SQL query functions such as Lite3::query, SQLite3::exec, SQLite3::querySingle, etc.; command execution functions such as passthru, system, exec, shell_exec, proc_open, popen, pcntl_exec, etc. for command execution; code execution functions such as eval, assert, etc. for code execution; file operation functions such as file, readfile, file_get_contents, fopen, SplFileObject::_construct, copy, rename, move_uploaded_file, include, etc. for file operations; and network request functions such as curl_exec, etc. for network requests.

[0086] In one embodiment of the present application, when the programming language is Java, the functions checked by the interactive scanning agent 104B may include: com.mysql.jdbc.PreparedStatement, com.mysql.cj.jdbc.PreparedStatement, com.mysql.cj.jdbc.ClientPreparedStatement, com.mysql.cj.jdbc.ClientPreparedStatement, org.sqlite.PrepStmt, org.sqlite.jdbc3.JDBC3PreparedStatement, oracle.jdbc.driver.OraclePreparedStatement, com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement, org.postgresql.jdbc.PgPreparedStatement, org.postgresql.jdbc1.AbstractJdbc1Statement, org.postgresql.jdbc2.AbstractJdbc2Statement, org. postgresql.jdbc3.AbstractJdbc3Statement, org.postgresql.jdbc3g.AbstractJdbc3gStatement, org.postgresql.jdbc4.AbstractJdbc4Stat ement, org.hsqldb.jdbc.JDBCPreparedStatement, org.postgresql.jdbc.PgPreparedStatement, com.mysql.jdbc.StatementImpl, com.mysql.c j.jdbc.StatementImpl, org.sqlite.Stmt, org.sqlite.jdbc3.JDBC3Statement, oracle.jdbc.driver.OracleStatement, com.microsoft.sqlser ver.jdbc.SQLServerStatement, org.postgresql.jdbc.PgStatement, org.postgresql.jdbc1.AbstractJdbc1Statement, org.postgresql.jdbc2.AbstractJdbc2Statement, org.postgresql.jdbc3.AbstractJdbc3Statement, org.postgresql.jdbc3g.AbstractJdbc3gStatement, org.postgresql.jdbc4.AbstractJdbc4Statement, org.hsqldb.jdbc.JDBCStatement and other SQL query functions; java.lang.ProcessBuilder, java.lang.ProcessImpl, java.lang.UNIXProcess, java.lang.ProcessImpl and other command execution functions for command execution; ognl.OgnlParser.topLevelExpression and other code execution functions for code execution; org.apache.commons.fileupload.disk.DiskFileItem.setHeaders, org.apache.commons.fileupload.FileUploadBase.parseRequest, java.io. FileInputStream, java.io.FileOutputStream, java.io.File.renameTo, java.io.File.list and other file operation functions; as well as org.apache.commons.httpclient.URI, org.apache.http.impl.client.CloseableHttpClient, org.apache.http.impl.client.AutoRetryHttpClient, org.apache.http.impl.client.DecompressingHttpClient, org.apache.http.impl.client.AbstractHttpClient, java.net.URLConnection$1, java.net.HttpURLConnection, java.net.HttpURLConnection, java.net.Socket, com.squareup.okhttp.Call$ApplicationInterceptorChain, okhttp3 for network requests.RealCall$ApplicationInterceptorChain, okhttp3.internal.http.RealInterceptorChain, sun.net.www.protocol.http.HttpURLConnection, weblogic.net.http.HttpURLConnection, weblogic.uddi.client.service.UDDIService and other network request functions. .

[0087] Continue to refer to Figure 3 , in step S340, based on the processing result, the test result of the application is determined.

[0088] In one embodiment of the present application, the vulnerability testing rules in the processing results can be obtained as the result vulnerability testing rules; if the vulnerability testing rules are the same as the result vulnerability testing rules, the test result of the application is determined to have a vulnerability; if the vulnerability testing rules are different from the result vulnerability testing rules, the test result of the application is determined to have no vulnerability.

[0089] In one embodiment of the present application, the processing result may be subjected to syntax analysis to determine the test result of the application program, and the syntax analysis may be performed using a Bash syntax analysis method (GNU Bourne-Again Shell).

[0090] In one embodiment of the present application, if the vulnerability test rule corresponding to the target function is a command injection vulnerability test rule, the vulnerability test rule in the processing result can be obtained as the result vulnerability test rule, and the processing result can be split to obtain a split result; if in the split result, the result vulnerability test rule and other contents in the processing result except the result vulnerability test rule are located in a grammatical unit (token), then the test result of the application can be determined to have a vulnerability; if in the split result, the result vulnerability test rule is independent of other contents in the processing result except the result vulnerability test rule, then the test result of the application can be determined to have no vulnerability. For example, the processing result is 123B'T_S_T, where the result vulnerability test rule is T_S_T, if the split result is 123 and B'T_S_T, then the test result of the application can be determined to have a vulnerability; if the split result is 123B' and T_S_T, then the test result of the application can be determined to have no vulnerability.

[0091] In this embodiment, if the result vulnerability test rule and other content in the processing result except the result vulnerability test rule are located in a grammatical unit, it can be determined that the result vulnerability test rule is split as a mirror parameter. When the combined result is subsequently processed, the result vulnerability test rule will also be processed, which should only be performed on the mirror parameter. In other words, the step of determining the processing result does not recognize that the command injection vulnerability test rule is added to the combined result. Therefore, the application has a command injection vulnerability.

[0092] In this embodiment, the processing result can be split by identifying the semantics of the processing result, so as to split the content that should be in the same grammatical unit into one grammatical unit.

[0093] In one embodiment of the present application, if the vulnerability test rule corresponding to the target function is a query injection vulnerability test rule, the vulnerability test rule in the processing result can be obtained as the result vulnerability test rule, and the processing result can be split to obtain a split result; if in the split result, the result vulnerability test rule and other contents in the processing result except the result vulnerability test rule are located in a grammatical unit, then the test result of the application is determined to have a vulnerability; if in the split result, the result vulnerability test rule is independent of other contents in the processing result except the test identifier, then the test result of the application is determined to have no vulnerability. In this embodiment, if the result vulnerability test rule and other contents in the processing result except the result vulnerability test rule are located in a grammatical unit, it can be determined that the result vulnerability test rule is split as a mirror parameter, and then when the combined result is subsequently processed, the processing that should only be performed on the mirror parameter will also be performed on the result vulnerability test rule. In other words, the query injection vulnerability test rule added to the combined result is not recognized in the step of determining the processing result, and therefore, the application has a query injection vulnerability.

[0094] In one embodiment of the present application, if the vulnerability test rule corresponding to the target function is a file read vulnerability test rule, the path information corresponding to the file read vulnerability test can be obtained based on the processing result; if the scopes in the path information are not unified, that is, the path information does not point to the content in the same scope, the scopes in the path information are unified to obtain the unified path information; if the unified path information is the target path, it can be determined that the application has a vulnerability; if the unified path information is not the target path, it can be determined that the application has no vulnerability, wherein the target path is the path where the file targeted by the file read vulnerability test rule is located, which can be obtained before testing.

[0095] In one embodiment of the present application, whether the scope in the path information is unified can be determined by determining the position of the separator in the path information. For example, if multiple consecutive separators appear in the path information, it can be determined that the scope in the path information is not unified. The middle separator of the multiple consecutive separators except the one between the first and the last separators can be deleted to unify the scope in the path information. In one embodiment of the present application, a vulnerability test tag corresponding to the vulnerability test rule can be obtained, and the vulnerability test tag can be added to the combination result; based on the application's processing method for the target parameter before it is passed into the target function, the combination result with the vulnerability test tag added is processed to obtain the tag processing result; based on the tag processing result, the test result of the application is determined. In the process of executing the application's processing method for the target parameter before it is passed into the target function, other parameters will be introduced to ensure smooth execution. The vulnerability test tag can be used to distinguish the tag processing result from other parameters, so as to facilitate the determination of the test result of the application according to the tag processing result.

[0096] In one embodiment of the present application, a vulnerability test tag corresponding to the running request can be obtained, and the vulnerability test tag corresponding to the running request can be added to the combined result corresponding to the running request to facilitate identifying the tag processing result corresponding to the running request.

[0097] In one embodiment of the present application, if there is a vulnerability test mark in the mark processing result, the test result of the application can be determined based on the mark processing result; if there is no vulnerability test mark in the mark processing result, the test result of the application can be determined as having no vulnerability.

[0098] In one embodiment of the present application, if there is a vulnerability test tag in the tag processing result, and the vulnerability test rule corresponding to the vulnerability test tag is a vulnerability test rule other than the preset vulnerability test rule, then the test result of the application is determined to be that there is a vulnerability.

[0099] In this embodiment, the preset vulnerability testing rules may be command injection vulnerability testing rules, query injection vulnerability testing rules, and file reading vulnerability testing rules.

[0100] In one embodiment of the present application, if there is a vulnerability test tag in the tag processing result, and the vulnerability test request corresponding to the vulnerability test tag is a command injection vulnerability running request or a query injection vulnerability running request, the tag processing result can be split. If the vulnerability test tag in the split tag processing result and other contents in the processing result except the vulnerability test tag are located in a grammatical unit, then the test result of the application is determined to have a vulnerability; if in the split result, the vulnerability test tag is independent of other contents in the processing result except the vulnerability test tag, then the test result of the application is determined to have no vulnerability.

[0101] In one embodiment of the present application, if there is a vulnerability test tag in the tag processing result, and the vulnerability test request corresponding to the vulnerability test tag is a file read vulnerability operation request, the path information corresponding to the file read vulnerability test can be obtained based on the tag processing result; if the scope in the path information is not unified, the scope in the path information is unified to obtain the unified path information; if the unified path information is the target path, it is determined that the application has a vulnerability; if the unified path information is not the target path, it is determined that the application has no vulnerability.

[0102] In one embodiment of the present application, if there is a vulnerability test tag in the tag processing result, and the vulnerability test rule corresponding to the vulnerability test tag is a test rule other than the preset vulnerability test request, then it can be determined that the test result of the application program has a vulnerability. If there is a vulnerability test tag in the tag processing result, it means that in the process of processing the combined result with the vulnerability test tag based on the processing method of the application program on the target parameter before passing it into the target function, the vulnerability test tag is not recognized to be added to the combined result, that is, there is a vulnerability in the application program.

[0103] In this embodiment, the preset vulnerability test request may be a command injection vulnerability test request, a query injection vulnerability test request, and a file reading vulnerability test request.

[0104] exist Figure 3 In an embodiment of the present invention, an application running request is obtained, wherein the running request includes a target parameter to be passed to a target function in the application; the target parameter is mirrored to obtain a mirror parameter corresponding to the target parameter, and the mirror parameter is combined with a vulnerability test rule of the corresponding target function to obtain a combined result, so that the combined result can carry vulnerability test features while avoiding contamination of the application; based on the way the application processes the target parameter before passing it to the target function, the combined result is processed to obtain a processed result; based on the processed result, the test result of the application is determined, and the vulnerability of the application can be tested during the running of the application without having to reproduce the process of the application processing data, thereby saving a lot of time and resources.

[0105] exist Figure 3 In the embodiment, only the target parameters passed into the target function are obtained, and the test application can be tested with as few parameters as possible, thereby efficiently and accurately discovering vulnerabilities in the Web application.

[0106] The following describes an apparatus embodiment of the present application, which can be used to execute the application testing method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the application testing method of the present application.

[0107] Figure 4 The block diagram of an application program testing device according to an embodiment of the present application is schematically shown.

[0108] Reference Figure 4 As shown, an application testing device 400 according to an embodiment of the present application includes an acquisition module 401 , a mirroring module 402 , a processing module 403 and a testing module 404 .

[0109] According to one aspect of an embodiment of the present application, based on the aforementioned scheme, the acquisition module 401 is configured to obtain an application running request, the running request including a target parameter to be passed into a target function in the application; the mirroring module 402 is configured to mirror the target parameter to obtain a mirroring parameter corresponding to the target parameter, and combine the mirroring parameter with a vulnerability testing rule corresponding to the target function to obtain a combined result; the processing module 403 is configured to process the combined result based on the way the application processes the target parameter before passing it into the target function to obtain a processing result; the testing module 404 is configured to determine the test result of the application based on the processing result.

[0110] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is configured to: obtain the vulnerability test rules in the processing results as the result vulnerability test rules; if the vulnerability test rules are the same as the result vulnerability test rules, then the test result of the application is determined to have a vulnerability; if the vulnerability test rules are different from the result vulnerability test rules, then the test result of the application is determined to have no vulnerability.

[0111] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is configured as follows: if the vulnerability test rule corresponding to the target function is a command injection vulnerability test rule or a query injection vulnerability test rule, then the vulnerability test rule in the processing result is obtained as the result vulnerability test rule; the processing result is split to obtain a split result; if in the split result, the result vulnerability test rule and other contents in the processing result except the result vulnerability test rule are located in a grammatical unit, then the test result of the application is determined to have a vulnerability; if in the split result, the result vulnerability test rule is independent of other contents in the processing result except the result vulnerability test rule, then the test result of the application is determined to have no vulnerability.

[0112] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is configured as follows: if the vulnerability test rule corresponding to the target function is a file read vulnerability test rule, then based on the processing result, the path information corresponding to the file read vulnerability test is obtained; if the scopes in the path information are not unified, then the scopes in the path information are unified to obtain unified path information; if the unified path information is the target path, it is determined that the application has a vulnerability; if the unified path information is not the target path, it is determined that the application has no vulnerability.

[0113] In one embodiment of the present application, based on the aforementioned scheme, the processing method includes detection processing, correction processing, and transfer processing, and the processing module 403 is configured to: perform detection processing on the combination result to obtain a detection result; if the detection result is that the combination result does not comply with the detection rule corresponding to the detection processing, then based on the correction processing corresponding to the detection processing in the processing method, the combination result is corrected to obtain a combination result that complies with the detection rule corresponding to the detection processing; transfer processing is performed on the combination result that complies with the detection rule corresponding to the detection processing; and the processing result is obtained based on the transferred combination result that complies with the detection rule corresponding to the detection processing.

[0114] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is further configured to: obtain a vulnerability test tag corresponding to the vulnerability test rule; add the vulnerability test tag to the combined result; based on the application's processing method for the target parameter before passing it into the target function, process the combined result with the added vulnerability test tag to obtain a tag processing result; based on the tag processing result, determine the test result of the application.

[0115] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is configured as follows: if there is a vulnerability test mark in the mark processing result, then the test result of the application is determined based on the mark processing result; if there is no vulnerability test mark in the mark processing result, then the test result of the application is determined to be free of vulnerabilities.

[0116] In one embodiment of the present application, based on the aforementioned scheme, the test module 404 is configured as follows: if there is a vulnerability test mark in the mark processing result, and the vulnerability test rule corresponding to the vulnerability test mark is a vulnerability test rule other than the preset vulnerability test rule, then the test result of the application is determined to be that there is a vulnerability.

[0117] In one embodiment of the present application, based on the aforementioned scheme, the mirroring module 402 is further configured to: obtain the number of vulnerability testing rules corresponding to the target parameters; perform mirroring processing on the target parameters to obtain mirroring parameters that are the same as the number of vulnerability testing rules; combine the mirroring parameters with the vulnerability testing rules one by one to obtain a combination result that is the same as the number of vulnerability testing rules.

[0118] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0119] Refer to the following Figure 5 An electronic device 50 according to this embodiment of the present application will be described. Figure 5 The electronic device 50 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0120] like Figure 5 As shown, the electronic device 50 is in the form of a general computing device. The components of the electronic device 50 may include but are not limited to: at least one processing unit 51, at least one storage unit 52, a bus 53 connecting different system components (including the storage unit 52 and the processing unit 51), and a display unit 54.

[0121] The storage unit stores program codes, which can be executed by the processing unit 51, so that the processing unit 51 executes the steps described in the above “Embodiment Method” section of this specification according to various exemplary implementations of the present application.

[0122] The storage unit 52 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 521 and / or a cache memory unit 522 , and may further include a read-only memory unit (ROM) 523 .

[0123] The storage unit 52 may also include a program / utility 524 having a set (at least one) of program modules 525, such program modules 525 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0124] Bus 53 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0125] The electronic device 50 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 50, and / or may communicate with any device that enables the electronic device 50 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 55. Furthermore, the electronic device 50 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 56. As shown, the network adapter 56 communicates with other modules of the electronic device 50 via a bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0126] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0127] According to one embodiment of the present application, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present application can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present specification.

[0128] According to one embodiment of the present application, the program product for implementing the above method can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, apparatus or device.

[0129] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0130] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0132] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0133] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0134] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be performed without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An application testing method, characterized in that: include: Obtaining a running request of an application, wherein the running request includes a target parameter passed to a target function in the application, and the running request represents a request for testing a function of the application; Performing mirror processing on the target parameter to obtain a mirror parameter corresponding to the target parameter, and combining the mirror parameter with a vulnerability test rule corresponding to the target function to obtain a combination result; Based on the processing method of the target parameter by the application program before being passed into the target function, the combination result is processed to obtain a processing result; Based on the processing result, determining a test result of the application; The processing method includes detection processing, correction processing, and transfer processing. The processing method based on the application program for the target parameter before it is passed into the target function processes the combination result to obtain the processing result, including: Performing detection processing on the combined result to obtain a detection result; If the detection result is that the combination result does not conform to the detection rule corresponding to the detection process, then based on the correction process corresponding to the detection process in the processing method, the combination result is corrected to obtain a combination result that conforms to the detection rule corresponding to the detection process; Performing a transfer process on the combination result that meets the detection rule corresponding to the detection process, wherein the transfer process is used to transfer the combination result that meets the detection rule corresponding to the detection process to the next detection process adjacent to the detection process; The processing result is obtained based on the combined result that meets the detection rule corresponding to the detection processing after the transmission.

2. The application testing method according to claim 1, characterized in that: Determining the test result of the application based on the processing result includes: Acquire the vulnerability testing rule in the processing result as the result vulnerability testing rule; If the vulnerability test rule is the same as the result vulnerability test rule, determining that the test result of the application is vulnerable; If the vulnerability test rule is different from the result vulnerability test rule, it is determined that the test result of the application program has no vulnerability.

3. The application testing method according to claim 1, characterized in that: If the vulnerability test rule corresponding to the target function is a command injection vulnerability test rule or a query injection vulnerability test rule, then determining the test result of the application based on the processing result includes: Acquire the vulnerability test rules in the processing result as the result vulnerability test rules; split the processing result to obtain split results; If in the split result, the result vulnerability test rule and other contents in the processing result except the result vulnerability test rule are located in one grammatical unit, determining that the test result of the application program has a vulnerability; If in the split result, the result vulnerability test rule is independent of other contents in the processing result except the result vulnerability test rule, then it is determined that the test result of the application is free of vulnerabilities.

4. The application testing method according to claim 1, characterized in that: If the vulnerability test rule corresponding to the target function is a file read vulnerability test rule, then determining the test result of the application based on the processing result includes: Based on the processing result, obtaining path information corresponding to the file read vulnerability test; If the scopes in the path information are not unified, unifying the scopes in the path information to obtain unified path information; If the unified path information is the target path, it is determined that the application has a vulnerability; If the unified path information is not the target path, it is determined that the application has no vulnerability.

5. The application testing method according to claim 1, characterized in that: After obtaining the combination result, the method further includes: Obtaining a vulnerability test mark corresponding to the vulnerability test rule; adding the vulnerability test mark to the combined result; Based on the processing method of the target parameter by the application program before being passed into the target function, the combined result of adding the vulnerability test mark is processed to obtain the mark processing result; Based on the marking processing result, a test result of the application is determined.

6. The application testing method according to claim 5, characterized in that: Determining the test result of the application based on the marking processing result includes: If the vulnerability test tag exists in the tag processing result, determining the test result of the application based on the tag processing result; If the vulnerability test mark does not exist in the mark processing result, it is determined that the test result of the application program has no vulnerability.

7. The application testing method according to claim 6, characterized in that: If the vulnerability test mark exists in the mark processing result, determining the test result of the application based on the mark processing result includes: If the vulnerability test mark exists in the mark processing result, and the vulnerability test rule corresponding to the vulnerability test mark is a vulnerability test rule other than the preset vulnerability test rule, it is determined that the test result of the application program has a vulnerability.

8. The application testing method according to claim 1, characterized in that: The mirroring of the target parameter to obtain a mirrored parameter corresponding to the target parameter, and combining the mirrored parameter with a vulnerability test rule corresponding to the target function to obtain a combined result, include: Obtain the number of vulnerability testing rules corresponding to the target parameter; Mirroring the target parameters to obtain mirrored parameters with the same number as the vulnerability testing rules; The mirror parameters are combined with the vulnerability test rules in a one-to-one correspondence to obtain combination results having the same number as the vulnerability test rules.

9. An application testing device, characterized in that: include an acquisition module configured to acquire an application running request, wherein the running request includes a target parameter passed to a target function in the application, and the running request represents a request for testing a function of the application; A mirroring module, configured to perform mirroring processing on the target parameter to obtain a mirroring parameter corresponding to the target parameter, and combine the mirroring parameter with a vulnerability testing rule corresponding to the target function to obtain a combination result; A processing module, configured to process the combination result based on the processing method of the application program on the target parameter before it is passed into the target function, to obtain a processing result; A testing module configured to determine a test result of the application based on the processing result; The processing method includes detection processing, correction processing, and transfer processing. The processing method based on the application program for the target parameter before it is passed into the target function processes the combination result to obtain the processing result, including: Performing detection processing on the combined result to obtain a detection result; If the detection result is that the combination result does not conform to the detection rule corresponding to the detection process, then based on the correction process corresponding to the detection process in the processing method, the combination result is corrected to obtain a combination result that conforms to the detection rule corresponding to the detection process; Performing a transfer process on the combination result that meets the detection rule corresponding to the detection process, wherein the transfer process is used to transfer the combination result that meets the detection rule corresponding to the detection process to the next detection process adjacent to the detection process; The processing result is obtained based on the combined result that meets the detection rule corresponding to the detection processing after the transmission.

10. A computer-readable program medium storing computer program instructions, characterized in that: When the computer program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 8.

11. An electronic device, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any one of claims 1 to 8.