Web application vulnerability association method, system, electronic device and storage medium
By embedding Hook JS and DOM operation technology in the HTML file, the interactive information of the browser page is extracted, and a page file marked with the click location is generated, which solves the problem of difficult front-end and back-end correlation and improves the efficiency and accuracy of vulnerability verification.
Patent Information
- Application Number
- CN202410962512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Under the web application architecture where the front and back ends are separated, when a vulnerability is detected, it is difficult to correlate the back-end API URL and the front-end page that trigger the vulnerability, making manual verification difficult.
By embedding Hook JS in the HTML file, DOM operation technology is used to extract the interactive information of the browser page, and when the vulnerability occurs, a page file marked with the click location is generated to realize the association between the front end and the back end.
It greatly reduces the difficulty of manual verification of vulnerabilities. It can clearly know which page the user clicked on to trigger the vulnerability, and improves the accuracy and efficiency of vulnerability correlation.
Smart Images

Figure CN118631583B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network security, and in particular to a method, system, electronic device and storage medium for associating vulnerabilities of Web applications. Background Art
[0002] Currently, web application vulnerability monitoring based on IAST (Interactive Application Security Testing) technology is very popular. IAST is a security testing method that combines the advantages of static application security testing (SAST) and dynamic application security testing (DAST) to improve the security of software and applications. The core idea of IAST is to monitor the interaction process with databases, networks, etc. when the application is running, discover security issues in real time, and extract information such as the access URL (Uniform Resource Locator) of the vulnerability, call stack, and taint tracking data flow, without waiting until the application is released.
[0003] Currently, many applications are separated in front-end and back-end, that is, the browser first loads the static HTML (Hyper Text Markup Language) file, and then uses JS (Java Script, a translated scripting language) to obtain the dynamic data to be displayed through the API (Application Programming Interface) provided by the back-end. IAST can monitor whether a request under a certain API triggers a vulnerability.
[0004] In an architecture with front-end and back-end separation, the URLs of the front-end and back-end are completely unrelated when a vulnerability is triggered. It is difficult to tell from the API URL obtained from the back-end which page called the API to trigger the vulnerability. The association can only be assisted by R&D personnel familiar with the application, or the vulnerability can be reproduced through a large number of tests to achieve the association, which brings great trouble to manual verification of the vulnerability. Summary of the invention
[0005] In order to match the backend URL that triggers the vulnerability with the frontend page, and facilitate subsequent manual verification of the vulnerability, the present application provides a vulnerability association method, system, electronic device and storage medium for a Web application. The frontend JS Hook and DOM operation technology are used to achieve the association between the frontend and the backend.
[0006] In a first aspect, the present application provides a method for associating vulnerabilities of a Web application, using the following technical solution:
[0007] A method for associating vulnerabilities of a Web application comprises the following steps:
[0008] Add Hook JS to the HTML file;
[0009] The Hook JS extracts DOM information from the HTML file according to the user instruction, and the DOM information includes instruction coordinates;
[0010] Rendering a page based on the user instruction, when the security monitoring tool detects vulnerability information, rendering the DOM information to generate a page file, and marking the page file based on the instruction coordinates;
[0011] The page file is associated with the vulnerability information.
[0012] When a vulnerability error occurs, it is usually impossible to directly determine which page called the API from the API URL obtained from the backend, because the API URL design usually does not contain direct information about the caller page. The API is designed to provide services to different clients, which can be web pages, mobile applications, third-party services, etc., and the API URL generally only contains resource identifiers and operation instructions.
[0013] Web applications with front-end and back-end separation generally initiate a simple HTML request first, and the server returns an HTML response, which includes an HTML file, which contains JS. Whenever a user issues a user instruction to a browser page, such as clicking a link on a browser page with a mouse, JS will automatically execute to complete the DOM rendering. During this rendering process, JS will access many APIs to obtain data. By adopting the above technical solution, Hook JS (JavaScript hook) is pre-embedded in the HTML file, and the DOM (Document Object Model) information in the HTML file is extracted by using this mechanism that allows interception and processing of JavaScript code execution. DOM information is a complete HTML code that includes the current browser page information and the location information of the user's click on the page. When a user issues a user instruction, modern web browsers can capture these interactive events and provide detailed information about the click location. During the web page rendering process, the browser will make a series of DOM requests and responses, which mainly involve the acquisition, processing and rendering of page content. When the security monitoring tool used detects a vulnerability, the security monitoring tool can record the URL of the background API that triggers the vulnerability. At this time, the tool can render the DOM information to generate a page file in a PDF or JPG format marked with the click location, and associate it with the current vulnerability information to correspond to the specific URL that triggers the vulnerability and the browser page.
[0014] This application can help R&D personnel clearly know which location on which page the user clicked to trigger the vulnerability, greatly reducing the difficulty of manually verifying the vulnerability.
[0015] Optionally, the page rendering process includes multiple API responses; when the security monitoring tool detects vulnerability information, the DOM information is rendered to generate a page file, specifically including the following steps:
[0016] When the security monitoring tool detects the vulnerability information, a vulnerability ID is generated based on the vulnerability information;
[0017] Storing the vulnerability ID in the API response;
[0018] The Hook JS determines whether the vulnerability ID exists in the API response; if so, the DOM information is rendered to generate a page file.
[0019] By adopting the above technical solution, the security monitoring tool will generate a vulnerability ID as a unique identifier for the monitored vulnerability and put it into the API response. After the browser receives the API response, Hook JS can identify the vulnerability ID, indicating that the user's previous click action triggered the vulnerability. The most recently extracted DOM information is rendered. The rendered page information corresponds to the page when the click action occurred, and is marked with the user's click location. The specific URL that triggers the vulnerability and the page information are matched, which is convenient for subsequent manual verification of the vulnerability.
[0020] Optionally, the page rendering process includes an API request corresponding to each of the API responses; the vulnerability ID is stored in the Header information of the API response; the Hook JS determines whether the vulnerability ID exists in the API response, specifically including the following steps:
[0021] The Hook JS captures the API request and the API response;
[0022] Compare the Header information of the API response with the corresponding API request.
[0023] IAST can modify the response header of the web application traffic, and can add a custom header to inform Hook JS whether it needs to extract DOM information. In HTTP communication, the header information is an important part of the request and response. They provide important metadata about HTTP messages, including the content type, encoding method, language, cache control, etc. By adopting the above technical solution, Hook JS hooks and compares API requests and responses, quickly and accurately identifies vulnerability IDs, thereby realizing the association between the front-end and the back-end, and better managing the vulnerabilities of web applications.
[0024] Optionally, associating the page file with the vulnerability information specifically includes the following steps:
[0025] Sending the page file and the vulnerability ID to the security monitoring tool;
[0026] Matching the vulnerability information based on the vulnerability ID;
[0027] When the vulnerability information is displayed, the page file is also displayed.
[0028] By adopting the above technical solution, the vulnerability ID matches the corresponding vulnerability information in the security monitoring tool. The vulnerability information includes the URL of the backend API. When the vulnerability information is pushed, the associated page file is displayed synchronously. R&D personnel can manually verify the vulnerability based on the page image and the mouse click position marked in the image, which greatly reduces the difficulty of manual vulnerability verification.
[0029] Optionally, the adding of Hook JS to the HTML file is specifically: adding the Hook JS to the head tag of the HTML file saved on the target server.
[0030] In HTML documents, tags are containers that contain document metadata, information that describes and manipulates the content of the document. <script>标签用于嵌入或引用JavaScript代码。通过采用上述技术方案,将保存在目标服务器端的HTML文件直接进行修改,一次修改永久有效。适用于能够方便的修改目标服务器端上的HTML文件的研发测试团队。
[0031] 可选的:所述向HTML文件中加入Hook JS,具体为:在浏览器端安装插件,所述浏览器端接收到所述HTML文件时,所述插件将所述Hook JS加入所述HTML文件的head标签中。
[0032] 通过采用上述技术方案,在浏览器端安装插件,修改接收到所述HTML文件,对目标服务器端没有侵入性而且可随时禁用插件,避免了卸载和修改服务器参数不方便的问题。适用于不方便修改服务器上的文件和配置的研发测试团队。
[0033] 可选的:所述向HTML文件中加入Hook JS,具体为:在代理服务器中加入控制逻辑,所述代理服务器接收到所述HTML应答时,所述控制逻辑将所述Hook JS加入所述HTML文件的head标签。
[0034] 通常在浏览器端与目标服务器端之间设置代理服务器作为中介,提供匿名性、性能优化、安全增强及内容控制等网络服务优势。代理服务器在转发请求或响应时,可以对转发的内容进行修改,比如添加或删除某些HTTP头。通过采用上述技术方案,在代理服务器配置控制逻辑,一次配置永久有效,对转发的应答HTML中的HTML文件动态修改,不改动目标数据库中的HTML文件。适用于能够方便的修改代理服务器配置的研发测试团队。
[0035] 第二方面,本申请提供一种Web应用的漏洞关联系统,采用如下的技术方案:
[0036] 一种Web应用的漏洞关联系统,包括:
[0037] 插桩模块,用于向HTML文件中加入Hook JS,所述Hook JS根据用户指令由所述HTML文件中提取DOM信息,所述DOM信息包括指令坐标;
[0038] 漏洞监测模块,用于监测页面渲染过程中出现的漏洞并记录漏洞信息;当监测到所述漏洞信息时,将所述DOM信息渲染生成页面文件,并基于所述指令坐标在所述页面文件进行标记;
[0039] 漏洞关联模块,用于将所述页面文件与所述漏洞信息进行关联。
[0040] 第三方面,本申请提供一种电子设备,采用如下的技术方案:
[0041] 一种电子设备,包括:
[0042] 至少一个处理器;
[0043] 存储器;至少一个应用程序,其中至少一个应用程序被存储在存储器中并被配置为由至少一个处理器执行,所述至少一个应用程序配置用于:执行上述Web应用的漏洞关联方法。
[0044] 第四方面,本申请提供一种计算机可读存储介质,采用如下的技术方案:
[0045] 一种计算机可读存储介质,所述存储介质存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现上述Web应用的漏洞关联方法。
[0046] 综上所述,本申请利用前端JS Hook和DOM操作技术,实现前端和后端的关联,能够帮助研发人员清楚地得知用户在那个页面点击了那个位置从而触发了漏洞,具有大大减少人工验证漏洞难度的有益技术效果。附图说明
[0047] 图1是一般的前后端数据传输的结构示意图;
[0048] 图2是本申请实施例中Web应用的漏洞关联方法的流程框图;
[0049] 图3是图2中S3步骤的具体流程框图;
[0050] 图4是图3中S3.3步骤的具体流程框图;
[0051] 图5是图2中S4步骤的具体流程框图;
[0052] 图6是采用浏览器插件的方式进行演示的漏洞关联界面图,示出了触发漏洞时浏览器端插件的提示方式和内容;
[0053] 图7是采用浏览器插件的方式进行演示的漏洞关联界面图,示出了触发漏洞的点击坐标的标注方式;图8是采用浏览器插件的方式进行演示的漏洞关联界面图,示出了点击漏洞提示后获取到的漏洞详情;
[0054] 图9是本申请实施例中Web应用的漏洞关联系统的结构框图;
[0055] 图10是本申请实施例中一种电子设备的结构示意图。
[0056] 附图标记说明:1、浏览器端;2、代理服务器;3、目标服务器端;4、插桩模块;5、漏洞监测模块;6、漏洞关联模块;7、处理器;8、存储器;9、I / O接口;10、通信组件;11、通信总线。具体实施方式
[0057] 为更清楚地理解本申请的目的、技术方案和优点,下面结合附图和实施例,对本申请进行了描述和说明。然而,本领域的普通技术人员应该明白,可以在没有这些细节的情况下实施本申请。在一些情形下,为了避免不必要的描述使本申请的各方面变得晦涩难懂,对已经在较高的层次上描述了众所周知的方法、过程、系统、组件和 / 或电路将不作过多赘述。对于本领域的普通技术人员来说,显然可以对本申请所公开的实施例作出各种改变,并且在不偏离本申请的原则和范围的情况下,本申请中所定义的普遍原则可以适用于其他实施例和应用场景。因此,本申请不限于所示的实施例,而是符合与本申请所要求保护的范围一致的最广泛范围。
[0058] 在此需要说明的是,对于这些实施方式的说明用于帮助理解本申请,但并不构成对本申请的限定。此外,下面所描述的本申请各个实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互组合。
[0059] 本申请的描述中,参考术语"一个实施例”、"一些实施例”、"示意性实施例”、"示例”、"具体示例”、或"一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意行表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以结合的方式结合。
[0060] 为使本领域技术人员详细理解本申请所提供的技术方案,首先对本申请实施例中所涉及特定名词作简要说明。
[0061] HTML是构建网页和网上应用的标准标记语言,用于创建网页和Web应用程序的标准标记语言,HTML通过一系列的标签定义了网页的结构。页面是用户与互联网交互的界面,而HTML是构建这些页面的蓝图。通过HTML,开发者可以创建结构化、格式化和可交互的网页。
[0062] DOM是一个编程接口,它表示了一个网页的结构,包括HTML文档中的所有元素。当浏览器加载一个网页时,它会解析HTML文档,并根据这些规则构建出DOM。这个DOM表示了网页的结构,并且可以被JS读取和操作。HTML定义了网页的结构,而DOM提供了一种让JS能够访问和操作HTML文档的方式。
[0063] HTML作为网页内容的静态表示,DOM作为动态、可交互的网页内容模型。通过DOM,开发者可以操作由HTML定义的网页内容,实现网页的动态功能。
[0064] JS Hook是一种技术,指的是用于插桩的JS代码,插件是Hook的另一个叫法。它允许开发者在特定的浏览器事件或用户行为发生时执行自定义的JS代码。这些钩子可以附加到DOM元素上,用以监听和响应各种事件,如点击、滚动、键盘输入等。
[0065] Head标签在HTML文档中扮演着非常重要的角色,它包含了文档的元数据,即描述和操纵文档内容的信息。
[0066] URL是一个用于在互联网上定位和访问资源的字符串,是互联网上标准的一种方式,通过它用户可以访问网页、文件、图片、视频、音频等资源。
[0067] API是一套预先定义的函数、协议和工具,用于构建软件和应用程序。API充当不同软件间的中介,使得开发者在设计产品时能够使用某些现成的功能而不是从零开始编写代码。主要目的是提供一种让应用程序之间进行互相通信的方法。目标服务器上的API处理来自客户端的请求,并执行相应的业务逻辑,API可以与数据库交互,存储或检索数据。
[0068] Header头部信息是HTTP请求和响应的重要组成部分。Headers提供了关于HTTP消息的重要元数据,包括客户端请求的信息、服务器响应的信息以及消息本身的属性。
[0069] 参照图1,简要介绍数据传输的一般流程:
[0070] 用户请求:用户在浏览器端1地址栏输入URL或点击网页上的链接。
[0071] DNS解析:浏览器端1向DNS服务器请求解析目标服务器的IP地址。
[0072] 数据传输内容:域名、DNS查询请求。
[0073] 建立连接:浏览器与目标服务器端3或代理服务器2建立TCP连接(通常是HTTP / HTTPS请求)。
[0074] 数据传输内容:TCP连接请求、TLS握手数据(如果是HTTPS连接)。
[0075] 发送HTTP请求:浏览器发送HTTP请求到目标服务器端3,如果存在代理服务器2,则先发送到代理服务器2。(数据传输内容:HTTP请求行(包含方法如GET或POST、请求的资源路径、HTTP版本)、HTTP请求头(包含用户代理、接受类型、主机名、Cookies等),部分请求可能包含请求体,如POST请求的数据。)
[0076] 代理服务器2处理:如果配置了代理服务器2,它将处理浏览器的请求:
[0077] 代理可能对请求进行缓存、转发、过滤或修改。
[0078] 代理服务器2可能还会添加、修改或删除请求头。(数据传输内容:经代理服务器2处理后的HTTP请求。)
[0079] 目标服务器响应:目标服务器端3处理请求并返回HTTP响应。(数据传输内容:HTTP响应行(包含HTTP版本、状态码、状态消息)、HTTP响应头(包含内容类型、内容长度、服务器信息、Set-Cookie等)、响应体,即所请求的资源内容,如HTML文档、图片、CSS文件、JavaScript文件等。)
[0080] 代理服务器2转发响应:如果通过代理服务器2,它会将服务器的响应转发回浏览器。
[0081] 浏览器渲染页面:浏览器接收到响应后,根据响应内容进行页面渲染。
[0082] 额外的HTTP请求:浏览器渲染页面时,可能会发现需要额外资源(如图片、CSS、JavaScript文件),并为这些资源发起额外的HTTP请求(API请求)。
[0083] 页面加载完成:一旦所有必要的资源都被加载和处理,页面就完全显示给用户。
[0084] 本申请实施例公开一种Web应用的漏洞关联方法。
[0085] 如图2所示,漏洞关联方法包括下列步骤:
[0086] S1:向HTML文件中加入Hook JS。
[0087] 说明性的,可以在HTML文件的Head部分加入一个自执行的JS标签:
[0088] <script>(function() {
[0089] / / 这里放自执行代码
[0090] })();
[0091] < / script>
[0092] The purpose of adding Hook JS to the HTML document is to execute scripts in the early stages of page loading, such as modifying the default behavior of the page, intercepting events, injecting additional elements, or initializing some scripts and styles. In this way, the logic in the function will be automatically executed after the page is loaded by the browser to complete the operation we want.
[0093] There are many ways to add JS tags to the Head section of an HTML file.
[0094] In some embodiments, Hook JS is added to the head tag of the HTML file saved in the target server 3.
[0095] Interpretative, you can modify the HTML file saved on the target server 3 directly, and the modification will be effective forever. It is suitable for the R&D and testing team who can easily modify the HTML file on the target server 3.
[0096] In some embodiments, a plug-in is installed on the browser terminal 1, and when the browser terminal 1 receives an HTML file, the plug-in adds Hook JS to the head tag of the HTML file.
[0097] Explanatory, plug-ins can be installed on the browser side 1 to modify the received HTML file. It is non-invasive to the target server side 3 and the plug-in can be disabled at any time. It is suitable for R&D and testing teams that are not convenient to modify files and configurations on the server.
[0098] In some embodiments, a control logic is added to the proxy server 2. When the proxy server 2 receives an HTML response, the control logic adds Hook JS to the head tag of the HTML file.
[0099] Explanatory, the control logic can be configured in the proxy server 2, and the configuration is permanently effective once, and the HTML file in the forwarded response HTML is dynamically modified without changing the HTML file in the target database. It is suitable for the R&D test team that can easily modify the configuration of the proxy server 2.
[0100] S2: Hook JS extracts DOM information from the HTML file according to user instructions, and the DOM information includes instruction coordinates.
[0101] Explanatory, Hook JS uses document.documentElement to extract the DOM information of the current page. In JavaScript, document.documentElement is a DOM object reference pointing to the root element of an HTML document. Using it, you can get and manipulate the entire DOM structure of the current page. The DOM information also contains information about the location of the user's click on the page. When a user interacts with an element on a web page, such as clicking a button or a link, modern web browsers are able to capture these interaction events and provide detailed information about the click location. For example, browser-side 1 coordinates, etc., the user's interaction with the page can also be such as touch, scroll, etc., and the location of their interaction on the page is represented as instruction coordinates.
[0102] Illustratively, each time a user's interactive instruction on the browser side 1, such as clicking a mouse, takes effect, the returned HTML file is extracted by Hook JS for storage of DOM information.
[0103] S3: Render the page based on user instructions. When the security monitoring tool detects vulnerability information, the DOM information is rendered to generate a page file and marked in the page file based on the instruction coordinates.
[0104] Explanatory, during the page rendering process, the browser 1 will issue multiple API requests and receive API responses corresponding to each API request. API calls are usually initiated by JavaScript code during or after the page loading process to obtain data from the server or interact with the server. These calls can be made through modern Fetch and XMLHTTPRequest (XHR) objects. Fetch and XHR are two methods for the JS code in the browser page to send HTTP requests to the background server, which are used to request data from the server or send data to the server, including monitoring the API request and response information of the page and the server background.
[0105] Combination Figure 3 , step S3 specifically includes the following steps:
[0106] S3.1: When the security monitoring tool detects vulnerability information, a vulnerability ID is generated based on the vulnerability information.
[0107] Illustratively, this application is based on IAST technology and is used in combination with other security monitoring tools or vulnerability management platforms to achieve the effect of improving the efficiency of monitoring and management of Web application vulnerabilities.
[0108] When the security monitoring tool finds a vulnerability, it obtains vulnerability information including vulnerability type, URL of the page API, etc. A vulnerability ID is generated for the vulnerability as the unique identifier of the vulnerability information.
[0109] S3.2: Store the vulnerability ID in the API response.
[0110] Explanatory, IAST can modify the response header of the web application traffic (referring to API requests and responses). A custom header can be added to store the vulnerability ID and notify Hook JS whether the DOM information needs to be rendered into a page file.
[0111] S3.3: Hook JS determines whether there is a vulnerability ID in the API response; if so, it renders the DOM information to generate a page file.
[0112] Combination Figure 4 , step S3.3 specifically includes the following steps:
[0113] S3.3.1: Hook JS to capture API requests and API responses.
[0114] Specifically, Hook JS hooks the Fetch and XHR methods, which can capture API requests and API responses issued by the page during rendering.
[0115] S3.3.2: Compare the header information of the API response with the corresponding API request.
[0116] Explanatory, the API response and the corresponding API request are identified based on the Header information. If there is new Header information, it is extracted as the vulnerability ID.
[0117] Illustratively, each time an interactive instruction of the user on the browser side 1, such as clicking a mouse, takes effect, the returned HTML file is extracted by Hook JS for storage of DOM information, and the rendered DOM information is the most recently recorded DOM information.
[0118] S4: Associate the page file with the vulnerability information.
[0119] Combination Figure 5, step S4 specifically includes the following steps:
[0120] S4.1: Send the page file and vulnerability ID to the security monitoring tool.
[0121] S4.2: Match vulnerability information based on vulnerability ID.
[0122] S4.3: When displaying vulnerability information, display the page file.
[0123] Reference Figure 6 , Figure 7 , Figure 8 , which is a diagram of the vulnerability association interface demonstrated using a browser plug-in.
[0124] In the demonstration, the browser 1 page is divided into multiple small blocks, and a unique coordinate is marked for each small block. When the coordinate (9,9) is clicked, (9,9) is the instruction coordinate, and the vulnerability is triggered. The browser 1 plug-in will give a prompt, which may include the monitored click coordinates, vulnerability ID, and vulnerability type.
[0125] Click the prompt to obtain vulnerability details, which may include the interaction method of the vulnerability, vulnerability ID, local URL, background URL, click coordinates, and other information, as well as the browser page image marked with the instruction coordinates.
[0126] The implementation principle is:
[0127] After injecting Hook Js into the HTML file, Hook Js will save the DOM information of the current page every time the user clicks a button, including the location of the mouse click. If the Header of the captured API response contains a vulnerability ID after a click, the last stored DOM information will be converted into page information and the instruction coordinates will be marked, and sent to the security monitoring tool together with the vulnerability ID. When the security monitoring tool displays the vulnerability, the page information will be displayed synchronously.
[0128] The embodiment of the present application also discloses a vulnerability association system for Web applications.
[0129] Reference Fig. 9 , the vulnerability association system system includes:
[0130] The plugging module 4 is used to add Hook JS to the HTML file. Hook JS extracts DOM information from the HTML file according to user instructions. The DOM information includes instruction coordinates.
[0131] The vulnerability monitoring module 5 is used to monitor the vulnerabilities that appear during the page rendering process and record the vulnerability information. When the vulnerability information is detected, the DOM information is rendered to generate a page file and marked in the page file based on the instruction coordinates.
[0132] Specifically: The page rendering process includes multiple API responses. When the security monitoring module detects vulnerability information, a vulnerability ID is generated based on the vulnerability information.
[0133] Store the vulnerability ID in the API response.
[0134] Hook JS determines whether there is a vulnerability ID in the API response; if so, it renders the DOM information to generate a page file.
[0135] Specifically: the page rendering process includes multiple API requests that correspond to the API responses one by one, and the vulnerability ID is stored in the Header information of the API response. Hook JS captures the API request and the API response, compares the Header information of the API response with the Header information of the corresponding API request, and records the added part of the Header information as the vulnerability ID. At this time, the vulnerability monitoring module 5 renders the DOM information to generate a page file, and marks it in the page file based on the instruction coordinates.
[0136] The vulnerability association module 6 is used to associate the page file with the vulnerability information.
[0137] Specifically: the vulnerability association module 6 obtains the page file and the vulnerability ID, matches the vulnerability information based on the vulnerability ID, and displays the page file when displaying the vulnerability information.
[0138] The other functions performed in the above-mentioned plugging module 4, vulnerability monitoring module 5 and vulnerability association module 6 and the technical details of each function are the same or similar to the corresponding features in the vulnerability association method described above, so they are not repeated here.
[0139] The embodiment of the present application also discloses an electronic device.
[0140] like Fig.10 As shown, the electronic device includes a processor 7 and a memory 8 , and may further include one or more of an I / O interface 9 and a communication component 10 .
[0141] The processor 7 is used to control the overall operation of the electronic device to complete all or part of the steps in the above-mentioned vulnerability association method; the memory 8 is used to store various types of data to support the operation of the electronic device, and these data may include instructions for any application or method used to operate on the electronic device, as well as application-related data. The memory 8 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. One or more.
[0142] The I / O interface 9 provides an interface between the processor 7 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 10 is used to test the wired or wireless communication between the electronic device and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 10 can include: Wi-Fi components, Bluetooth components, NFC components.
[0143] The communication bus 11 may include a path for transmitting information between the above components. The communication bus 11 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 11 may be divided into an address bus, a data bus, a control bus, etc.
[0144] The electronic device can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the vulnerability association method given in the above embodiment.
[0145] The electronic device may include, but is not limited to, mobile terminals such as digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Multimedia Players), etc., and fixed terminals such as digital TVs, desktop computers, etc., and may also be servers, etc.
[0146] The embodiment of the present application also discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor 7, the steps of the vulnerability association method described above are implemented.
[0147] The computer-readable storage medium may include: 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, and other media that can store program codes.
[0148] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.
[0149] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for associating vulnerabilities of a Web application, characterized in that: The specific steps include: Add Hook JS to the HTML file; The Hook JS extracts DOM information from the HTML file according to the user instruction, wherein the DOM information includes instruction coordinates, wherein the user instruction is an instruction issued when the user interacts with an element on the web page, and the instruction coordinates are the location of the user's interaction on the page; Rendering a page based on the user instruction, when the security monitoring tool detects vulnerability information, rendering the DOM information to generate a page file, and marking the page file based on the instruction coordinates; Associating the page file with the vulnerability information, The page rendering process includes multiple API responses; when the security monitoring tool detects vulnerability information, the DOM information is rendered to generate a page file, which specifically includes the following steps: When the security monitoring tool detects the vulnerability information, a vulnerability ID is generated based on the vulnerability information; Storing the vulnerability ID in the API response; The Hook JS determines whether the vulnerability ID exists in the API response; if so, the DOM information is rendered to generate the page file.
2. The vulnerability association method of Web application according to claim 1, characterized in that: The page rendering process includes an API request corresponding to each of the API responses; the vulnerability ID is stored in the Header information of the API response; the Hook JS determines whether the vulnerability ID exists in the API response, specifically including the following steps: The Hook JS captures the API request and the API response; Compare the Header information of the API response with the corresponding API request.
3. The vulnerability association method of Web application according to claim 1, characterized in that: The associating the page file with the vulnerability information specifically includes the following steps: Sending the page file and the vulnerability ID to the security monitoring tool; Matching the vulnerability information based on the vulnerability ID; When the vulnerability information is displayed, the page file is also displayed.
4. The vulnerability association method of Web application according to claim 1, characterized in that: The adding of Hook JS to the HTML file is specifically: adding the Hook JS to the head tag of the HTML file stored in the target server side (3).
5. The method for associating vulnerabilities of Web applications according to claim 1, characterized in that: The adding of Hook JS to the HTML file is specifically as follows: installing a plug-in on the browser end (1), and when the browser end (1) receives the HTML file, the plug-in adds the Hook JS to the head tag of the HTML file.
6. The vulnerability association method of Web application according to claim 1, characterized in that: The adding of Hook JS to the HTML file specifically includes: adding control logic to the proxy server (2); when the proxy server (2) receives the HTML response, the control logic adds the Hook JS to the head tag of the HTML file.
7. A vulnerability association system for a Web application, characterized in that: include: The plugging module (4) is used to add Hook JS to the HTML file, wherein the Hook JS extracts DOM information from the HTML file according to a user instruction, wherein the DOM information includes instruction coordinates, wherein the user instruction is an instruction issued when the user interacts with an element on the web page, and the instruction coordinates are the position where the user interacts on the page; A vulnerability monitoring module (5) is used to render a page based on the user instruction, and when the security monitoring tool detects vulnerability information, the DOM information is rendered to generate a page file, and the page file is marked based on the instruction coordinates; Associating the page file with the vulnerability information, The page rendering process includes multiple API responses; when the security monitoring tool detects vulnerability information, the DOM information is rendered to generate a page file, which specifically includes the following steps: When the security monitoring tool detects the vulnerability information, a vulnerability ID is generated based on the vulnerability information; Storing the vulnerability ID in the API response; The Hook JS determines whether the vulnerability ID exists in the API response; if so, renders the DOM information to generate the page file; A vulnerability association module (6) is used to associate the page file with the vulnerability information.
8. An electronic device, characterized in that: include: at least one processor (7); A memory (8); at least one application, wherein the at least one application is stored in the memory (8) and is configured to be executed by at least one processor (7), and the at least one application is configured to: execute the vulnerability association method for a Web application according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor (7) to implement the vulnerability association method of a Web application according to any one of claims 1 to 6.
Citation Information
Patent Citations
Vulnerability detection method and device, computer equipment and storage medium
CN112231711A
Page rendering method and device, computer equipment and storage medium
CN117421503A
