Vulnerability detection method and device, medium and program product
By constructing target command execution requests and forging web access requests, monitoring and comparing command execution and permission access situations of web access requests, the problem of difficulty in detecting web security vulnerabilities in the prior art is solved, and the command execution vulnerability and permission access are realized Comprehensive detection and reporting of vulnerabilities have improved network security detection efficiency.
Patent Information
- Application Number
- CN202411114016.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-14
AI Technical Summary
It is difficult for the existing technology to comprehensively detect a variety of Web security vulnerabilities, especially command execution vulnerabilities and permission access vulnerabilities, which makes it difficult to effectively solve network security issues.
By obtaining the original web page access request and response from the user to the application server, constructing target command execution requests and forging web page access requests, monitoring command execution results and permission access comparisons, comprehensive detection of command execution vulnerabilities and permission access vulnerabilities is achieved.
It realizes comprehensive detection of a variety of Web security vulnerabilities, improves vulnerability detection efficiency, can accurately identify command execution vulnerabilities and permission access vulnerabilities, generate vulnerability detection reports, and meet actual business needs.
Smart Images

Figure CN119011258A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a vulnerability detection method, device, medium and program product. Background Art
[0002] With the widespread use of Web (World Wide Web) applications, network security issues have become increasingly prominent. For example, the server where the Web application is located does not strictly filter the execution commands entered by the user, resulting in command execution vulnerabilities such as unauthorized command execution vulnerabilities and authorized command execution vulnerabilities. In addition, the user access permission control policy in the Web application is defective, resulting in permission access vulnerabilities such as unauthorized access vulnerabilities and unauthorized access vulnerabilities.
[0003] However, at present, there is still a lack of effective detection methods for various Web security vulnerabilities such as command execution vulnerabilities and permission access vulnerabilities, making it difficult to comprehensively detect various Web security vulnerabilities. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a vulnerability detection method, device, medium and program product to achieve the technical effect of comprehensively detecting multiple Web security vulnerabilities.
[0005] In a first aspect, an embodiment of the present application provides a vulnerability detection method, including:
[0006] Obtaining an original webpage access request sent by a user to an application server, and an original webpage access response returned by the application server;
[0007] Sending a target command execution request to the application server, and monitoring the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding the target command to the original web page access request;
[0008] Determining whether the original webpage access request has a command execution vulnerability according to an execution result of the target command in the target command execution request;
[0009] Sending a forged web page access request to the application server, and receiving a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request;
[0010] According to the comparison result between the original webpage access response and the forged webpage access response, it is determined whether the original webpage access request has an access vulnerability.
[0011] In the above implementation process, by constructing a target command execution request and a forged web page access request based on the original web page access request, using the target command execution request to detect whether the original web page access request has a command execution vulnerability, and using the forged web page access request to detect whether the original web page access request has a permission access vulnerability, it is possible to comprehensively detect command execution vulnerabilities and permission access vulnerabilities and multiple Web security vulnerabilities.
[0012] Further, obtaining the original webpage access request sent by the user to the application server includes:
[0013] The original web page access request is captured through a proxy server.
[0014] In the above implementation process, by capturing the original web page access request through the proxy server, the client can automatically obtain the original web page access request to perform vulnerability detection, which is beneficial to improving the efficiency of vulnerability detection.
[0015] Furthermore, before sending the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request, it also includes:
[0016] In the case where the access resource in the original webpage access request is a static resource, adding the target command to the original webpage access request to obtain the target command execution request;
[0017] And / or, before sending the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server, the method further includes:
[0018] In the case where the access resource in the original web page access request is a static resource, the user identification information in the original web page access request is edited to obtain the forged web page access request.
[0019] In the above implementation process, by allowing vulnerability detection when the access resource in the original web page access request is a static resource, vulnerability detection can be strictly performed on static resources with lower security, avoiding missed or false positives.
[0020] Further, the target command includes a restart command;
[0021] The sending of the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request includes:
[0022] Sending the target command execution request to the application server, and using an Internet packet explorer ping to monitor the execution result of the target command in the target command execution request;
[0023] The step of determining whether the original webpage access request has a command execution vulnerability according to the execution result of the target command in the target command execution request includes:
[0024] In the case where the ping is interrupted, it is determined that the original web page access request has the command execution vulnerability.
[0025] In the above implementation process, by sending a target command execution request including a restart command to the application server, using ping to monitor the execution result of the restart command in the target command execution request, and in the case of ping interruption, determining whether the original web page access request has a command execution vulnerability, it is possible to conveniently and efficiently detect whether the original web page access request has a command execution vulnerability, which is conducive to further improving the efficiency of vulnerability detection.
[0026] Furthermore, the method further comprises:
[0027] After determining that the original webpage access request has the command execution vulnerability, sending an unauthorized command execution request to the application server, and monitoring the execution result of the target command in the unauthorized command execution request; wherein the unauthorized command execution request is obtained by deleting the user identification information in the target command execution request;
[0028] According to the execution result of the target command in the unauthorized command execution request, it is determined whether the command execution vulnerability is an unauthorized command execution vulnerability.
[0029] In the above implementation process, after determining that the original web page access request has a command execution vulnerability, an unauthorized command execution request is constructed based on the target command execution request, and the unauthorized command execution request is used to determine whether the command execution vulnerability is an unauthorized command execution vulnerability. This allows users to quickly determine the vulnerability type, which is beneficial to further improving vulnerability detection efficiency.
[0030] Further, the forged web page access request includes an unauthorized web page access request;
[0031] The sending of the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server includes:
[0032] Sending the unauthorized web page access request to the application server, and receiving the unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by modifying the user identification information in the original web page access request to the identification information of the unauthorized user;
[0033] The determining, based on the comparison result between the original webpage access response and the forged webpage access response, whether the original webpage access request has an access privilege vulnerability comprises:
[0034] When the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability.
[0035] In the above implementation process, by constructing an unauthorized web page access request according to the original web page access request, and using the unauthorized web page access request to detect whether the original web page access request has an unauthorized access vulnerability, the unauthorized access vulnerability can be detected quickly and accurately.
[0036] Further, the forged web page access request includes an unauthorized web page access request;
[0037] The sending of the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server includes:
[0038] Sending the unauthorized web page access request to the application server, and receiving an unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by deleting the user identification information in the original web page access request;
[0039] The determining, based on the comparison result between the original webpage access response and the forged webpage access response, whether the original webpage access request has an access privilege vulnerability comprises:
[0040] When the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability.
[0041] In the above implementation process, by constructing an unauthorized web page access request according to the original web page access request, and using the unauthorized web page access request to detect whether the original web page access request has an unauthorized access vulnerability, the unauthorized access vulnerability can be detected quickly and accurately.
[0042] Furthermore, the method further comprises:
[0043] In the case that the original webpage access request has the command execution vulnerability and / or the permission access vulnerability, a vulnerability detection report is generated.
[0044] In the above implementation process, by generating a vulnerability detection report when there is a command execution vulnerability and / or a permission access vulnerability in the original web page access request, the vulnerability detection report can be provided to the user to meet actual business needs.
[0045] In a second aspect, an embodiment of the present application provides a vulnerability detection device, including:
[0046] The original request response acquisition module is used to acquire the original web page access request sent by the user to the application server, and the original web page access response returned by the application server;
[0047] a target command execution processing module, used to send a target command execution request to the application server, and monitor the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding the target command to the original web page access request;
[0048] A command execution vulnerability detection module, used to determine whether the original web page access request has a command execution vulnerability according to the execution result of the target command;
[0049] a forged request response acquisition module, used to send a forged web page access request to the application server, and receive a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request;
[0050] The permission access vulnerability detection module is used to determine whether the original web page access request has a permission access vulnerability based on the comparison result between the original web page access response and the forged web page access response.
[0051] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and the processor implements the method described above when executing the computer program.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described above.
[0053] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions, and when the instructions are executed by a computer, the computer implements the method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A flowchart of a vulnerability detection method provided in the first embodiment of the present application;
[0056] Figure 2 This is a flow chart of a vulnerability detection method exemplified in the first embodiment of the present application;
[0057] Figure 3 A schematic diagram of the structure of a vulnerability detection device provided in the second embodiment of the present application;
[0058] Figure 4 A schematic diagram of the structure of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0060] It should be noted that in the description of this application, the terms "first", "second", etc. are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance. At the same time, the step numbers in the text are only for the convenience of explanation of the embodiments of this application and do not serve to limit the order in which the steps are executed. The method provided in the embodiments of this application can be executed by a related terminal device, and the following description will be taken as an example of the client as the execution subject.
[0061] For the convenience of description and to make the technical solutions in the embodiments of the present application easier to understand, before describing the methods provided in the embodiments of the present application, the terms involved in the embodiments of the present application are defined as follows:
[0062] Application server: refers to the server where the Web application is installed.
[0063] Command execution vulnerability: refers to the situation where the application server does not strictly filter the execution commands input by the user, so the attacker takes the opportunity to inject the execution command into the system command of the Web application for execution. Command execution vulnerability is one of the high-risk vulnerabilities. Command execution vulnerabilities are usually divided into authorized command execution vulnerabilities and unauthorized command execution vulnerabilities.
[0064] Unauthorized command execution vulnerability: refers to an attacker exploiting a security vulnerability in the system to execute commands while obtaining legitimate user permissions.
[0065] Unauthorized command execution vulnerability: refers to an attacker exploiting a security vulnerability in the system to execute commands without authorization.
[0066] Permission access vulnerability: refers to an attacker accessing resources that he or she is not authorized to access or performing unauthorized operations. Permission access vulnerabilities include unauthorized access vulnerabilities and unauthorized access vulnerabilities.
[0067] Unauthorized access vulnerability: refers to an attacker going beyond the scope of the current user's permissions to access or operate resources of other users or higher permissions. Unauthorized access vulnerabilities are generally divided into horizontal unauthorized access vulnerabilities and vertical unauthorized access vulnerabilities. Horizontal unauthorized access vulnerabilities occur between users at the same permission level. For example, a user may access the resources of other users at the same level in some way, such as viewing, modifying or deleting their data. Vertical unauthorized access vulnerabilities involve a low-privileged user trying to access or operate the resources of a high-privileged user. For example, a normal user tries to perform operations that only administrators can perform.
[0068] Unauthorized access vulnerability: refers to an attacker directly accessing or operating resources that require authentication and authorization without passing authentication and authorization.
[0069] Please see Figure 1 , Figure 1 The first embodiment of the present application provides a vulnerability detection method, which includes steps S101 to S105:
[0070] S101, obtaining an original webpage access request sent by a user to an application server, and an original webpage access response returned by the application server;
[0071] S102, sending a target command execution request to the application server, and monitoring the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding the target command to the original web page access request;
[0072] S103, determining whether the original webpage access request has a command execution vulnerability according to the execution result of the target command in the target command execution request;
[0073] S104, sending a forged web page access request to the application server, and receiving a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request;
[0074] S105: Determine whether the original web page access request has an access rights vulnerability based on a comparison result between the original web page access response and the forged web page access response.
[0075] As an example, according to actual application requirements, a user such as a super administrator can send an original web page access request to an application server through a client to request access to a resource of a Web application. For example, a user sends an HTTP (Hypertext Transfer Protocol) request to an application server through a Web browser on a client to request access to a resource of a Web application. The HTTP request is the original web page access request, and the web page address URL (Uniform Resource Locator) in the HTTP request is the access resource.
[0076] After the user sends an original webpage access request to the application server through the client, the client obtains the original webpage access request sent by the user to the application server, and obtains the original webpage access response returned by the application server in response to the original webpage access request.
[0077] After obtaining the original web page access request, the client adds a target command to the original web page access request to obtain a target command execution request.
[0078] In actual applications, the target command is a command commonly used by attackers. The target command can be added after the request parameters in the original web page access request to obtain the target command execution request.
[0079] After receiving the target command execution request, the client sends the target command execution request to the application server and monitors the execution result of the target command in the target command execution request. According to the execution result of the target command in the target command execution request, it is determined whether there is a command execution vulnerability in the original web page access request.
[0080] It can be understood that if the execution result of the target command in the target command execution request is successful execution of the target command, it is determined that the original web page access request has a command execution vulnerability; if the execution result of the target command in the target command execution request is failure to execute the target command, it is determined that the original web page access request does not have a command execution vulnerability.
[0081] After determining whether the original web page access request has a command execution vulnerability, the client continues to edit the user identification information in the original web page access request to obtain a forged web page access request.
[0082] In actual applications, the purpose of editing the user identification information in the original web page access request is to forge the original web page access request into a request for accessing the access resource without user authority. The cookie information in the original web page access request can be edited to obtain a forged web page access request.
[0083] It should be noted that cookie information refers to data stored on the client by the application server in order to identify the user and track the session (called "session control" in network applications). It is information temporarily or permanently saved by the client.
[0084] After receiving the forged web page access request, the client sends the forged web page access request to the application server, and receives the forged web page access response returned by the application server in response to the forged web page access request, compares the original web page access response with the forged web page access response, and determines whether the original web page access request has an access vulnerability based on the comparison result between the original web page access response and the forged web page access response.
[0085] It can be understood that if the original web page access response is the same as the forged web page access response, it is determined that the original web page access request has an access vulnerability; if the original web page access response is different from the forged web page access response, it is determined that the original web page access request does not have an access vulnerability.
[0086] By first detecting whether the original web page access request has a command execution vulnerability, and then detecting whether the original web page access request has a permission access vulnerability, command execution vulnerabilities with higher danger levels can be detected first, making it easier for users to take timely countermeasures.
[0087] In actual applications, it is also possible to simultaneously detect whether the original web page access request has a command execution vulnerability, and whether the original web page access request has a permission access vulnerability.
[0088] The embodiment of the present application constructs a target command execution request and a forged web page access request based on the original web page access request, uses the target command execution request to detect whether the original web page access request has a command execution vulnerability, and uses the forged web page access request to detect whether the original web page access request has a permission access vulnerability, thereby comprehensively detecting command execution vulnerabilities and permission access vulnerabilities and multiple Web security vulnerabilities.
[0089] In an optional embodiment, obtaining the original web page access request sent by the user to the application server includes: capturing the original web page access request through a proxy server.
[0090] As an exemplary embodiment, after the user sends an original webpage access request to the application server through the client, the client can capture the original webpage access request sent by the user to the application server through the proxy server between the client and the application server.
[0091] It is understandable that the client captures the original web page access request through the proxy server, and can automatically capture the original web page access request based on the proxy mechanism to perform vulnerability detection, so that the user can send the original web page access request on the client as usual without having to perform other additional operations on the client.
[0092] The embodiment of the present application can automatically obtain the original web page access request to perform vulnerability detection by having the client capture the original web page access request through the proxy server, which is beneficial to improving the efficiency of vulnerability detection.
[0093] In an optional embodiment, before sending the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request, it also includes: when the access resource in the original web page access request is a static resource, adding the target command to the original web page access request to obtain the target command execution request; and / or, before sending the forged web page access request to the application server and receiving the forged web page access response returned by the application server, it also includes: when the access resource in the original web page access request is a static resource, editing the user identification information in the original web page access request to obtain the forged web page access request.
[0094] As an example, if you choose to first detect whether the original web page access request has a command execution vulnerability and then detect whether the original web page access request has a permission access vulnerability, then after obtaining the original web page access request, the client first determines whether the access resource in the original web page access request is a static resource, and then, if the access resource in the original web page access request is a static resource, adds a target command to the original web page access request to obtain a target command execution request, and uses the target command execution request to detect whether the original web page access request has a command execution vulnerability; and after determining whether the original web page access request has a command execution vulnerability, since it has been determined that the access resource in the original web page access request is a static resource, the user identification information in the original web page access request is directly edited to obtain a forged web page access request, and the forged web page access request is used to detect whether the original web page access request has a permission access vulnerability; or if the access resource in the original web page access request is a dynamic resource, the vulnerability detection operation is ended.
[0095] If you choose to simultaneously detect whether the original web page access request has a command execution vulnerability and whether the original web page access request has a permission access vulnerability, then after obtaining the original web page access request, the client first determines whether the access resource in the original web page access request is a static resource, and then, if the access resource in the original web page access request is a static resource, adds a target command to the original web page access request to obtain a target command execution request, and uses the target command execution request to detect whether the original web page access request has a command execution vulnerability, and edits the user identification information in the original web page access request to obtain a forged web page access request, and uses the forged web page access request to detect whether the original web page access request has a permission access vulnerability; or, if the access resource in the original web page access request is a dynamic resource, ends the vulnerability detection operation.
[0096] If you choose to first detect whether the original web page access request has an access vulnerability, and then detect whether the original web page access request has a command execution vulnerability, then after obtaining the original web page access request, the client first determines whether the access resource in the original web page access request is a static resource, and then, if the access resource in the original web page access request is a static resource, edits the user identification information in the original web page access request to obtain a forged web page access request, and uses the forged web page access request to detect whether the original web page access request has an access vulnerability, and after determining whether the original web page access request has an access vulnerability, since it has been determined that the access resource in the original web page access request is a static resource, a target command is directly added to the original web page access request to obtain a target command execution request, and uses the target command execution request to detect whether the original web page access request has a command execution vulnerability; or if the access resource in the original web page access request is a dynamic resource, the vulnerability detection operation is ended.
[0097] It should be noted that, when the access resource in the original web page access request is a static resource, adding a target command to the original web page access request to obtain a target command execution request, and / or editing the user identification information in the original web page access request to obtain a forged web page access request, includes the following three situations: when the access resource in the original web page access request is a static resource, only adding a target command to the original access request to obtain a target command execution request; when the access resource in the original web page access request is a static resource, only editing the user identification information in the original web page access request to obtain a forged web page access request; when the access resource in the original web page access request is a static resource, adding a target command to the original access request to obtain a target command execution request, and editing the user identification information in the original web page access request to obtain a forged web page access request.
[0098] It is understandable that static resources refer to fixed data pre-stored on the application server, and dynamic resources refer to data dynamically generated by the application server according to the request. The security of dynamic resources is higher than that of static resources. The client is allowed to perform vulnerability detection only when the access resource in the original web page access request is a static resource. Vulnerability detection can be strictly performed on static resources with lower security to avoid missed or misjudged detection problems.
[0099] The embodiment of the present application allows vulnerability detection when the access resource in the original web page access request is a static resource, and can strictly perform vulnerability detection on static resources with lower security to avoid missed or false positives.
[0100] In an optional embodiment, the target command includes a restart command; sending a target command execution request to the application server and monitoring the execution result of the target command in the target command execution request includes: sending a target command execution request to the application server and using an Internet packet explorer ping to monitor the execution result of the target command in the target command execution request; determining whether the original web page access request has a command execution vulnerability based on the execution result of the target command in the target command execution request includes: in the event of a ping interruption, determining that the original web page access request has a command execution vulnerability.
[0101] As an exemplary example, considering that the restart command can be used to conveniently and efficiently detect whether the original web page access request has a command execution vulnerability, the restart command is selected so that the target command includes the restart command.
[0102] After obtaining the original web page access request, the client adds a target command including a restart command to the original web page access request, obtains the target command execution request, sends the target command execution request to the application server, and uses ping to monitor the execution result of the restart command in the target command execution request. In the case of ping interruption, it is considered that the execution of the restart command is successful, and it is determined that the original web page access request has a command execution vulnerability. Otherwise, it is considered that the execution of the restart command fails, and it is determined that the original web page access request does not have a command execution vulnerability.
[0103] It is understandable that since the restart command is used to restart the application server and ping is used to confirm whether a host on the Internet is reachable, ping is used to monitor the execution result of the restart command in the target command execution request. Once ping is interrupted, it means that the application server has been disconnected from the client to restart, which can conveniently and efficiently detect whether there is a command execution vulnerability in the original web page access request.
[0104] In actual applications, the restart command can be "`reboot`", ";reboot;", "$(reboot)", "|reboot" or other forms of statements. For each form of the restart command, the client adds the restart command after the request parameters in the original web page access request, obtains a target command execution request including the restart command, sends the target command execution request to the application server, and uses ping to monitor the execution result of the restart command to obtain the execution results of various forms of restart commands such as "`reboot`", ";reboot;", "$(reboot)" and "|reboot". According to the execution results of the various forms of the restart commands, it is determined whether the original web page access request has a command execution vulnerability. For example, if the execution result of any form of the restart command monitored by ping is ping interruption, it is determined that the original web page access request has a command execution vulnerability; otherwise, it is determined that the original web page access request does not have a command execution vulnerability.
[0105] The embodiment of the present application sends a target command execution request including a restart command to an application server, uses ping to monitor the execution result of the restart command in the target command execution request, and determines whether the original web page access request has a command execution vulnerability when ping is interrupted. This can conveniently and efficiently detect whether the original web page access request has a command execution vulnerability, which is conducive to further improving the efficiency of vulnerability detection.
[0106] In an optional embodiment, the method further includes steps S106 to S107:
[0107] S106, after determining that the original webpage access request has a command execution vulnerability, sending an unauthorized command execution request to the application server, and monitoring the execution result of the target command in the unauthorized command execution request; wherein the unauthorized command execution request is obtained by deleting the user identification information in the target command execution request;
[0108] S107: Determine whether the command execution vulnerability is an unauthorized command execution vulnerability according to the execution result of the target command in the unauthorized command execution request.
[0109] As an example, in order to further determine whether the command execution vulnerability existing in the original web page access request is an unauthorized command execution vulnerability, and to facilitate users to quickly determine the vulnerability type, after determining that the original web page access request has a command execution vulnerability, the client deletes the user identification information in the target command execution request, obtains the unauthorized command execution request, sends the unauthorized command execution request to the application server, and monitors the execution result of the target command in the unauthorized command execution request, and determines whether the command execution vulnerability is an unauthorized command execution vulnerability based on the execution result of the target command in the unauthorized command execution request.
[0110] In actual applications, the purpose of deleting the user identification information in the target command execution request is to forge the target command execution request into a target command execution request without any user authority. The cookie information in the target command execution request can be deleted to obtain an unauthorized command execution request.
[0111] In an optional implementation of the present embodiment, the target command includes a restart command; the sending of an unauthorized command execution request to the application server and monitoring the execution result of the target command in the unauthorized command execution request includes: sending an unauthorized command execution request to the application server and using ping to monitor the execution result of the target command in the unauthorized command execution request; determining whether the command execution vulnerability is an unauthorized command execution vulnerability based on the execution result of the target command in the unauthorized command execution request includes: in the event of a ping interruption, determining that the command execution vulnerability is an unauthorized command execution vulnerability.
[0112] As an example, after obtaining an unauthorized command execution request including a restart command, the client sends an unauthorized command execution request to the application server, uses ping to monitor the execution result of the restart command in the unauthorized command execution request, and if ping is interrupted, it is considered that the execution of the restart command is successful, and the command execution vulnerability is determined to be an unauthorized command execution vulnerability. Otherwise, it is considered that the execution of the restart command has failed, and the command execution vulnerability is determined to be an authorized command execution vulnerability.
[0113] It is understandable that since the restart command is used to restart the application server and ping is used to confirm whether a host on the Internet is reachable, ping is used to monitor the execution result of the restart command in the unauthorized command execution request. Once the ping is interrupted, it means that the application server has been disconnected from the client to restart, which can quickly and efficiently determine whether the command execution vulnerability is an unauthorized command execution vulnerability.
[0114] The embodiment of the present application, after determining that the original web page access request has a command execution vulnerability, continues to construct an unauthorized command execution request based on the target command execution request, and uses the unauthorized command execution request to determine whether the command execution vulnerability is an unauthorized command execution vulnerability. This can facilitate users to quickly determine the vulnerability type, which is beneficial to further improving vulnerability detection efficiency.
[0115] In an optional embodiment, the forged web page access request includes an unauthorized web page access request; the sending of the forged web page access request to the application server and receiving the forged web page access response returned by the application server includes: sending the unauthorized web page access request to the application server and receiving the unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by modifying the user identification information in the original web page access request to the identification information of an unauthorized user; the determining whether the original web page access request has an access vulnerability based on the comparison result of the original web page access response and the forged web page access response includes: determining that the original web page access request has an unauthorized access vulnerability when the original web page access response is the same as the unauthorized web page access response.
[0116] As an example, in order to detect whether there is an unauthorized access vulnerability in the original web page access request, the identification information of the unauthorized user, that is, the user without any user authority, is pre-configured. In actual application, the cookie information of the unauthorized user can be configured.
[0117] After obtaining the original web page access request, the client modifies the user identification information in the original web page access request into the identification information of the unauthorized user, obtains the unauthorized web page access request, sends the unauthorized web page access request to the application server, receives the unauthorized web page access response returned by the application server, compares the original web page access response with the unauthorized web page access response, and determines whether the original web page access request has an unauthorized access vulnerability based on the comparison result between the original web page access response and the unauthorized web page access response.
[0118] It is understandable that if the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability; if the original web page access response is different from the unauthorized web page access response, it is determined that the original web page access request does not have an unauthorized access vulnerability.
[0119] The embodiment of the present application constructs an unauthorized web page access request according to the original web page access request, and uses the unauthorized web page access request to detect whether the original web page access request has an unauthorized access vulnerability, thereby being able to quickly and accurately detect the unauthorized access vulnerability.
[0120] In an optional embodiment, the forged web page access request includes an unauthorized web page access request;
[0121] The method of sending a forged web page access request to an application server and receiving a forged web page access response returned by the application server includes: sending an unauthorized web page access request to an application server and receiving an unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by deleting user identification information in an original web page access request; and determining whether the original web page access request has an authority access vulnerability based on a comparison result between the original web page access response and the forged web page access response includes: determining that the original web page access request has an unauthorized access vulnerability when the original web page access response is the same as the unauthorized web page access response.
[0122] As an example, in order to detect whether the original web page access request has an unauthorized access vulnerability, after obtaining the original web page access request, the client deletes the user identification information in the original web page access request, obtains the unauthorized web page access request, sends the unauthorized web page access request to the application server, and receives the unauthorized web page access response returned by the application server, compares the original web page access response with the unauthorized web page access response, and determines whether the original web page access request has an unauthorized access vulnerability based on the comparison result of the original web page access response and the unauthorized web page access response.
[0123] It can be understood that if the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability; if the original web page access response is different from the unauthorized web page access response, it is determined that the original web page access request does not have an unauthorized access vulnerability.
[0124] The embodiment of the present application constructs an unauthorized web page access request according to the original web page access request, and uses the unauthorized web page access request to detect whether the original web page access request has an unauthorized access vulnerability, thereby being able to quickly and accurately detect the unauthorized access vulnerability.
[0125] In an optional embodiment, the method further includes step S108:
[0126] S108: When the original webpage access request has a command execution vulnerability and / or a permission access vulnerability, generate a vulnerability detection report.
[0127] As an example, when the client determines that the original web page access request has a command execution vulnerability and / or a permission access vulnerability, it can also generate a vulnerability detection report based on the vulnerability information, where the vulnerability information includes the vulnerability name, vulnerability type, and code location where the vulnerability is located.
[0128] It should be noted that the original web page access request has command execution vulnerabilities and / or permission access vulnerabilities, including the following three situations: the original web page access request only has a command execution vulnerability; the original web page access request only has a permission access vulnerability; the original web page access request has both a command execution vulnerability and a permission access vulnerability.
[0129] The embodiment of the present application generates a vulnerability detection report when there is a command execution vulnerability and / or a permission access vulnerability in the original web page access request, and can also provide the vulnerability detection report to the user to meet actual business needs.
[0130] In order to more clearly illustrate a vulnerability detection method provided in the first embodiment of the present application, the vulnerability detection method is applied to perform vulnerability detection on the original web page access request initiated by the super administrator. The flow chart is as follows: Figure 2 shown.
[0131] Please see Figure 3 , Figure 3 A schematic diagram of the structure of a vulnerability detection device provided for the second embodiment of the present application. The second embodiment of the present application provides a vulnerability detection device, including: an original request response acquisition module 201, used to acquire the original web page access request sent by the user to the application server, and the original web page access response returned by the application server; a target command execution processing module 202, used to send a target command execution request to the application server, and monitor the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding the target command to the original web page access request; a command execution vulnerability detection module 203, used to determine whether the original web page access request has a command execution vulnerability according to the execution result of the target command in the target command execution request; a forged request response acquisition module 204, used to send a forged web page access request to the application server, and receive a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request; and a permission access vulnerability detection module 205, used to determine whether the original web page access request has a permission access vulnerability according to the comparison result between the original web page access response and the forged web page access response.
[0132] In an optional embodiment, obtaining the original web page access request sent by the user to the application server includes: capturing the original web page access request through a proxy server.
[0133] In an optional embodiment, the target command execution processing module 202 is also used to add a target command to the original web page access request to obtain a target command execution request before sending the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request, when the access resource in the original web page access request is a static resource; and / or the forged request response acquisition module 204 is also used to edit the user identification information in the original web page access request to obtain a forged web page access request before sending the forged web page access request to the application server and receiving the forged web page access response returned by the application server.
[0134] In an optional embodiment, the target command includes a restart command; sending a target command execution request to the application server and monitoring the execution result of the target command in the target command execution request includes: sending a target command execution request to the application server and using an Internet packet explorer ping to monitor the execution result of the target command in the target command execution request; determining whether the original web page access request has a command execution vulnerability based on the execution result of the target command in the target command execution request includes: in the event of a ping interruption, determining that the original web page access request has a command execution vulnerability.
[0135] In an optional embodiment, the command execution vulnerability detection module 203 is also used to: after determining that the original web page access request has a command execution vulnerability, send an unauthorized command execution request to the application server, and monitor the execution result of the target command in the unauthorized command execution request; wherein the unauthorized command execution request is obtained by deleting the user identification information in the target command execution request; and determine whether the command execution vulnerability is an unauthorized command execution vulnerability based on the execution result of the target command in the unauthorized command execution request.
[0136] In an optional embodiment, the forged web page access request includes an unauthorized web page access request; the sending of the forged web page access request to the application server and receiving the forged web page access response returned by the application server includes: sending the unauthorized web page access request to the application server and receiving the unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by modifying the user identification information in the original web page access request to the identification information of an unauthorized user; the determining whether the original web page access request has an access vulnerability based on the comparison result of the original web page access response and the forged web page access response includes: determining that the original web page access request has an unauthorized access vulnerability when the original web page access response is the same as the unauthorized web page access response.
[0137] In an optional embodiment, the forged web page access request includes an unauthorized web page access request; the sending of the forged web page access request to the application server and receiving the forged web page access response returned by the application server includes: sending an unauthorized web page access request to the application server and receiving the unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by deleting the user identification information in the original web page access request; the determining whether the original web page access request has an authority access vulnerability based on the comparison result between the original web page access response and the forged web page access response includes: when the original web page access response and the unauthorized web page access response are the same, determining that the original web page access request has an unauthorized access vulnerability.
[0138] In an optional embodiment, the device further includes: a vulnerability detection report generating module, which is used to generate a vulnerability detection report when the original web page access request has a command execution vulnerability and / or a permission access vulnerability.
[0139] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0140] Please see Figure 4 , Figure 4 The third embodiment of the present application provides an electronic device 30, comprising a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; the memory 302 is coupled to the processor 301, and when the processor 301 executes the computer program, the method described in the first embodiment of the present application is implemented and the same beneficial effects can be achieved.
[0141] When the processor 301 reads the computer program from the memory 302 through the bus 303 and executes the computer program, the method of any embodiment included in the method described in the first embodiment of the present application can be implemented.
[0142] Processor 301 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 301 can be a microprocessor.
[0143] The memory 302 may be used to store instructions executed by the processor 301 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 301 of the disclosed embodiment may be used to execute instructions in the memory 302 to implement the method described in the first embodiment of the present application. The memory 302 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.
[0144] The fourth embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described in the first embodiment of the present application, and can achieve the same beneficial effects as the method.
[0145] The fifth embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a computer, the computer implements the method described in the first embodiment of the present application and can achieve the same beneficial effects.
[0146] The method described in the first embodiment of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in each embodiment of the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM (Open Application Model) or other programmable device.
[0147] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0148] In summary, the embodiment of the present application provides a vulnerability detection method, device, medium and program product, the vulnerability detection method comprising: obtaining an original web page access request sent by a user to an application server, and an original web page access response returned by the application server; sending a target command execution request to the application server, and monitoring the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding a target command to the original web page access request; according to the execution result of the target command in the target command execution request, determining whether the original web page access request has a command execution vulnerability; sending a forged web page access request to the application server, and receiving a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request; according to the comparison result between the original web page access response and the forged web page access response, determining whether the original web page access request has a permission access vulnerability. The embodiment of the present application constructs a target command execution request and a forged web page access request based on the original web page access request, uses the target command execution request to detect whether the original web page access request has a command execution vulnerability, and uses the forged web page access request to detect whether the original web page access request has a permission access vulnerability, so as to comprehensively detect command execution vulnerabilities and permission access vulnerabilities and other Web security vulnerabilities.
[0149] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0150] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0151] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0152] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A vulnerability detection method, It is characterized in that include: Obtaining an original webpage access request sent by a user to an application server, and an original webpage access response returned by the application server; Sending a target command execution request to the application server, and monitoring the execution result of the target command in the target command execution request; wherein the target command execution request is obtained by adding the target command to the original web page access request; Determining whether the original webpage access request has a command execution vulnerability according to an execution result of the target command in the target command execution request; Sending a forged web page access request to the application server, and receiving a forged web page access response returned by the application server; wherein the forged web page access request is obtained by editing the user identification information in the original web page access request; According to the comparison result between the original webpage access response and the forged webpage access response, it is determined whether the original webpage access request has an access vulnerability.
2. The method according to claim 1, It is characterized in that The obtaining of the original webpage access request sent by the user to the application server includes: The original web page access request is captured through a proxy server.
3. The method according to claim 1, It is characterized in that Before sending the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request, the method further includes: In the case where the access resource in the original webpage access request is a static resource, adding the target command to the original webpage access request to obtain the target command execution request; And / or, before sending the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server, the method further includes: In the case where the access resource in the original web page access request is a static resource, the user identification information in the original web page access request is edited to obtain the forged web page access request.
4. The method according to claim 1, It is characterized in that The target command includes a restart command; The sending of the target command execution request to the application server and monitoring the execution result of the target command in the target command execution request includes: Sending the target command execution request to the application server, and using an Internet packet explorer ping to monitor the execution result of the target command in the target command execution request; The step of determining whether the original webpage access request has a command execution vulnerability according to the execution result of the target command in the target command execution request includes: In the case where the ping is interrupted, it is determined that the original web page access request has the command execution vulnerability.
5. The method according to claim 1, It is characterized in that The method further comprises: After determining that the original webpage access request has the command execution vulnerability, sending an unauthorized command execution request to the application server, and monitoring the execution result of the target command in the unauthorized command execution request; wherein the unauthorized command execution request is obtained by deleting the user identification information in the target command execution request; According to the execution result of the target command in the unauthorized command execution request, it is determined whether the command execution vulnerability is an unauthorized command execution vulnerability.
6. The method according to claim 1, It is characterized in that The forged web page access request includes an unauthorized web page access request; The sending of the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server includes: Sending the unauthorized web page access request to the application server, and receiving the unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by modifying the user identification information in the original web page access request to the identification information of the unauthorized user; The step of determining whether the original webpage access request has an access vulnerability according to a comparison result between the original webpage access response and the forged webpage access response includes: When the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability.
7. The method according to claim 1, It is characterized in that The forged web page access request includes an unauthorized web page access request; The sending of the forged webpage access request to the application server and receiving the forged webpage access response returned by the application server includes: Sending the unauthorized web page access request to the application server, and receiving an unauthorized web page access response returned by the application server; wherein the unauthorized web page access request is obtained by deleting the user identification information in the original web page access request; The step of determining whether the original webpage access request has an access vulnerability according to a comparison result between the original webpage access response and the forged webpage access response includes: When the original web page access response is the same as the unauthorized web page access response, it is determined that the original web page access request has an unauthorized access vulnerability.
8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: In the case that the original webpage access request has the command execution vulnerability and / or the permission access vulnerability, a vulnerability detection report is generated.
9. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 8.
11. A computer program product, It is characterized in that The computer program product comprises instructions which, when executed by a computer, cause the computer to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Vulnerability detection method and device
CN111680301A
Unauthorized access vulnerability detection method, device and system and storage medium
CN113411333A
Alarm real-time merging method and device
CN118260605A
Detecting and protecting against inconsistent use of cross-site request forgery mitigation features
US20230129631A1
