Large-scale dynamic detection method and system for small program vulnerabilities based on policy self-optimization
Through the mini program vulnerability detection method based on policy self-optimization, the problem that existing technology small program dynamic testing is difficult to collect and adaptively test on a large scale, and efficient detection of massive mini programs and adaptability testing of various mini programs are achieved.
Patent Information
- Application Number
- CN202411618802.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The existing dynamic testing methods of mini programs are difficult to collect massive mini programs on a large scale, and it is difficult to adaptively test a variety of mini programs, resulting in inefficient detection.
Large-scale dynamic detection method of mini-program vulnerability based on strategy self-optimization is adopted, mini-programs are collected through keyword search, specific scenario testing tasks are divided, mini-program dynamic testing tools are called for vulnerability detection, and testing strategies are dynamically optimized based on the detection results.
It realizes efficient collection of massive mini programs and adaptive testing of large-scale diverse mini programs, improving the adaptability and efficiency of vulnerability detection.
Smart Images

Figure CN119128917B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vulnerability detection, and in particular to a large-scale dynamic detection method and system for mini-program vulnerabilities based on policy self-optimization. Background Art
[0002] As mini programs, a new type of web application, become more popular among major super applications, while bringing great convenience to users, mini programs also involve storing or transmitting a large amount of privacy-sensitive information of users, and some mini programs also involve providing consumer services. Once a mini program has security issues, it will cause serious harm.
[0003] Mini Programs, a new application paradigm, have many common vulnerabilities due to their underlying design. However, the number of Mini Programs has reached millions, and these common vulnerabilities will affect hundreds of thousands or even millions of Mini Programs. Some common vulnerabilities will only be triggered when the Mini Program runs in a certain scenario, and each Mini Program has different designs. For example, the name of the Mini Program authorization login button can be various forms such as user one-click login, local number one-click login, mobile phone number quick login, and mobile phone number login.
[0004] Existing methods cannot solve the problems of large scale of mini programs and diverse business logic implementations.
[0005] For example, first, the mini program to be tested is retrieved according to its name and APPID, and the static front-end source code is obtained to extract the key string code segment, and the key string code segment is evaluated for security risks. Then, a simulated click operation is performed on the mini program, and a vulnerability scanner is started to scan for vulnerabilities. However, this method does not pay attention to whether the order of simulated clicks is correct, and the wrong click order cannot be used for subsequent testing; it also does not pay attention to how to fill in the input box during the dynamic test; and the efficiency of large-scale detection using this method is extremely low.
[0006] For example, the front-end source code of the mini program is converted into a code attribute graph, and then the code attribute graph is queried to match the code snippets containing known vulnerability features to detect vulnerabilities. This method only performs static testing on the front-end code of the mini program, and is ineffective for vulnerabilities hidden in the back-end logic that need to be dynamically triggered.
[0007] For example, a proxy is injected into the host program to obtain the mini program link, and then the detection tool is called to perform security detection based on the obtained mini program link. It is difficult to perform high coverage testing on the mini program based only on the obtained link.
[0008] For example, we can analyze the host program in depth and select effective locations for hooking to solve the problem of difficulty in obtaining information and controlling the page jump navigation of the mini program during the test. However, the encryption and obfuscation algorithms of applications are becoming more and more complex, and it is very complicated to reverse them.
[0009] Therefore, there are technical challenges in how to automatically detect common vulnerabilities in specific scenarios of mini programs on a large scale. Summary of the invention
[0010] The present invention proposes a large-scale dynamic detection solution for mini-program vulnerabilities based on policy self-optimization; it aims to solve the technical difficulties that existing mini-program dynamic testing methods are difficult to collect massive mini-programs on a large scale and difficult to perform adaptive testing on large-scale and diverse mini-programs.
[0011] The first aspect of the present invention discloses a large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization, the method comprising:
[0012] Step S1, collect a number of mini-programs through keyword search, store the collected mini-program related information in the mini-program database to be tested, and dynamically update the keyword set;
[0013] Step S2: Divide the specific scenario test task with common vulnerabilities into several subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-programs corresponding to the associated information in the mini-program database to be tested based on the several subtasks;
[0014] Step S3: Generate a vulnerability detection report based on the vulnerability detection results, and dynamically optimize the testing strategy of the mini program dynamic testing tool.
[0015] According to the method of the first aspect of the present invention, in step S1:
[0016] Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching;
[0017] Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program;
[0018] New keywords are filtered out from the name and description information of the mini-program, and the filtered out new keywords are added to the keyword set to dynamically update the keyword set.
[0019] According to the method of the first aspect of the present invention, in step S2:
[0020] Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks;
[0021] Call the applet dynamic testing tool to execute:
[0022] The mini program corresponding to the related information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included:
[0023] Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message.
[0024] According to the method of the first aspect of the present invention, in step S3: obtaining a message intercepted by the HTTPS interception tool, and matching the characteristics of the common vulnerability in the message; wherein:
[0025] If the match is successful, the test is successful; further generate a vulnerability detection report;
[0026] If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
[0027] The second aspect of the present invention discloses a large-scale dynamic detection system for mini-program vulnerabilities based on policy self-optimization, the system comprising:
[0028] The first processing unit is configured to: collect a number of mini-programs through keyword retrieval, store the collected mini-program related information in a mini-program database to be tested, and dynamically update the keyword set;
[0029] The second processing unit is configured to: divide the specific scenario test task with common vulnerabilities into a plurality of subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-program corresponding to the associated information in the mini-program database to be tested based on the plurality of subtasks;
[0030] The third processing unit is configured to: generate a vulnerability detection report according to the vulnerability detection results, and dynamically optimize the testing strategy of the mini-program dynamic testing tool.
[0031] According to the system of the second aspect of the present invention, the first processing unit is specifically configured as follows:
[0032] Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching;
[0033] Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program;
[0034] New keywords are filtered out from the name and description information of the mini-program, and the filtered out new keywords are added to the keyword set to dynamically update the keyword set.
[0035] According to the system of the second aspect of the present invention, the second processing unit is specifically configured as follows:
[0036] Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks;
[0037] Call the applet dynamic testing tool to execute:
[0038] The mini program corresponding to the related information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included:
[0039] Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message.
[0040] According to the system of the second aspect of the present invention, the third processing unit is specifically configured to: obtain a message intercepted by the HTTPS interception tool, and match the characteristics of the common vulnerability in the message; wherein:
[0041] If the match is successful, the test is successful; further generate a vulnerability detection report;
[0042] If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
[0043] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the large-scale dynamic detection method for small program vulnerabilities based on policy self-optimization described in the first aspect of the present disclosure is implemented.
[0044] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization described in the first aspect of the present disclosure.
[0045] In summary, this method firstly alleviates the limitation that the mini-program search function can only obtain a small number of related mini-programs in a single search through a large-scale collection method of mini-programs based on keyword enhancement, continuously extracts new keywords based on the search results, and enhances the keyword set for subsequent search and collection. Secondly, this method uses a mini-program vulnerability dynamic detection method based on policy self-optimization to perform large-scale detection of common vulnerabilities in specific scenarios. On the basis of the initial strategy, each mini-program in the collected mini-program database is tested in turn, and the test strategy is continuously optimized during the test process to improve the adaptability to large-scale, complex and diverse mini-program dynamic testing.
[0046] The present invention achieves the following technical effects: (1) By using the method, a large amount of mini-program data sets on the Internet can be obtained, which can be used for subsequent large-scale detection; (2) By using the method, the test strategy of a certain business scenario can be continuously and automatically optimized by testing the collected mini-programs in sequence; (3) By using the method, high-adaptability and large-scale vulnerability detection can be achieved for business scenarios containing a certain common vulnerability. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A schematic diagram of large-scale dynamic detection of mini-program vulnerabilities based on policy self-optimization according to an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of large-scale collection of mini-programs based on keyword enhancement according to an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of mini-program vulnerability dynamic detection based on policy self-optimization according to an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of test strategy optimization according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] 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 only 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 making creative work are within the scope of protection of the present invention.
[0053] The first aspect of the present invention discloses a large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization, the method comprising:
[0054] Step S1, collect a number of mini-programs through keyword search, store the collected mini-program related information in the mini-program database to be tested, and dynamically update the keyword set;
[0055] Step S2: Divide the specific scenario test task with common vulnerabilities into several subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-programs corresponding to the associated information in the mini-program database to be tested based on the several subtasks;
[0056] Step S3: Generate a vulnerability detection report based on the vulnerability detection results, and dynamically optimize the testing strategy of the mini program dynamic testing tool.
[0057] According to the method of the first aspect of the present invention, in step S1:
[0058] Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching;
[0059] Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program;
[0060] New keywords are filtered out from the name and description information of the mini-program, and the filtered out new keywords are added to the keyword set to dynamically update the keyword set.
[0061] According to the method of the first aspect of the present invention, in step S2:
[0062] Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks;
[0063] Call the applet dynamic testing tool to execute:
[0064] The mini program corresponding to the associated information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included:
[0065] Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message.
[0066] According to the method of the first aspect of the present invention, in step S3: obtaining a message intercepted by the HTTPS interception tool, and matching the characteristics of the common vulnerability in the message; wherein:
[0067] If the match is successful, the test is successful; further generate a vulnerability detection report;
[0068] If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
[0069] In some embodiments, Figure 1 As shown, the large-scale dynamic detection of mini-program vulnerabilities based on policy self-optimization includes two parts: large-scale collection of mini-programs based on keyword enhancement and dynamic detection of mini-program vulnerabilities based on policy self-optimization.
[0070] First, the large-scale collection module of mini-programs based on keyword enhancement continuously enhances the keyword set through a continuous cycle, retrieves the relevant mini-program name, ID, and description information, and stores it in the database for subsequent testing; then the mini-program vulnerability dynamic detection module based on policy self-optimization tests the mini-programs to be tested in the database in turn, and continuously optimizes the test strategy during the testing process to achieve high adaptability to large-scale detection of specific scenarios of common mini-program vulnerabilities, and support effective dynamic detection of large-scale mini-programs; finally, the detection report of all tested mini-programs is output.
[0071] In some embodiments, Figure 2 As shown in the figure, the large-scale collection of small programs based on keyword enhancement is used to collect a large number of small programs publicly available on the Internet for large-scale security testing. First, the first 1,000 commonly used words are used as the initial keyword set; then the initial keyword set is traversed to search for small programs, and the collected small program names, IDs, and description information are stored in the database; secondly, keywords are continuously extracted and filtered from the retrieved small program names and descriptions and filled into the keyword set for subsequent small program retrieval and collection. The above process is repeated until the number of small programs to be tested in the database tends to be stable, and finally the names, IDs, and description information of small programs on the entire network are obtained for subsequent security testing.
[0072] In some embodiments, Figure 3As shown in the figure, the mini program vulnerability dynamic detection module based on policy self-optimization is used to achieve large-scale detection of common vulnerabilities in specific scenarios of mini programs. First, the specific scenario test task with common vulnerabilities is split into multiple subtasks, and a simple mini program dynamic test tool test strategy is written for each subtask. The test strategy here refers to the strategy of simulating which button to click on the mini program page to be tested and what content to fill in the input box, such as Figure 4 Then, each applet in the database is dynamically tested according to the current test strategy. After the test, it is determined whether the test is successful. If the test is successful, the vulnerability is determined based on the message intercepted by the HTTPS message interception tool to generate a detection report. If a subtask test fails, all controls (including buttons, input boxes, etc.) on the corresponding failed subtask page are sent to the large language model, allowing the large language model to infer and generate a new test strategy. The dynamic test tool test strategy is optimized according to the new test strategy generated by the large language model, as shown in the figure. Figure 4 When the authorization login page test of the current mini program fails, all the control information of the authorization login page is sent to the large language model to let the large language model infer what strategy should be executed. The large language model outputs that the "User One-Click Login" button on the current page should be clicked, and then the strategy of the mini program dynamic testing tool is automatically optimized. Figure 4 As shown in the figure, a branch is added to the switch branch, indicating that if the test page contains a button control named "User One-Click Login", the control can be successfully tested by clicking it. Repeat the above steps, and through the testing of large-scale, complex and diverse mini-programs in the database in turn, the dynamic testing strategy is continuously and automatically optimized to obtain a nearly perfect dynamic testing strategy for specific scenarios, and finally it can realize vulnerability detection for large-scale, complex and diverse WeChat mini-programs.
[0073] In some embodiments, vulnerability detection can determine and detect common vulnerabilities in specific scenarios of mini-programs. According to the characteristics of common vulnerabilities, messages with corresponding characteristics are matched from intercepted HTTPS messages, and HTTP messages with vulnerability characteristics are extracted by writing regular expressions, and finally a vulnerability report is output.
[0074] Take the authorization login scenario with common vulnerabilities as an example. When performing large-scale collection of mini-programs based on keyword enhancement, first jump to: / / resourceid / AppletDiscover / app.html# / search / 'keywords' to obtain the mini-programs obtained by the initial keyword search. The name and description information of the mini-programs are processed by natural language processing technologies such as word segmentation to obtain new keywords. Continue to search, and finally retrieve the massive mini-programs collected, and store the massive mini-program information in the database.
[0075] For the authorized login scenario with common vulnerabilities, the authorized login scenario test task is first split into subtasks such as "unified privacy agreement", "skip entry advertisement", "agree to application address", ..., "enter my account", and "authorized login". Then, based on pywinauto, each subtask is simulated and run in turn. Taking the "enter my account" subtask as an example, the initial strategy is: if the page control contains "my" and "personal center", then click the corresponding control. When testing a new applet later, if the control does not contain title="my" or title="personal center", the "enter my account" subtask fails. Pywinauto is used to extract all control information of the test failure page and send it to the large language model to ask which control should be clicked for the correct test strategy. The large language model replies to click title="me". Then optimize the test strategy and automatically optimize it into a test strategy.
[0076] In the subsequent dynamic testing process for each applet in the database, the test strategy of each subtask is continuously optimized and improved. The optimized test strategy finally obtained can adapt to the specific business scenarios of large-scale applet and realize the efficient detection of common vulnerabilities in specific business scenarios. Vulnerability detection uses regular expressions to match vulnerability features in intercepted HTTP messages and make vulnerability judgments.
[0077] It can be seen that the large-scale dynamic detection method of mini-program vulnerabilities disclosed in the present invention can collect massive mini-programs on the Internet, and can perform large-scale, highly adaptable, effective dynamic detection of specific business scenarios with common vulnerabilities.
[0078] First, common preceding words are searched to collect mini-programs. Then, natural language processing techniques such as word segmentation are used on the retrieved mini-program names and descriptions to extract and filter out a new batch of keywords for further search. The above process is repeated to achieve massive collection of mini-programs.
[0079] Strategy self-optimization is a key step of the present invention. By testing the mini-programs in the database one by one, continuously testing the complex and diverse mini-programs, supplementing and optimizing the test strategy, a test strategy that can adapt to almost all mini-programs is obtained, and finally highly adaptive dynamic testing of large-scale mini-programs in specific business scenarios can be achieved.
[0080] The second aspect of the present invention discloses a large-scale dynamic detection system for mini-program vulnerabilities based on policy self-optimization, the system comprising:
[0081] The first processing unit is configured to: collect a number of mini-programs through keyword retrieval, store the collected mini-program related information in a mini-program database to be tested, and dynamically update the keyword set;
[0082] The second processing unit is configured to: divide the specific scenario test task with common vulnerabilities into a plurality of subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-program corresponding to the associated information in the mini-program database to be tested based on the plurality of subtasks;
[0083] The third processing unit is configured to: generate a vulnerability detection report according to the vulnerability detection results, and dynamically optimize the testing strategy of the mini-program dynamic testing tool.
[0084] According to the system of the second aspect of the present invention, the first processing unit is specifically configured as follows:
[0085] Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching;
[0086] Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program;
[0087] New keywords are filtered out from the name and description information of the mini-program, and the filtered out new keywords are added to the keyword set to dynamically update the keyword set.
[0088] According to the system of the second aspect of the present invention, the second processing unit is specifically configured as follows:
[0089] Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks;
[0090] Call the applet dynamic testing tool to execute:
[0091] The mini program corresponding to the associated information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included:
[0092] Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message.
[0093] According to the system of the second aspect of the present invention, the third processing unit is specifically configured to: obtain a message intercepted by the HTTPS interception tool, and match the characteristics of the common vulnerability in the message; wherein:
[0094] If the match is successful, the test is successful; further generate a vulnerability detection report;
[0095] If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
[0096] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the large-scale dynamic detection method for small program vulnerabilities based on policy self-optimization described in the first aspect of the present disclosure is implemented.
[0097] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization described in the first aspect of the present disclosure.
[0098] In summary, this method firstly alleviates the limitation that the mini-program search function can only obtain a small number of related mini-programs in a single search through a large-scale collection method of mini-programs based on keyword enhancement, continuously extracts new keywords based on the search results, and enhances the keyword set for subsequent search and collection. Secondly, this method uses a mini-program vulnerability dynamic detection method based on policy self-optimization to perform large-scale detection of common vulnerabilities in specific scenarios. On the basis of the initial strategy, each mini-program in the collected mini-program database is tested in turn, and the test strategy is continuously optimized during the test process to improve the adaptability to large-scale, complex and diverse mini-program dynamic testing.
[0099] The present invention achieves the following technical effects: (1) By using the method, a large amount of mini-program data sets on the Internet can be obtained, which can be used for subsequent large-scale detection; (2) By using the method, the test strategy of a certain business scenario can be continuously and automatically optimized by testing the collected mini-programs in sequence; (3) By using the method, high-adaptability and large-scale vulnerability detection can be achieved for business scenarios containing a certain common vulnerability.
[0100] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization, characterized in that: The method comprises: Step S1, collect a number of mini-programs through keyword search, store the collected mini-program related information in the mini-program database to be tested, and dynamically update the keyword set; Wherein, in step S1: Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching; Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program; Filter out new keywords from the name and description information of the mini-program, and add the filtered out new keywords to the keyword set to dynamically update the keyword set; Step S2: Divide the specific scenario test task with common vulnerabilities into several subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-programs corresponding to the associated information in the mini-program database to be tested based on the several subtasks; Wherein, in step S2: Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks; Call the applet dynamic testing tool to execute: The mini program corresponding to the related information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included: Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message; Step S3: Generate a vulnerability detection report based on the vulnerability detection results, and dynamically optimize the testing strategy of the mini program dynamic testing tool.
2. According to claim 1, a large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization is characterized in that: In step S3: obtaining the message intercepted by the HTTPS interception tool, and matching the characteristics of the common vulnerability in the message; wherein: If the match is successful, the test is successful; further generate a vulnerability detection report; If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
3. A large-scale dynamic detection system for small program vulnerabilities based on policy self-optimization, characterized in that: The system comprises: The first processing unit is configured to: collect a number of mini-programs through keyword retrieval, store the collected mini-program related information in a mini-program database to be tested, and dynamically update the keyword set; Wherein, the first processing unit is specifically configured as follows: Construct a keyword set, traverse each keyword in the keyword set that has not been searched, and collect several mini-programs through searching; Extracting the collected mini-program related information and storing the related information in the mini-program database to be tested, wherein the related information includes the name, ID, and description information of the mini-program; Filter out new keywords from the name and description information of the mini-program, and add the filtered out new keywords to the keyword set to dynamically update the keyword set; The second processing unit is configured to: divide the specific scenario test task with common vulnerabilities into a plurality of subtasks, call the mini-program dynamic test tool, and perform vulnerability detection on the mini-program corresponding to the associated information in the mini-program database to be tested based on the plurality of subtasks; Wherein, the second processing unit is specifically configured as follows: Obtain a specific scenario test task with a common vulnerability, and divide the specific scenario test task into a plurality of subtasks; Call the applet dynamic testing tool to execute: The mini program corresponding to the related information in the mini program database to be tested is used as the mini program to be tested, and vulnerability detection is performed on each mini program to be tested in turn; specifically, the following steps are included: Based on the automation tool pywinauto, each subtask is simulated and run in sequence according to the test strategies in the pre-built test strategy set to perform dynamic testing of specific business scenarios of the mini program, and the HTTPS interception tool is used to intercept the message; The third processing unit is configured to: generate a vulnerability detection report according to the vulnerability detection results, and dynamically optimize the testing strategy of the mini-program dynamic testing tool.
4. According to claim 3, a system for large-scale dynamic detection of small program vulnerabilities based on policy self-optimization is characterized in that: The third processing unit is specifically configured to: obtain a message intercepted by the HTTPS interception tool, and match the characteristics of the common vulnerability in the message; wherein: If the match is successful, the test is successful; further generate a vulnerability detection report; If the match is unsuccessful, the test fails; obtain the control information of the subtask page of the current test, send the control information to the large language model LLM, and the large language model LLM generates a new test strategy based on the control information, and adds the new test strategy to the test strategy set to dynamically optimize the test strategy of the mini program dynamic testing tool.
5. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization as described in any one of claims 1-2.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the large-scale dynamic detection method for mini-program vulnerabilities based on policy self-optimization as described in any one of claims 1-2.
Citation Information
Patent Citations
LLM Agent-based Web application vulnerability dynamic detection method and system
CN118761060A