CN-122027268-A - Vulnerability detection method, electronic device, medium and computer program product
Abstract
The embodiment discloses a vulnerability detection method, electronic equipment, a medium and a computer program product, wherein the vulnerability detection method comprises the steps of obtaining first webpage information of a target webpage, processing the first webpage information through a detection model to determine an attack position and an attack mode of a vulnerability of the target webpage, processing the attack position and the attack mode through the detection model to generate a target detection script of the target webpage, wherein the target detection script is used for carrying out vulnerability attack on the target webpage, and carrying out vulnerability detection on the target webpage based on the target detection script.
Inventors
- SHEN XIAOLIANG
- CHEN XIWEI
- Yan Dongrong
Assignees
- 中移(苏州)软件技术有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260204
Claims (10)
- 1. A vulnerability detection method, the method comprising: Acquiring first webpage information of a target webpage, wherein the first webpage information comprises interaction characteristics and a protection mechanism of the target webpage; processing the first webpage information through a detection model, and determining an attack position and an attack mode of the vulnerability of the target webpage; Processing the attack position and the attack mode through the detection model to generate a target detection script for the target webpage, wherein the target detection script is used for carrying out vulnerability attack on the target webpage; and performing vulnerability detection on the target webpage based on the target detection script.
- 2. The method of claim 1, wherein the first web page information further comprises a front end frame of the target web page, wherein the processing the first web page information through the detection model determines an attack location and an attack pattern for a vulnerability of the target web page, comprising: processing the interaction characteristics through a detection model, and determining the attack position of the vulnerability of the target webpage; And processing one or more of the protection mechanism and the front-end framework through the detection model, and determining an attack mode of the vulnerability of the target webpage.
- 3. The method of claim 1, wherein the obtaining the first web page information of the target web page comprises: Acquiring asynchronous request data of a target webpage; determining interaction characteristics of the target webpage based on the asynchronous request data; and obtaining first webpage information of the target webpage based on the interaction characteristics and a protection mechanism of the target webpage.
- 4. The method of claim 1, wherein the obtaining the first web page information of the target web page comprises: Acquiring webpage elements in the target webpage and element relations among the webpage elements; Detecting the webpage elements and the element relation in real time to acquire the update information of the target webpage; And acquiring first webpage information of the target webpage based on the updated information.
- 5. The method of claim 1, wherein prior to processing the first web page information by the detection model, the method further comprises: The method comprises the steps of acquiring a training data set, wherein the training data set comprises an attack script sample and second webpage information, and the second webpage information comprises interaction characteristics and a protection mechanism of a first webpage corresponding to the attack script sample; And carrying out model training on the first model based on the training data set to obtain a detection model.
- 6. The method of claim 5, wherein the model training the first model based on the training dataset comprises: processing the training data set based on a first model to obtain a prediction detection script; Performing vulnerability detection on at least two webpages based on the prediction detection script, wherein the at least two webpages comprise webpages of at least two different browsers; and under the condition that the leak detection of the predictive detection script on each webpage in the at least two webpages is successful, forward rewarding is carried out on the first model.
- 7. The method of claim 5, wherein the second web page information further comprises one or more of a logical architectural feature of the first web page, a front end frame feature of the first web page, a historical vulnerability feature of the first web page.
- 8. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, wherein, The processor is configured to run the computer program to perform the method of any of claims 1 to 7.
- 9. A computer storage medium having stored thereon a computer program, which when executed by a processor implements the method of any of claims 1 to 7.
- 10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 7.
Description
Vulnerability detection method, electronic device, medium and computer program product Technical Field The application belongs to the technical field of network security, and particularly relates to a vulnerability detection method, electronic equipment, a medium and a computer program product. Background In the field of network security, vulnerability detection is an important means for guaranteeing system security. Cross-site scripting attack (Cross-SITE SCRIPTING, XSS) is one of common webpage security vulnerabilities, and is usually used for influencing the behavior of a user terminal by injecting malicious scripts, so that the problems of data leakage and the like are caused. Therefore, in network application testing, the method has important significance for detecting and protecting vulnerabilities such as XSS and the like. Currently commonly used attack detection tools, such as OWASP ZAP, rely on a preset rule base and known attack modes, and have limited capability of detecting attack scripts of unknown attack types. For example, if an attacker develops a brand new attack script that is not recorded, the existing attack detection tool cannot identify or generate relevant detection scripts, and the efficiency and accuracy of vulnerability detection are low. Disclosure of Invention The embodiment of the application provides a vulnerability detection method, electronic equipment, a medium and a computer program product, which can generate differentiated detection scripts for different webpages through a detection model, improve the accuracy of vulnerability detection and effectively identify vulnerabilities. The embodiment of the application provides a vulnerability detection method, which comprises the following steps: Acquiring first webpage information of a target webpage, wherein the first webpage information comprises interaction characteristics and a protection mechanism of the target webpage; processing the first webpage information through a detection model, and determining an attack position and an attack mode of the vulnerability of the target webpage; Processing the attack position and the attack mode through the detection model to generate a target detection script for the target webpage, wherein the target detection script is used for carrying out vulnerability attack on the target webpage; and performing vulnerability detection on the target webpage based on the target detection script. The embodiment of the application provides an electronic device, which comprises a processor and a memory for storing a computer program capable of running on the processor, wherein, The processor is configured to run the computer program to perform any of the vulnerability detection methods described above. An embodiment of the present application provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements any of the above-described vulnerability detection methods. An embodiment of the application provides a computer program product comprising a computer program which, when executed by a processor, implements any of the above vulnerability detection methods. The embodiment of the application provides a vulnerability detection method, electronic equipment, a medium and a computer program product, which are beneficial to obtaining differentiated target detection scripts for target websites through analysis and processing of a detection model by acquiring interaction characteristics and a protection mechanism of target webpages. Because the target detection script is generated based on the interaction characteristics and the protection mechanism of the target website, the target detection script can realize efficient and accurate vulnerability detection on the target webpage. The vulnerability detection method provided by the embodiment of the application realizes differentiated and automatic vulnerability detection on different webpages and remarkably improves the vulnerability detection efficiency and accuracy. Drawings FIG. 1 is a flowchart of a vulnerability detection method provided in an embodiment of the present application; FIG. 2 is a flowchart of another vulnerability detection method according to an embodiment of the present application; Fig. 3 is a schematic structural diagram of a leak detection apparatus according to an embodiment of the present application; fig. 4 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application. Detailed Description The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the s