Web application vulnerability dynamic detection method and system based on LLM Agent
By using an LLM Agent-based dynamic vulnerability detection system for web applications, web application business testing tasks are broken down and sub-tasks are simulated, solving the problem of low dynamic test coverage in existing technologies and achieving efficient vulnerability detection for complex and diverse business scenarios.
Patent Information
- Application Number
- CN202411221167.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Existing web application vulnerability detection methods are ill-suited for dynamically rendered JavaScript web applications, resulting in low dynamic test coverage and an inability to conduct in-depth testing of diverse and complex business scenarios.
A dynamic vulnerability detection system for web applications based on LLM Agent is adopted, which includes a business test task decomposition module, a subtask simulation execution module, a result reflection module, and a vulnerability detection module. It uses a multimodal large language model to decompose web application business test tasks, intercepts request and response messages through an HTTP proxy, and generates vulnerability reports.
It enables high-coverage and in-depth testing of complex and diverse business scenarios, improving the efficiency and accuracy of web application vulnerability detection.
Smart Images

Figure CN118761060B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vulnerability detection, and in particular relates to a method and system for dynamic detection of Web application vulnerabilities based on LLM Agent. Background Art
[0002] Web applications have a large number of security vulnerabilities. Once maliciously exploited by attackers, they will cause serious damage to information security and property security. Through research, it is found that most Web application vulnerabilities usually occur in typical businesses such as posting comments, uploading avatars, uploading plug-ins or theme compression packages, background file management and editing, scheduled task configuration, and website template editing. Dynamic testing is an effective way to detect security vulnerabilities in such business scenarios. However, due to the diversity and complexity of Web applications, the business implementation of each application may have its own unique business logic. Traditional dynamic testing methods extract URLs from the front-end code of Web applications and hard-code dynamic testing strategies into a limited set of rules. They cannot adapt to the encrypted and obfuscated front-end JavaScript code of modern Web applications and the diverse and complex business logic of Web applications, resulting in the inability to implement in-depth testing of different business scenarios of different Web applications.
[0003] In the prior art, the vulnerability attack detection for cross-site scripting in Web applications generally crawls the source code of the front end of the Web page, extracts the URL from it, then traverses each extracted URL to splice the corresponding attack payload in the XSS attack dictionary library, sends a simulated request to the target server, and determines whether there is an XSS attack vulnerability based on the returned information. However, currently a large number of Web application front ends are implemented using JavaScript to dynamically render the Web application front-end interface. The front-end code only has the path information of the loaded JavaScript code and does not contain URL links. In addition, in order to prevent the website from being maliciously analyzed, a large number of Web applications use complex encryption and obfuscation algorithms to process the front-end code. It is difficult to extract URL links simply from the front-end code of the Web application.
[0004] In the prior art, for dynamic crawlers that adapt to JavaScript dynamic rendering of web pages, JavaScript code is injected, event registration functions are called, and JavaScript-defined events (input form, click, etc.) are collected, and these events are triggered by hard-coded rules to perform dynamic testing of Web applications. However, this method hard-codes a limited set of rules, and for various Web application business scenarios, the order of simulating the filling of input content and executing multiple events may be illegal, making it difficult to perform subsequent in-depth testing. Summary of the invention
[0005] The present invention proposes a dynamic detection scheme for Web application vulnerabilities based on LLM Agent, aiming to solve the problems that the dynamic test coverage depth of existing Web application vulnerability detection methods is low and difficult to adapt to various complex Web business scenarios.
[0006] The first aspect of the present invention discloses a method for dynamic detection of Web application vulnerabilities based on LLM Agent.
[0007] The method uses a Web application vulnerability dynamic detection system built based on LLM Agent technology to perform dynamic detection of Web application vulnerabilities. LLM Agent refers to a large language model agent. The Web application vulnerability dynamic detection system includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module.
[0008] The method specifically comprises:
[0009] Step S1: calling a business test task decomposition module, and using a multimodal large language model to decompose a Web application business test task to be tested into multiple subtasks that can be executed step by step;
[0010] Step S2, calling the business test subtask simulation execution module, based on the LLM Agent calling execution tool to sequentially simulate and execute the multiple subtasks that can be executed step by step, and intercepting HTTP request and response messages through the HTTP proxy during the execution process;
[0011] Step S3: calling the business test result reflection module, and using the multimodal large language model to analyze the execution results of the multiple subtasks that can be executed step by step, so as to determine the test result of the Web application business test task;
[0012] Wherein, when the test result is that the test is unsuccessful, the Web application business test task to be tested is re-disassembled and / or a plurality of subtasks that can be executed step by step are re-executed until the test result is successful;
[0013] Step S4: calling the vulnerability detection module to detect messages with vulnerability characteristics from the HTTP request and response messages intercepted by the HTTP proxy, and generating a vulnerability report based on the messages with vulnerability characteristics.
[0014] According to the method of the first aspect of the present invention, in step S1, the business test task disassembly module is called to specifically perform:
[0015] Get the front-end code and page screenshots corresponding to the web application business test scenario page to be tested;
[0016] Constructing prompt words for a multimodal large language model;
[0017] Input the front-end code, page screenshots, and the format expected to be output by the multimodal large language model into the multimodal large language model;
[0018] The multimodal large language model outputs multiple subtasks that can be executed step by step for vulnerability detection of Web application services.
[0019] According to the method of the first aspect of the present invention, in step S2, the business test subtask simulation execution module is called to specifically execute:
[0020] Generate codes for simulating the execution of the plurality of subtasks that can be executed step by step by using a multimodal large language model;
[0021] Build an agent program on the client side;
[0022] Calling Python or JavaScript as an execution tool, and sequentially executing the codes generated by the multimodal large language model based on the LLM Agent technology, thereby simulating the execution of the multiple subtasks that can be executed step by step;
[0023] During the simulation execution process, the HTTP request and response messages transmitted between the client and the server are intercepted by the HTTP proxy.
[0024] According to the method of the first aspect of the present invention, in step S3, the business test result reflection module is called to specifically perform:
[0025] After executing the multiple subtasks that can be executed step by step, obtaining the front-end code and page screenshots corresponding to the Web application business test scenario page again;
[0026] Reconstruct the prompt words of the multimodal large language model;
[0027] The front-end code and page screenshots obtained again are input into the multimodal large language model, and the multimodal large language model outputs the test results of the Web application business test task.
[0028] According to the method of the first aspect of the present invention, in step S4, the vulnerability detection module is called to specifically perform:
[0029] Get the HTTP request and response messages intercepted by the HTTP proxy;
[0030] Match the HTTP request and response messages with standard vulnerabilities, including file upload vulnerabilities, cross-site scripting execution vulnerabilities, and sensitive information leakage vulnerabilities;
[0031] The message with the vulnerability feature is extracted by compiling a regular expression, and a vulnerability report is generated based on the message with the vulnerability feature.
[0032] The second aspect of the present invention discloses a Web application vulnerability dynamic detection system based on LLM Agent.
[0033] The Web application vulnerability dynamic detection system is built based on LLM Agent technology and is used to perform dynamic detection of Web application vulnerabilities. The Web application vulnerability dynamic detection system includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module.
[0034] The business test task decomposition module is configured to: decompose the Web application business test task to be tested into multiple subtasks that can be executed step by step by using a multimodal large language model;
[0035] The business test subtask simulation execution module is configured to: simulate and execute the multiple subtasks that can be executed step by step in sequence based on the LLM Agent calling execution tool, and intercept HTTP request and response messages through the HTTP proxy during the execution process;
[0036] The business test result reflection module is configured to: analyze the execution results of the plurality of subtasks that can be executed step by step using a multimodal large language model to determine the test result of the Web application business test task;
[0037] Wherein, when the test result is that the test is unsuccessful, the business test task disassembly module re-disassembles the Web application business test task to be tested and / or the business test subtask simulation execution module re-executes multiple subtasks that can be executed step by step until the test result is successful;
[0038] The vulnerability detection module is configured to detect messages with vulnerability characteristics from HTTP request and response messages intercepted by the proxy, and generate a vulnerability report based on the messages with vulnerability characteristics.
[0039] The third aspect of the present invention discloses an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for dynamically detecting Web application vulnerabilities based on LLM Agent described in the first aspect of the present disclosure is implemented.
[0040] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for dynamically detecting Web application vulnerabilities based on LLM Agent described in the first aspect of the present disclosure is implemented.
[0041] In summary, the present invention targets business scenarios that are prone to security vulnerabilities, and based on a multimodal large language model, adaptively explores the implementation logic of different business scenarios, intelligently plans efficient testing strategies, implements high coverage depth testing of complex and diverse business logic, and effectively detects security vulnerabilities in Web applications. The technical effects brought by the present invention include: (1) Using the method, the test task of a given business scenario can be split into smaller manageable test subtasks, so that the test tasks of complex business scenarios can be effectively handled; (2) Using the method, self-criticism and self-reflection can be performed on the dynamic test results of Web applications, and learning from erroneous dynamic test results can be improved in subsequent steps, thereby improving the quality of the final dynamic test results; (3) Using the method, high coverage depth testing can be implemented for various business scenarios, improving the efficiency of vulnerability detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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.
[0043] Figure 1 A schematic diagram of a process of dynamic detection of Web application vulnerabilities based on LLM Agent according to an embodiment of the present invention;
[0044] Figure 2 A logical schematic diagram of a business test task disassembly module according to an embodiment of the present invention;
[0045] Figure 3 A logical schematic diagram of a business test subtask simulation execution module according to an embodiment of the present invention;
[0046] Figure 4 It is a logical schematic diagram of a business test result reflection module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] 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.
[0048] The first aspect of the present invention discloses a method for dynamic detection of Web application vulnerabilities based on LLM Agent.
[0049] The method uses a Web application vulnerability dynamic detection system built based on LLM Agent technology to perform dynamic detection of Web application vulnerabilities. LLM Agent refers to a large language model agent. The Web application vulnerability dynamic detection system includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module.
[0050] The method specifically comprises:
[0051] Step S1: calling a business test task decomposition module, and using a multimodal large language model to decompose a Web application business test task to be tested into multiple subtasks that can be executed step by step;
[0052] Step S2, calling the business test subtask simulation execution module, based on the LLM Agent calling execution tool to sequentially simulate and execute the multiple subtasks that can be executed step by step, and intercepting HTTP request and response messages through the HTTP proxy during the execution process;
[0053] Step S3: calling the business test result reflection module, and using the multimodal large language model to analyze the execution results of the multiple subtasks that can be executed step by step, so as to determine the test result of the Web application business test task;
[0054] Wherein, when the test result is that the test is unsuccessful, the Web application business test task to be tested is re-disassembled and / or a plurality of subtasks that can be executed step by step are re-executed until the test result is successful;
[0055] Step S4: calling the vulnerability detection module to detect messages with vulnerability characteristics from the HTTP request and response messages intercepted by the HTTP proxy, and generating a vulnerability report based on the messages with vulnerability characteristics.
[0056] According to the method of the first aspect of the present invention, in step S1, the business test task disassembly module is called to specifically perform:
[0057] Get the front-end code and page screenshots corresponding to the web application business test scenario page to be tested;
[0058] Constructing prompt words for a multimodal large language model;
[0059] Input the front-end code, page screenshots, and the format expected to be output by the multimodal large language model into the multimodal large language model;
[0060] The multimodal large language model outputs multiple subtasks that can be executed step by step for vulnerability detection of Web application services.
[0061] According to the method of the first aspect of the present invention, in step S2, the business test subtask simulation execution module is called to specifically execute:
[0062] Generate codes for simulating the execution of the plurality of subtasks that can be executed step by step by using a multimodal large language model;
[0063] Build an agent program on the client side;
[0064] Calling Python or JavaScript as an execution tool, and sequentially executing the codes generated by the multimodal large language model based on the LLM Agent technology, thereby simulating the execution of the multiple subtasks that can be executed step by step;
[0065] During the simulation execution process, the HTTP request and response messages transmitted between the client and the server are intercepted by the HTTP proxy.
[0066] According to the method of the first aspect of the present invention, in step S3, the business test result reflection module is called to specifically perform:
[0067] After executing the multiple subtasks that can be executed step by step, obtaining the front-end code and page screenshots corresponding to the Web application business test scenario page again;
[0068] Reconstruct the prompt words of the multimodal large language model;
[0069] The front-end code and page screenshots obtained again are input into the multimodal large language model, and the multimodal large language model outputs the test results of the Web application business test task.
[0070] According to the method of the first aspect of the present invention, in step S4, the vulnerability detection module is called to specifically perform:
[0071] Get the HTTP request and response messages intercepted by the HTTP proxy;
[0072] Match the HTTP request and response messages with standard vulnerabilities, including file upload vulnerabilities, cross-site scripting execution vulnerabilities, and sensitive information leakage vulnerabilities;
[0073] The message with the vulnerability feature is extracted by compiling a regular expression, and a vulnerability report is generated based on the message with the vulnerability feature.
[0074] First embodiment
[0075] like Figure 1 As shown in the figure, the dynamic detection of Web application vulnerabilities based on LLM Agent is mainly implemented by using four modules: Web application business test task decomposition, business test subtask simulation execution, business test result reflection and vulnerability detection.
[0076] First, the business test task decomposition module uses a multimodal large language model to decompose the business scenario test task of the Web application to be tested into multiple subtasks that can be executed step by step; then the business test subtask simulation execution module uses the LLMAgent technology call tool to simulate the execution of these subtasks in sequence, and intercepts HTTP request and response messages through the proxy during the execution process; secondly, the business test result reflection module uses a multimodal large language model to judge whether the corresponding business scenario test task is successful based on the results after the execution of the subtask, and whether it needs to be retested or re-decomposed; finally, the vulnerability detection module matches the HTTP messages with vulnerability features from the HTTP messages intercepted by the proxy, and outputs a vulnerability report.
[0077] (1) Business test task decomposition module
[0078] The business test task decomposition module proposed in this method decomposes the test tasks of the business scenario to be tested into manageable subtasks. Figure 2 As shown, first obtain the front-end code and main page screenshot corresponding to the main page of the Web application business scenario to be tested; then construct the prompt word (prompt) of the multimodal large language model, input the front-end code, main page screenshot and the format expected to be output by the multimodal large language model to the multimodal large language model, and ask the multimodal large language model to perform a test subtask of vulnerability detection for this business scenario; finally, the multimodal large language model outputs a test subtask of vulnerability detection for a given business.
[0079] (2) Business test subtask simulation execution module
[0080] The business test subtask simulation execution module proposed in this method executes the subtask sequence output by the previous module in sequence based on the LLM Agent technology. Figure 3 As shown, first, the large language model is queried in turn to generate codes that can simulate the execution of each subtask; then a proxy program is built on the client to intercept HTTP messages between the client and the server; finally, Python or JavaScript is called to execute the codes output by the large language model in turn to complete the disassembled subtasks.
[0081] (3) Business test result reflection module
[0082] The business test result reflection module proposed in this method judges and reflects on the results of subtask execution and decides on subsequent test strategies. Figure 4As shown, first obtain the front-end code and page screenshots of the Web application page after the test is completed; then construct the prompt word (prompt) of the multimodal large language model, input the front-end code and page screenshots of the Web page into the multimodal large language model, and ask the multimodal large language model whether the above test results have successfully completed the test of the business to be tested, and whether it needs to be retested or the subtasks need to be re-disassembled.
[0083] (4) Vulnerability detection module
[0084] The vulnerability detection module proposed in this method performs vulnerability detection on the business scenarios of the Web application to be tested. First, the HTTP messages intercepted by the proxy program during the test are collected, and then the messages with vulnerability characteristics in the HTTP messages are matched, such as common file upload vulnerabilities, cross-site scripting vulnerabilities (XSS), and sensitive information leakage vulnerabilities. The HTTP messages with vulnerability characteristics are extracted by writing regular expressions, and finally the vulnerability report is output.
[0085] Second embodiment
[0086] This embodiment is for vulnerability detection of the product review service published by an application.
[0087] (1) Decomposition of the test task for publishing product reviews
[0088] First, build the application on the virtual machine; then open the web application homepage, write a script to obtain the front-end code and capture the web application homepage image; then input the front-end code and screenshots into the multimodal large language model, and ask the multimodal large language model how to disassemble the product review business scenario test task. The disassembly process needs to be based on the prompt words. Based on the received screenshots and front-end codes, the multimodal large language model uses the thinking chain technology to infer the sub-task sequence of the test product review business scenario.
[0089] (2) Simulate execution of the product review business test subtask
[0090] Simulate and execute each subtask output in the previous step in sequence. First, send each subtask description to the multimodal large language model, and ask the multimodal large language model to generate a script code that can simulate the execution of each subtask. The multimodal large language model outputs a python script. Executing this python script code can successfully simulate the execution. Continuously execute the simulation execution script corresponding to each subtask, and a test of the vulnerability detection of the product review business of the Web application is completed.
[0091] (3) Reflection on the test results of publishing product reviews
[0092] Reflect on the results of the subtask simulation execution for the product review business scenario test and decide on the subsequent test strategy. Input the front-end code and page screenshots of the web page after the test into the multimodal large language model. For the page screenshots, the page display input must meet at least 50 characters.
[0093] The multimodal large language model infers whether the execution of the current subtask sequence has successfully completed the test based on the front-end code and screenshots of the test completion web page, and whether the task needs to be replanned and disassembled. The multimodal large language model successfully infers that the current posting comment business test subtask has failed based on the written prompt words, and replans the subtask. This process is then repeated until the test for the posting product review business vulnerability detection is successfully completed.
[0094] (4) Vulnerability Detection
[0095] After the business scenario test of all the Web applications to be tested is completed, regular expressions are used to match vulnerability features in the intercepted HTTP messages. For example, for XSS vulnerabilities, match whether the HTTP response message contains the input feature string; for file upload vulnerabilities, match whether the HTTP request message contains the upload request features, such as Multipart / Form-Data is a specific format field used to encode uploaded file data in a POST request, and the MIME type represents the uploaded document type field; for sensitive information leakage vulnerabilities, regular expressions are used to match whether the response message contains privacy information.
[0096] It can be seen that the goal of the above method is to: given complex and diverse Web business scenarios, be able to implement high coverage in-depth testing for given business scenarios and improve the efficiency of Web application vulnerability detection. In order to achieve the above goal, the main technical improvements of the method described in the present invention include:
[0097] (1) Web application business testing task decomposition technology based on thinking chain
[0098] Web application business test task decomposition is an important step of the present invention, which provides a basis for subsequent business scenario high coverage depth testing. Chain-of-Thought (CoT) is a method for designing prompts, which includes intermediate steps of reasoning (intermediate thinking). Chain-of-Thought technology can greatly enhance the ability of large language models, so that some difficult problems can be solved without any model update. Through the chain-of-thought technology, similar prompts such as "Please reason step by step and draw conclusions", "Please let us think step by step" or "What to execute first, then what to execute, what to execute second, and what to execute last" are added to the prompt, which greatly improves the Web application business test task decomposition capability of the large language model.
[0099] (2) Web application business test subtask simulation execution technology based on LLM Agent
[0100] The simulation execution of Web application business test subtasks is a key step of the present invention. LLM Agent mainly uses the reasoning, learning and planning capabilities of the large model, combined with function calls to implement tool use. LLM Agent technology is used to disassemble the subtask sequence obtained by the business test task module, and the script code that can execute the subtask is generated in sequence using the large language model, and then Python or JavaScript is called to execute the generated script code in sequence to realize the simulation execution of the subtask.
[0101] The second aspect of the present invention discloses a Web application vulnerability dynamic detection system based on LLM Agent.
[0102] The Web application vulnerability dynamic detection system is built based on LLM Agent technology and is used to perform dynamic detection of Web application vulnerabilities. LLM Agent refers to a large language model agent. The Web application vulnerability dynamic detection system includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module.
[0103] The business test task decomposition module is configured to: decompose the Web application business test task to be tested into multiple subtasks that can be executed step by step by using a multimodal large language model;
[0104] The business test subtask simulation execution module is configured to: simulate and execute the multiple subtasks that can be executed step by step in sequence based on the LLM Agent calling execution tool, and intercept HTTP request and response messages through the HTTP proxy during the execution process;
[0105] The business test result reflection module is configured to: analyze the execution results of the plurality of subtasks that can be executed step by step using a multimodal large language model to determine the test result of the Web application business test task;
[0106] Wherein, when the test result is that the test is unsuccessful, the business test task disassembly module re-disassembles the Web application business test task to be tested and / or the business test subtask simulation execution module re-executes multiple subtasks that can be executed step by step until the test result is successful;
[0107] The vulnerability detection module is configured to: call the vulnerability detection module, detect messages with vulnerability characteristics from HTTP request and response messages intercepted by the HTTP proxy, and generate a vulnerability report based on the messages with vulnerability characteristics.
[0108] The third aspect of the present invention discloses an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for dynamically detecting Web application vulnerabilities based on LLM Agent described in the first aspect of the present disclosure is implemented.
[0109] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for dynamically detecting Web application vulnerabilities based on LLM Agent described in the first aspect of the present disclosure is implemented.
[0110] In summary, the present invention targets business scenarios that are prone to security vulnerabilities, and based on a multimodal large language model, adaptively explores the implementation logic of different business scenarios, intelligently plans efficient testing strategies, implements high coverage depth testing of complex and diverse business logic, and effectively detects security vulnerabilities in Web applications. The technical effects brought by the present invention include: (1) Using the method, the test task of a given business scenario can be split into smaller manageable test subtasks, so that the test tasks of complex business scenarios can be effectively handled; (2) Using the method, self-criticism and self-reflection can be performed on the dynamic test results of Web applications, and learning from erroneous dynamic test results can be improved in subsequent steps, thereby improving the quality of the final dynamic test results; (3) Using the method, high coverage depth testing can be implemented for various business scenarios, improving the efficiency of vulnerability detection.
[0111] 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. 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 present application shall be based on the attached claims.
Claims
1. A method for dynamic detection of Web application vulnerabilities based on LLM Agent, characterized in that: The method uses a dynamic detection system for Web application vulnerabilities built based on LLM Agent technology to perform dynamic detection of Web application vulnerabilities. LLM Agent refers to a large language model agent. The dynamic detection system for Web application vulnerabilities includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module. The method specifically comprises: Step S1: calling a business test task decomposition module, and using a multimodal large language model to decompose a Web application business test task to be tested into multiple subtasks that can be executed step by step; Step S2, calling the business test subtask simulation execution module, based on the LLM Agent calling execution tool to sequentially simulate and execute the multiple subtasks that can be executed step by step, and intercepting HTTP request and response messages through the HTTP proxy during the execution process; Step S3: calling the business test result reflection module, and using the multimodal large language model to analyze the execution results of the multiple subtasks that can be executed step by step, so as to determine the test result of the Web application business test task; Wherein, when the test result is that the test is unsuccessful, the Web application business test task to be tested is re-disassembled or a plurality of subtasks that can be executed step by step are re-executed until the test result is successful; Step S4: calling the vulnerability detection module to detect messages with vulnerability characteristics from the HTTP request and response messages intercepted by the HTTP proxy, and generating a vulnerability report based on the messages with vulnerability characteristics.
2. According to claim 1, a method for dynamic detection of Web application vulnerabilities based on LLM Agent is characterized in that: In step S1, the business test task disassembly module is called to specifically perform: Get the front-end code and page screenshots corresponding to the web application business test scenario page to be tested; Constructing prompt words for a multimodal large language model; Input the front-end code, page screenshots, and the format expected to be output by the multimodal large language model into the multimodal large language model; The multimodal large language model outputs multiple subtasks that can be executed step by step for vulnerability detection of Web application services.
3. According to claim 2, a method for dynamic detection of Web application vulnerabilities based on LLM Agent is characterized in that: In step S2, the business test subtask simulation execution module is called to specifically execute: Generate codes for simulating the execution of the plurality of subtasks that can be executed step by step by using a multimodal large language model; Build an agent program on the client side; Calling Python or JavaScript as an execution tool, and sequentially executing the codes generated by the multimodal large language model based on the LLM Agent technology, thereby simulating the execution of the multiple subtasks that can be executed step by step; During the simulation execution process, the HTTP request and response messages transmitted between the client and the server are intercepted by the HTTP proxy.
4. According to claim 3, a method for dynamic detection of Web application vulnerabilities based on LLM Agent is characterized in that: In step S3, the business test result reflection module is called to specifically perform: After executing the multiple subtasks that can be executed step by step, obtaining the front-end code and page screenshots corresponding to the Web application business test scenario page again; Reconstruct the prompt words of the multimodal large language model; The front-end code and page screenshots obtained again are input into the multimodal large language model, and the multimodal large language model outputs the test results of the Web application business test task.
5. According to claim 4, a method for dynamic detection of Web application vulnerabilities based on LLM Agent is characterized in that: In step S4, the vulnerability detection module is called to specifically perform: Get the HTTP request and response messages intercepted by the HTTP proxy; Match the HTTP request and response messages with standard vulnerabilities, including file upload vulnerabilities, cross-site scripting execution vulnerabilities, and sensitive information leakage vulnerabilities; The message with the vulnerability feature is extracted by compiling a regular expression, and a vulnerability report is generated based on the message with the vulnerability feature.
6. A dynamic detection system for Web application vulnerabilities based on LLM Agent, characterized by: The Web application vulnerability dynamic detection system is constructed based on LLM Agent technology and is used to perform dynamic detection of Web application vulnerabilities. LLM Agent refers to a large language model agent. The Web application vulnerability dynamic detection system includes a business test task decomposition module, a business test subtask simulation execution module, a business test result reflection module, and a vulnerability detection module; wherein: The business test task decomposition module is configured to: decompose the Web application business test task to be tested into multiple subtasks that can be executed step by step by using a multimodal large language model; The business test subtask simulation execution module is configured to: simulate and execute the multiple subtasks that can be executed step by step in sequence based on the LLM Agent calling execution tool, and execute these subtasks based on the LLM Agent technology, and intercept HTTP request and response messages through the agent during the execution process; The business test result reflection module is configured to: analyze the execution results of the plurality of subtasks that can be executed step by step using a multimodal large language model to determine the test result of the Web application business test task; Wherein, when the test result is that the test is unsuccessful, the business test task disassembly module re-disassembles the Web application business test task to be tested and / or the business test subtask simulation execution module re-executes multiple subtasks that can be executed step by step until the test result is successful; The vulnerability detection module is configured to: call the vulnerability detection module, detect messages with vulnerability characteristics from HTTP request and response messages intercepted by the HTTP proxy, and generate a vulnerability report based on the messages with vulnerability characteristics.
7. 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, the method for dynamic detection of Web application vulnerabilities based on LLM Agent according to any one of claims 1 to 5 is implemented.
8. 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 a processor, the method for dynamic detection of Web application vulnerabilities based on LLMAgent according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Honeycomb vulnerability generation method based on large language model
CN117610026A
Network security vulnerability scanning method, device and system, medium and electronic equipment
CN118157957A
Automatic red team attack simulation method and device based on large model application framework LangChain
CN118503968A
Method for software vulnerability flow analysis, generation of vulnerability-covering code, and multi-generation of functionally-equivalent code
US20110126288A1
Code Coverage Detection with Scriptable Language Unmodified Source
US20130232473A1
