Vulnerability detection method, device and equipment
By determining the target scanning rules and tools according to the page type, and automatically splitting the functional elements of the page for vulnerability detection, the problem of low vulnerability detection efficiency in the existing technology is solved, and an efficient and automated vulnerability detection process is realized.
Patent Information
- Application Number
- CN202410707691.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-24
AI Technical Summary
The efficiency of vulnerability detection in the existing technology is low, mainly due to the inefficiency of manual splitting of page functional elements, resulting in limited vulnerability detection efficiency.
By determining the target scanning rules according to the page type of the page to be detected, automatically splitting the functional elements of the page, and using the corresponding vulnerability detection tools for detection, the automation of vulnerability detection is realized.
It improves the efficiency and accuracy of vulnerability detection, saves computer resources compared to manual splitting, and realizes the automated process of vulnerability detection.
Smart Images

Figure CN118690368A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a vulnerability detection method, device and equipment. Background Art
[0002] With the rapid development of computer technology and Internet technology, the development of pages that can realize various functions has greatly facilitated users to use functions to achieve corresponding purposes. For example, in a query page, users can enter the keywords they want to query to initiate a query, and correspondingly, the corresponding query results will be fed back to the user for the user to view.
[0003] In actual applications, due to various reasons such as development, there may be vulnerabilities (such as injection vulnerabilities, etc.) in the page. Once there is a vulnerability, there will be certain risks and hazards in the process of using the page to implement the corresponding functions, such as data leakage, permission tampering, etc. In this regard, the page can usually be tested for vulnerabilities to verify whether there are vulnerabilities in the page. Once the vulnerability is detected, it can be repaired in time. In actual applications, the page may include page function elements. The page function elements may refer to elements used to carry the page function points of the page. For example, in the query page, the page function elements may include input boxes, query buttons, etc. Usually, when using the page, it can be based on the page function elements to interact, so as to realize the corresponding functions. Therefore, the corresponding page function elements can be disassembled from the page, and then the vulnerability detection can be performed.
[0004] In the related art, manual splitting is usually adopted to disassemble the corresponding page functional elements from the page. However, the manual splitting method has problems such as low efficiency, which makes the vulnerability detection efficiency low. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a vulnerability detection method, device and equipment, which are conducive to improving the efficiency of vulnerability detection.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a vulnerability detection method, the method comprising:
[0008] Get the page to be tested;
[0009] Determining a target scanning rule corresponding to the page to be detected according to the page type of the page to be detected;
[0010] Scanning the page to be detected based on the target scanning rule to obtain page function elements included in the page to be detected;
[0011] Perform vulnerability detection on the functional elements of the page.
[0012] On the other hand, an embodiment of the present application provides a vulnerability detection device, the device comprising an acquisition unit, a determination unit, a scanning unit and a detection unit:
[0013] The acquisition unit is used to acquire the page to be detected;
[0014] The determining unit is used to determine the target scanning rule corresponding to the page to be detected according to the page type of the page to be detected;
[0015] The scanning unit is used to scan the page to be detected based on the target scanning rule to obtain the page function elements included in the page to be detected;
[0016] The detection unit is used to perform vulnerability detection on the page functional elements.
[0017] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0018] The memory is used to store program code and transmit the program code to the processor;
[0019] The processor is used to execute the vulnerability detection method described in the above aspects according to the instructions in the program code.
[0020] It can be seen from the above technical solution that for the page to be detected, the target scanning rule corresponding to the page to be detected can be determined according to the page type of the page to be detected, wherein the page type can indicate what type of page to be detected is, and specifically can indicate which page function elements that may have vulnerability risks may exist in the page to be detected, so the target scanning rule determined according to the page type is adapted to the page to be detected that needs to be detected at present. Specifically, the target scanning rule can be used to indicate how to scan pages of this page type. Then, based on the target scanning rule, the page to be detected can be scanned to obtain the page function elements included in the page to be detected. The page function element can refer to an element used to carry the page function point of the page to be detected. Once the page function element has a vulnerability, it will cause risks and harm when the page function point is actually used. Finally, the page function element can be tested for vulnerabilities to determine whether the page to be detected has vulnerabilities, etc. It can be seen that the target scanning rule can be determined based on the page type, and the page function element can be split out based on the target scanning rule, which provides a way to automatically split the page function element, which is conducive to improving the efficiency of vulnerability detection compared to the manual splitting method used in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A flowchart of a vulnerability detection method provided in an embodiment of the present application;
[0023] Figure 2 An architecture diagram of a vulnerability detection system provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a data storage structure provided in an embodiment of the present application;
[0025] Figure 4 A flow chart of page scanning provided in an embodiment of the present application;
[0026] Figure 5 A flowchart of vulnerability matching and vulnerability detection provided in an embodiment of the present application;
[0027] Figure 6 A flowchart of a newly added scanning rule provided in an embodiment of the present application;
[0028] Figure 7 A flowchart of modifying scanning rules provided in an embodiment of the present application;
[0029] Figure 8 A flowchart of a newly added matching rule provided in an embodiment of the present application;
[0030] Fig. 9 A flowchart for modifying matching rules provided in an embodiment of the present application;
[0031] Fig.10 A structural diagram of a vulnerability detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0033] The vulnerability detection method provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, etc. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.
[0034] The specific examples are as follows:
[0035] Figure 1 A flowchart of a vulnerability detection method provided in an embodiment of the present application is provided, and a server is used as an example for explanation. The method includes S101-S104:
[0036] S101: Obtain a page to be detected.
[0037] S102: Determine a target scanning rule corresponding to the page to be detected according to the page type of the page to be detected.
[0038] When vulnerability detection is required, the server may obtain a page to be detected, which may be a page that needs to be detected, for example, a query page.
[0039] In actual applications, different types of pages are often used to implement different functions, that is, the page functional points are different, and accordingly, the page functional elements included in the page for carrying the page functional points will be different. It can be understood that accurately disassembling the page functional elements from the page to be detected is conducive to more accurate vulnerability detection.
[0040] In this regard, first, the target scanning rule corresponding to the page to be detected can be determined according to the page type of the page to be detected, wherein the page type can indicate what type of page to be detected is, and specifically can indicate which page functional elements that may have vulnerability risks may exist in the page to be detected. Therefore, the target scanning rule determined according to the page type is adapted to the page to be detected that currently needs to be detected. Specifically, the target scanning rule can be used to indicate how to scan pages of this page type to disassemble the page functional elements included in the page to be detected.
[0041] In a possible implementation, the target scanning rule can be used to indicate the target element included in the page corresponding to the page type. The target element can refer to the page function element that may have vulnerabilities in the page of the page type. The target element can be summarized and sorted by the engineering staff based on the historical vulnerability situation. Correspondingly, the target scanning rule can be configured by the engineering staff. On this basis, the page function elements that may have vulnerabilities included in the page to be detected can be disassembled more quickly, the disassembly efficiency can be improved, and then it is conducive to improving the vulnerability detection efficiency.
[0042] It should be noted that the present application does not impose any limitation on how to determine the target scanning rule. For ease of understanding, the present application provides the following method as an example:
[0043] In a possible implementation, the page type of the page to be detected can be determined first according to the page address of the page to be detected and the page identifier of the page to be detected. The page address can be, for example, the Uniform Resource Locator (URL) of the page to be detected, and the page identifier can be the ID of the page to be detected. Then, based on the page type, a scanning rule matching the page type can be obtained from the scanning rule table as a target scanning rule. Based on this, the target scanning rule can be quickly obtained according to the page type.
[0044] Among them, the scanning rule table can store pre-configured scanning rules, which can be scanning rules configured by engineering personnel (such as administrators) for various types of pages based on historical vulnerability situations. For example, the aforementioned target elements can be configured for each type of page to generate corresponding scanning rules.
[0045] S103: Scan the page to be detected based on the target scanning rule to obtain page function elements included in the page to be detected.
[0046] After determining the target scanning rules, the page to be detected can be scanned based on the target scanning rules to obtain the page function elements included in the page to be detected. The page function elements can refer to elements used to carry the page function points of the page to be detected. Once there are vulnerabilities in the page function elements, when the page to be detected is actually used to implement the corresponding functions, there will be certain risks and hazards, such as data leakage, permission tampering, etc.
[0047] It should be noted that this application does not make any limitation on how to scan to obtain page functional elements. For ease of understanding, taking the aforementioned target scanning rule used to indicate the target elements included in the page corresponding to the page type as an example, this embodiment of the application provides the following method as an example:
[0048] Among them, the target element may refer to a page function element in a page of this page type that may have vulnerabilities. For example, taking a page whose page type is a query type as an example, the target element may include an input box, a query button, etc. In a specific implementation, the page to be detected can be scanned to obtain elements in the page to be detected that match the target element as page function elements. Based on this, the page function elements obtained by disassembly can be considered as those elements in the page to be detected that may have vulnerabilities. Subsequently, by performing vulnerability detection on the page function elements, the vulnerability detection of the page to be detected can be completed, which is conducive to improving the efficiency of vulnerability detection.
[0049] Specifically, in a possible implementation, the page to be detected can be decomposed into elements to obtain multiple initial elements included in the page to be detected. Among them, the initial element can refer to any element included in the page to be detected, and the multiple initial elements can refer to all elements included in the page to be detected, that is, a full-quantity scanning method. Then, for each of the multiple initial elements, if the element type of the initial element is the same as the element type of the target element, it can be determined that the initial element matches the target element. Finally, the initial element that matches the target element can be determined as a page functional element.
[0050] In actual applications, a page may include multiple initial elements, and the elements that may have vulnerabilities may only be a part of them. Therefore, through the above method, the part that may have vulnerabilities can be screened from multiple initial elements as page functional elements, which is conducive to improving vulnerability detection efficiency and saving computer resources.
[0051] Usually, after the scan is completed and the page functional elements are extracted, they can be saved in the scan results. When vulnerability detection is required later, the page functional elements can be obtained from the scan results for vulnerability detection. In addition, a scan report can be generated to more intuitively display the scan situation.
[0052] S104: Perform vulnerability detection on page functional elements.
[0053] After the page functional elements are disassembled, vulnerability detection can be performed on the page functional elements to determine whether there are vulnerabilities in the page to be detected.
[0054] It should be noted that this application does not make any limitation on how to perform vulnerability detection on page functional elements. For ease of understanding, this application embodiment provides the following methods as examples:
[0055] In actual applications, different types of elements may have different types of vulnerabilities, and different types of vulnerabilities usually require calling different vulnerability detection tools when detecting whether they exist. Therefore, in a possible implementation method, the type of vulnerability to be detected corresponding to the page function element can be determined according to the element type of the page function element. Among them, the element type can indicate the type of the page function element (such as it can indicate what function the page function element is used to implement), and the type of vulnerability to be detected can refer to the type of vulnerability that may exist in the page function element. Then, a vulnerability detection tool that matches the type of vulnerability to be detected can be obtained, and the vulnerability detection tool can be used to perform vulnerability detection on the page function element. Based on this, vulnerability detection can be performed using a vulnerability detection tool that is compatible with the possible vulnerabilities, thereby improving the accuracy of vulnerability detection.
[0056] The present application does not limit the method of obtaining the vulnerability detection tool. For ease of understanding, the present application provides the following method as an example:
[0057] In a possible implementation, for each of the multiple initial detection tools, a matching key-value pair between the vulnerability type to be detected and the initial detection tool can be generated. The initial detection tool can be a tool included in the detection tool library for detecting vulnerabilities, and different initial detection tools are suitable for detecting different types of vulnerabilities, and the matching logic value of the matching key-value pair is used to indicate whether the vulnerability type to be detected matches the initial detection tool. Then, according to the matching logic value of the matching key-value pair, the initial detection tool that matches the vulnerability type to be detected can be determined as a vulnerability detection tool. Based on this, tools that can be used to detect vulnerabilities of the vulnerability type to be detected are screened from the initial detection tools, so as to more accurately detect whether there are corresponding vulnerabilities in the page functional elements.
[0058] In actual applications, the function method may be automatically called to generate the aforementioned matching key-value pairs, which may be in the form of key-value json data. The matching logic value may be in the form of 0 or 1, where 0 may indicate no match and 1 may indicate a match. Then, the matching logic value may be used to determine whether the match occurs, and the matching ones may be selected as the aforementioned vulnerability detection tool. On the other hand, the verification rules may be pre-configured to indicate which type of vulnerability requires which tool to be called for vulnerability detection. In actual applications, the verification rules may be the database field data entered by the front end, or the uploaded jar package with the specified class name and method, etc.
[0059] In order to improve the efficiency of vulnerability detection, in another possible implementation, it is also possible to determine whether the vulnerability detection corresponding to the page function element has been completed based on the vulnerability detection record and the element identifier of the page function element. Among them, the vulnerability detection record can be used to indicate the progress of the vulnerability detection of the page function element included in the page to be detected. If it is determined that the vulnerability detection corresponding to the page function element is not completed, at this time, the vulnerability detection tool can be used to perform vulnerability detection on the page function element. Based on this, for those that have completed the vulnerability detection, the vulnerability detection will not be repeated, which is conducive to improving the efficiency of vulnerability detection and avoiding the waste of computing resources.
[0060] In practical applications, in order to more intuitively understand the vulnerability detection results, in a possible implementation method, the vulnerability detection results obtained based on the vulnerability detection can also be obtained. The vulnerability detection results can be used to indicate whether the page functional elements have vulnerabilities belonging to the vulnerability type to be detected. Then, a vulnerability detection report corresponding to the page to be detected can be generated based on the vulnerability detection results. In this way, the managers, developers, operation and maintenance personnel of the page to be detected can more intuitively understand the vulnerability detection results, and based on the vulnerability detection report, it is convenient for other personnel to understand the vulnerability situation.
[0061] It can be seen from the above technical solution that for the page to be detected, the target scanning rule corresponding to the page to be detected can be determined according to the page type of the page to be detected, wherein the page type can indicate what type of page to be detected is, and specifically can indicate which page function elements that may have vulnerability risks may exist in the page to be detected, so the target scanning rule determined according to the page type is adapted to the page to be detected that needs to be detected at present. Specifically, the target scanning rule can be used to indicate how to scan pages of this page type. Then, based on the target scanning rule, the page to be detected can be scanned to obtain the page function elements included in the page to be detected. The page function element can refer to an element used to carry the page function point of the page to be detected. Once the page function element has a vulnerability, it will cause risks and harm when the page function point is actually used. Finally, the page function element can be tested for vulnerabilities to determine whether the page to be detected has vulnerabilities, etc. It can be seen that the target scanning rule can be determined based on the page type, and the page function element can be split out based on the target scanning rule, which provides a way to automatically split the page function element, which is conducive to improving the efficiency of vulnerability detection compared to the manual splitting method used in the related art.
[0062] At the same time, it also provides automated vulnerability type matching, and then calls the corresponding vulnerability detection tool to perform vulnerability detection, thereby realizing the automation of the entire vulnerability detection process. Compared with the related art, after manually splitting the page functional elements, manually judging what element type it is, what type of vulnerability may exist, and then manually selecting the test tool to perform vulnerability detection, the use of this application can improve the efficiency of vulnerability detection.
[0063] For better understanding, the present application also provides a vulnerability detection system. Figure 2 As shown, Figure 2 The following is an architecture diagram of a vulnerability detection system. The vulnerability detection system can be divided into three layers: the bottom layer is the data storage layer, the middle layer is the business processing layer, and the upper layer is the front-end interaction layer. Specifically:
[0064] exist Figure 2 In the vulnerability detection system shown, the bottom layer is data storage, which is mainly responsible for storing data related to vulnerability detection. Specifically, it may include an operating environment, a database and a data layer. In the operating environment layer, it may include a configured independent server, a third-party virtual host, a cloud host, etc., which is a related configuration of a computer device for implementing vulnerability detection of this application. The database layer may include various databases, such as My SQL, Ms SQL, Oracle, etc. The data layer can be used to interact with the basic module and the database to implement related services for data (such as data acquisition, data storage, etc.). Among them, the data may be, for example, the aforementioned scanning rules, verification rules, etc.
[0065] For data storage, see Figure 3 As shown, Figure 3 A schematic diagram of a data storage structure is shown, which may specifically include a scan rule table (which can be used to store scan rules), a scan element table (which can be used to store scan results), a matching rule table (which can be used to store matching rules between vulnerability types and page functional elements), a vulnerability detection matching table (which can be used to store vulnerability type matching results), a vulnerability penetration test matching table (which can be used to store matching rules between vulnerability types and vulnerability detection tools), a matching result table (which can be used to store matching key-value pairs), an execution report table (which can be used to store various reports), a method permission set, and a user table.
[0066] exist Figure 2In the vulnerability detection system shown, the middle layer is the business processing layer, which may include a core module and a basic module. Among them, the core module includes a page scanning module, a page function element and vulnerability detection matching module, and a penetration test execution module. Specifically, the page scanning module can be used to execute the aforementioned steps S101-S103 to achieve the purpose of scanning to disassemble the page function elements. The page function element and vulnerability detection matching module can be used to execute the aforementioned steps of determining the type of vulnerability to be detected to achieve the purpose of vulnerability type matching. The penetration test execution module can be used to execute the aforementioned steps S104 to achieve the purpose of vulnerability detection.
[0067] In addition, the basic module includes a scanning rule management module, a matching rule management module, a system configuration module, a report management module, a system log, etc. Among them, the scanning rule management module can be used to manage the aforementioned scanning rule table to realize the management of each scanning rule. For example, when adding, deleting, modifying, and checking scanning rules, it is necessary to interact with the scanning rule management module. The report management module can be used to manage various reports, such as the aforementioned scanning reports and vulnerability detection reports. Specifically, the report management module can be responsible for generating corresponding scanning reports, matching reports, and vulnerability detection reports based on scanning results, matching results, and vulnerability detection results, as well as sending reports. In actual applications, the scanning report will be saved as a file in HTML format, which is in a table format. Specifically, it can be used to display scanning and matching rules, scanning and matching results, and failure reasons, and supports online preview, downloading, and email sending of the system.
[0068] For page scanning, see Figure 4 , Figure 4 A flow chart of page scanning is shown, and the details can be found in the detailed description of the above embodiment. Figure 4 It also shows that when the scan determines that there is no match, the result can be saved in the scan result table and marked with a mismatch label, so that relevant personnel (such as the administrator of the matching rule) can optimize and iterate the scan rule based on the part of the result marked with the mismatch label. In addition, during the scanning process, if there is a processing exception, an exception prompt can be thrown, and a compensation mechanism, that is, a rescanning mechanism, is provided.
[0069] For vulnerability matching and vulnerability detection, please refer to Figure 5 As shown, Figure 5A flow chart of vulnerability matching and vulnerability detection is shown. After starting, the matching rules can be entered first, that is, what kind of page function elements may have what kind of vulnerabilities. Then, it is determined whether the page function elements match the vulnerability detection, that is, the aforementioned determination of the corresponding vulnerability type to be detected. If it is determined to be no, it indicates that the vulnerability type to be detected has not been determined. At this time, the data can be set as unmatched. If it is indeed, it is determined whether the penetration test is executed. The penetration test can refer to the aforementioned vulnerability detection. If it is determined to be no, it indicates that it does not need to be executed, and it is determined that this type of penetration is not executed. If it is determined to be yes, it indicates that it needs to be executed, and the penetration test is executed. Then, it can be determined whether the execution is successful. When the execution fails, the penetration execution status can be set to failure, and it is determined to re-execute the penetration test. When the execution is successful, a report can be generated.
[0070] exist Figure 2 In the vulnerability detection system shown, the upper layer is the front-end interaction layer, which is mainly responsible for the interaction with the user. Specifically, it can include the acquisition of page function elements, the matching of page function elements with the vulnerability detection module, the execution of penetration test, and the sending of vulnerability detection and report. Among them, when vulnerability detection is needed, the user can upload the aforementioned page to be detected based on the function of obtaining the page function elements to trigger the detection. Based on the functions of matching the page function elements with the vulnerability detection module, executing the penetration test, and sending the vulnerability detection and report, the progress of the vulnerability detection can be fed back to the user in real time, so that the user can promptly understand what the possible vulnerabilities are, the execution of the vulnerability detection, and the vulnerability detection report, etc., which is conducive to improving the user experience.
[0071] In addition, a log recording module and a permission control module may also be included. Among them, the log recording module can be used to record system logs, such as recording the aforementioned vulnerability detection records. The permission control module can be used to be responsible for the permission management of the verification method set and the user. Among them, the verification method set may include the aforementioned various rules (such as the aforementioned scanning rules, verification rules, matching rules, etc.), based on permission management, to facilitate malicious tampering of the verification method set, etc. In practical applications, the verification method set and the user permission association table can be used to maintain the permissions of the user operation interface set, wherein the interface set may include, for example, a new interface, a modification interface, etc., so as to realize the corresponding new deletion and modification functions. In addition, user permissions can be divided into view only, add, execute, modify, administrator permissions, etc., and different permissions can perform different operations on the verification method set and the files therein.
[0072] For better understanding, the present application also provides the following examples for illustration:
[0073] First, we will explain the scanning rules by taking adding and modifying scanning rules as examples:
[0074] For new scanning rules, see Figure 6 As shown, Figure 6 A flowchart of a newly added scanning rule is shown, wherein: Figure 6 The newly added interface in the example may refer to that provided by the aforementioned scanning rule management module.
[0075] For modifying scanning rules, see Figure 7 As shown, Figure 7 A flow chart of modifying scanning rules is shown, wherein: Figure 7 The modification interface in the example may refer to the one provided by the aforementioned scanning rule management module, and the modified rule may refer to a new rule submitted by a user or a partial rule that modifies an existing scanning rule. Modifying scanning rules can generally be divided into data modification and iterative modification. Data modification can modify the expected value of the rule for the current version front end. Iterative modification refers to changes in the expected value of the rule in the normal iteration of the business. At this time, the original version of the rule will not be modified, but a new rule of the current version will be added.
[0076] In addition, regarding deletion rules and query rules, the deletion rule can refer to the logical deletion of the specified rule, and the query rule can refer to querying and obtaining the corresponding target scan results based on the specified page type, and returning the expected key-value parameters for rule verification. In actual applications, when users perform operations such as adding, deleting, modifying, and checking on the front end, they can enter them in the form of key-value pairs.
[0077] Next, we will take adding a new matching rule and modifying a matching rule as an example to explain the matching rules:
[0078] For new matching rules, see Figure 8 As shown, Figure 8 A flowchart of a newly added matching rule is shown, wherein: Figure 8 The newly added interface in the example may refer to that provided by the aforementioned matching rule management module.
[0079] For modifying the matching rules, see Fig. 9 As shown, Fig. 9 A flow chart of modifying matching rules is shown, wherein: Fig. 9 The matching modification interface in the example may refer to that provided by the aforementioned matching rule management module, and the matching modification rule may refer to a new rule submitted by a user or a partial rule modified from an existing matching rule.
[0080] It is understandable that the processing flow of adding, deleting, modifying and checking operations on matching rules is similar to that of adding, deleting, modifying and checking operations on scanning rules. The specific implementation method can also be found in the above introduction and will not be repeated here.
[0081] It can be understood that the processing flow and system architecture introduced in the above embodiments basically correspond to the method embodiments, so the relevant parts can refer to the partial description of the method embodiments.
[0082] Fig.10 This is a structural diagram of a vulnerability detection device provided in an embodiment of the present application, wherein the device includes an acquisition unit 1001, a determination unit 1002, a scanning unit 1003, and a detection unit 1004:
[0083] The acquisition unit 1001 is used to acquire a page to be detected;
[0084] The determining unit 1002 is used to determine a target scanning rule corresponding to the page to be detected according to the page type of the page to be detected;
[0085] The scanning unit 1003 is used to scan the page to be detected based on the target scanning rule to obtain the page function elements included in the page to be detected;
[0086] The detection unit 1004 is used to perform vulnerability detection on the page functional elements.
[0087] In a possible implementation, the detection unit is further used for:
[0088] Determine, according to the element type of the page function element, the type of vulnerability to be detected corresponding to the page function element;
[0089] Obtain a vulnerability detection tool that matches the vulnerability type to be detected;
[0090] The vulnerability detection tool is used to perform vulnerability detection on the page functional elements.
[0091] In a possible implementation manner, the acquiring unit is further configured to:
[0092] Acquire a vulnerability detection result obtained based on the vulnerability detection; the vulnerability detection result is used to indicate whether the page function element has a vulnerability belonging to the vulnerability type to be detected;
[0093] Generate a vulnerability detection report corresponding to the page to be detected according to the vulnerability detection result.
[0094] In a possible implementation manner, the acquiring unit is further configured to:
[0095] For each of the multiple initial detection tools, a matching key-value pair is generated between the vulnerability type to be detected and the initial detection tool; the matching logic value of the matching key-value pair is used to indicate whether the vulnerability type to be detected matches the initial detection tool;
[0096] According to the matching logic value of the matching key-value pair, an initial detection tool that matches the vulnerability type to be detected is determined as the vulnerability detection tool.
[0097] In a possible implementation, the detection unit is further used for:
[0098] Determining whether the vulnerability detection corresponding to the page function element has been completed according to the vulnerability detection record and the element identifier of the page function element; the vulnerability detection record is used to indicate the vulnerability detection progress for the page function element included in the page to be detected;
[0099] If it is determined that the vulnerability detection corresponding to the page functional element is not completed, the vulnerability detection tool is used to perform vulnerability detection on the page functional element.
[0100] In a possible implementation manner, the target scanning rule is used to indicate a target element included in a page corresponding to the page type, and the scanning unit is further used to:
[0101] The page to be detected is scanned to obtain an element in the page to be detected that matches the target element as the page function element.
[0102] In a possible implementation, the scanning unit is further used for:
[0103] Decomposing the page to be detected into elements to obtain a plurality of initial elements included in the page to be detected;
[0104] For each initial element of the multiple initial elements, if the element type of the initial element is the same as the element type of the target element, determine that the initial element matches the target element;
[0105] An initial element matching the target element is determined as the page function element.
[0106] In a possible implementation manner, the determining unit is further configured to:
[0107] Determining the page type of the page to be detected according to the page address of the page to be detected and the page identifier of the page to be detected;
[0108] Based on the page type, a scan rule matching the page type is acquired from a scan rule table as the target scan rule.
[0109] It can be seen from the above technical solution that for the page to be detected, the target scanning rule corresponding to the page to be detected can be determined according to the page type of the page to be detected, wherein the page type can indicate what type of page to be detected is, and specifically can indicate which page function elements that may have vulnerability risks may exist in the page to be detected, so the target scanning rule determined according to the page type is adapted to the page to be detected that needs to be detected at present. Specifically, the target scanning rule can be used to indicate how to scan pages of this page type. Then, based on the target scanning rule, the page to be detected can be scanned to obtain the page function elements included in the page to be detected. The page function element can refer to an element used to carry the page function point of the page to be detected. Once the page function element has a vulnerability, it will cause risks and harm when the page function point is actually used. Finally, the page function element can be tested for vulnerabilities to determine whether the page to be detected has vulnerabilities, etc. It can be seen that the target scanning rule can be determined based on the page type, and the page function element can be split out based on the target scanning rule, which provides a way to automatically split the page function element, which is conducive to improving the efficiency of vulnerability detection compared to the manual splitting method used in the related art.
[0110] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0111] The memory is used to store program code and transmit the program code to the processor;
[0112] The processor is used to execute the vulnerability detection method provided by the above embodiment according to the instructions in the program code.
[0113] The computer device may include a terminal device or a server, and the aforementioned vulnerability detection apparatus may be configured in the computer device.
[0114] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, the above program can be stored in a computer-readable storage medium, and when the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program codes.
[0115] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0116] It should be noted that, in this article, relational terms such as "first" and "second", etc. (if any) are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0117] The above is a detailed introduction to a vulnerability detection method, device and equipment provided by the embodiments of the present application. The principles and implementation methods of the present application are described in detail using specific examples herein. The description of the above embodiments is only used to help understand the method of the present application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scopes according to the method of the present application.
[0118] In summary, the content of this specification should not be understood as limiting the present application, and any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in this application should be included in the protection scope of this application. Moreover, based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations.
Claims
1. A vulnerability detection method, characterized in that: The method comprises: Get the page to be tested; Determining a target scanning rule corresponding to the page to be detected according to the page type of the page to be detected; Scanning the page to be detected based on the target scanning rule to obtain page function elements included in the page to be detected; Perform vulnerability detection on the functional elements of the page.
2. The method according to claim 1, characterized in that The vulnerability detection of the page functional elements includes: Determine, according to the element type of the page function element, the type of vulnerability to be detected corresponding to the page function element; Obtain a vulnerability detection tool that matches the vulnerability type to be detected; The vulnerability detection tool is used to perform vulnerability detection on the page functional elements.
3. The method according to claim 2, characterized in that The method further comprises: Acquire a vulnerability detection result obtained based on the vulnerability detection; the vulnerability detection result is used to indicate whether the page function element has a vulnerability belonging to the vulnerability type to be detected; Generate a vulnerability detection report corresponding to the page to be detected according to the vulnerability detection result.
4. The method according to claim 2, characterized in that: The step of obtaining a vulnerability detection tool that matches the vulnerability type to be detected includes: For each of the multiple initial detection tools, a matching key-value pair is generated between the vulnerability type to be detected and the initial detection tool; the matching logic value of the matching key-value pair is used to indicate whether the vulnerability type to be detected matches the initial detection tool; According to the matching logic value of the matching key-value pair, an initial detection tool that matches the vulnerability type to be detected is determined as the vulnerability detection tool.
5. The method according to claim 2, characterized in that: The using the vulnerability detection tool to perform vulnerability detection on the page functional elements includes: Determining whether the vulnerability detection corresponding to the page function element has been completed according to the vulnerability detection record and the element identifier of the page function element; the vulnerability detection record is used to indicate the vulnerability detection progress for the page function element included in the page to be detected; If it is determined that the vulnerability detection corresponding to the page functional element is not completed, the vulnerability detection tool is used to perform vulnerability detection on the page functional element.
6. The method according to claim 1, characterized in that The target scanning rule is used to indicate the target element included in the page corresponding to the page type. The scanning of the page to be detected based on the target scanning rule to obtain the page function element included in the page to be detected includes: The page to be detected is scanned to obtain an element in the page to be detected that matches the target element as the page function element.
7. The method according to claim 6, characterized in that The scanning of the page to be detected to obtain an element in the page to be detected that matches the target element as the page function element includes: Decomposing the page to be detected into elements to obtain a plurality of initial elements included in the page to be detected; For each initial element of the multiple initial elements, if the element type of the initial element is the same as the element type of the target element, determine that the initial element matches the target element; An initial element matching the target element is determined as the page function element.
8. The method according to any one of claims 1 to 7, characterized in that: Determining a target scanning rule corresponding to the page to be detected according to the page type of the page to be detected includes: Determining the page type of the page to be detected according to the page address of the page to be detected and the page identifier of the page to be detected; Based on the page type, a scan rule matching the page type is acquired from a scan rule table as the target scan rule.
9. A vulnerability detection device, characterized in that: The device comprises an acquisition unit, a determination unit, a scanning unit and a detection unit: The acquisition unit is used to acquire the page to be detected; The determining unit is used to determine the target scanning rule corresponding to the page to be detected according to the page type of the page to be detected; The scanning unit is used to scan the page to be detected based on the target scanning rule to obtain the page function elements included in the page to be detected; The detection unit is used to perform vulnerability detection on the page functional elements.
10. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1 to 8 according to the instructions in the program code.
