CN115987638A - A webpage vulnerability detection method, device, equipment and storage medium - Google Patents
A webpage vulnerability detection method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115987638A CN115987638A CN202211663405.4A CN202211663405A CN115987638A CN 115987638 A CN115987638 A CN 115987638A CN 202211663405 A CN202211663405 A CN 202211663405A CN 115987638 A CN115987638 A CN 115987638A
- Authority
- CN
- China
- Prior art keywords
- script
- vulnerability
- webpage
- target
- response
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
背景技术Background technique
随着Web技术越来越广泛,许多应用程序通过Web平台来进行应用与部署,并且在客户端使用脚本语言来提高应用程序的响应时间、交互性和Web服务器上的开销。但是大量的用户交互行为也会为系统带来一定的风险。如果不对脚本输入输出接口进行特定的安全防护,可能会导致XSS(Cross Site Scripting,跨站脚本漏洞)和(Cross-site RequestForgery,跨站请求伪造)等严重的安全隐患,造成用户会话劫持、客户端cookie窃取、网络钓鱼等安全问题。因此,需要针对网页进行漏洞检测,及时发现问题并完善,以减少损失。As Web technology becomes more and more widespread, many applications are applied and deployed through the Web platform, and scripting languages are used on the client side to improve the application response time, interactivity and overhead on the Web server. However, a large number of user interaction behaviors will also bring certain risks to the system. If there is no specific security protection for script input and output interfaces, serious security risks such as XSS (Cross Site Scripting, cross-site scripting vulnerability) and (Cross-site Request Forgery, cross-site request forgery) may result, resulting in user session hijacking, customer End cookie theft, phishing and other security issues. Therefore, it is necessary to conduct vulnerability detection for web pages, find problems in time and improve them to reduce losses.
目前,针对网页进行漏洞检测时,一般使用基于JavaScript进行开发的渗透测试方法。且基于JavaScript的XSS攻击渗透测试方法受到许多限制,例如:基于客户端的XSS攻击检测方法需要修改客户端java脚本解释器实现,以只执行合法的脚本代码;大多数方法都需要源代码插装,这意味着web应用程序实现需要修改,插入一些注释或分隔符,以区分良性和恶意的JavaScript代码。At present, when performing vulnerability detection on web pages, a penetration testing method developed based on JavaScript is generally used. And the XSS attack penetration testing method based on JavaScript is subject to many restrictions, for example: the client-based XSS attack detection method needs to modify the client-side java script interpreter to implement, so that only legal script codes are executed; most methods require source code insertion, This means that the web application implementation needs to be modified to insert some comments or separators to distinguish between benign and malicious JavaScript code.
可见,使用基于JavaScript进行开发的渗透测试方法,进行网页漏洞检测时,需要修改客户端java脚本解释器,修改web应用程序源代码等,过程繁琐且耗费时间。It can be seen that when using the JavaScript-based penetration testing method to detect web page vulnerabilities, it is necessary to modify the client-side java script interpreter, modify the source code of the web application, etc., and the process is cumbersome and time-consuming.
发明内容Contents of the invention
本申请实施例提供一种网页漏洞检测方法、装置、设备及存储介质,用以快速便捷的进行网页漏洞检测。Embodiments of the present application provide a web page vulnerability detection method, device, equipment and storage medium for fast and convenient web page vulnerability detection.
第一方面,本申请实施例提供一种网页漏洞检测方法,该方法包括:In the first aspect, the embodiment of the present application provides a webpage vulnerability detection method, the method comprising:
接收网页访问指令,获取相应响应页面的响应网页资源;Receive a webpage access instruction, and obtain a response webpage resource of a corresponding response page;
提取响应网页资源中的目标脚本,并提取目标脚本的目标脚本特性;Extracting the target script in the response webpage resource, and extracting the target script characteristic of the target script;
将目标脚本特性与数据库中存储的原始脚本特性进行匹配,并基于匹配结果,检测响应页面的网页漏洞。Match the target script feature with the original script feature stored in the database, and based on the matching result, detect the web page vulnerability of the response page.
第二方面,本申请实施例提供一种网页漏洞检测装置,该装置包括:In a second aspect, the embodiment of the present application provides a webpage vulnerability detection device, the device comprising:
接收单元,用于接收网页访问指令,获取相应响应页面的响应网页资源;a receiving unit, configured to receive a webpage access instruction, and obtain a response webpage resource of a corresponding response page;
提取单元,用于提取响应网页资源中的目标脚本,并提取目标脚本的目标脚本特性;An extracting unit, configured to extract the target script in the response web resource, and extract the target script characteristics of the target script;
匹配检测单元,用于将目标脚本特性与数据库中存储的原始脚本特性进行匹配,并基于匹配结果,检测响应页面的网页漏洞。The matching detection unit is configured to match the characteristics of the target script with the characteristics of the original script stored in the database, and detect webpage vulnerabilities of the response page based on the matching result.
第三方面,本申请实施例提供一种计算设备,包括:存储器和处理器,其中,存储器,用于存储计算机指令;处理器,用于执行计算机指令以实现本申请实施例提供的网页漏洞检测方法的步骤。In a third aspect, an embodiment of the present application provides a computing device, including: a memory and a processor, wherein the memory is used to store computer instructions; the processor is used to execute computer instructions to implement the web page vulnerability detection provided by the embodiment of the application method steps.
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机指令,计算机指令被处理器执行时实现本申请实施例提供的网页漏洞检测方法的步骤。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the steps of the web page vulnerability detection method provided in the embodiment of the present application are implemented.
第五方面,本申请实施例提供一种计算机程序产品,其包括计算机指令,计算机指令存储在计算机可读存储介质中;当计算设备的处理器从计算机可读存储介质读取计算机指令时,处理器执行计算机指令,使得计算设备执行本申请实施例提供的网页漏洞检测方法的步骤。In the fifth aspect, the embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when the processor of the computing device reads the computer instructions from the computer-readable storage medium, the processing The computer executes computer instructions, so that the computing device executes the steps of the web page vulnerability detection method provided by the embodiment of the present application.
本申请有益效果如下:The beneficial effects of this application are as follows:
本申请实施例提供一种网页漏洞检测方法、装置、设备及存储介质,涉及计算机安全技术领域,尤其涉及Web网页安全技术领域;在本申请中,接收网页访问指令,获取相应响应页面的响应网页资源;提取响应网页资源中的目标脚本,并提取目标脚本的目标脚本特性;将目标脚本特性与数据库中存储的原始脚本特性进行匹配,并基于匹配结果,检测响应页面的网页漏洞。无需修改客户端java脚本解释器,且无需修改Web应用程序,仅基于从响应网页资源中识别的目标脚本的目标脚本特性与原始脚本特性进行匹配的方式,即可检测网页漏洞,操作简单,方便快捷。The embodiment of the present application provides a web page vulnerability detection method, device, equipment and storage medium, which relate to the field of computer security technology, especially the field of Web page security technology; resource; extract the target script in the response web resource, and extract the target script characteristic of the target script; match the target script characteristic with the original script characteristic stored in the database, and detect the webpage vulnerability of the response page based on the matching result. No need to modify the client java script interpreter, and no need to modify the web application, just based on the way of matching the target script characteristics of the target script identified from the response web resources with the original script characteristics, it can detect web page vulnerabilities, easy to operate and convenient fast.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the application will be set forth in the description which follows, and, in part, will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.
图1为本申请实施例提供的一种应用场景示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种网页漏洞检测方法流程图;Fig. 2 is a flow chart of a web page vulnerability detection method provided by the embodiment of the present application;
图3为本申请实施例提供的一种网页漏洞检测的示意图;FIG. 3 is a schematic diagram of a web page vulnerability detection provided by an embodiment of the present application;
图4为本申请实施例提供的一种网页资源模板示意图;FIG. 4 is a schematic diagram of a web page resource template provided by an embodiment of the present application;
图5为本申请实施例提供的另一种网页漏洞检测具体实现方法流程图;FIG. 5 is a flow chart of another specific implementation method for web page vulnerability detection provided by the embodiment of the present application;
图6为本申请实施例提供的一种网页漏洞检测装置结构图;FIG. 6 is a structural diagram of a web page vulnerability detection device provided by an embodiment of the present application;
图7为本申请实施例提供的一种计算设备结构图。FIG. 7 is a structural diagram of a computing device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及有益效果更加清楚明白,以下将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,并不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and beneficial effects of the application clearer, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments It is only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
以下对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。Part of the terms used in the embodiments of the present application are explained below to facilitate the understanding of those skilled in the art.
XSS(Cross Site Scripting,跨站脚本漏洞)是一种经常出现在Web应用中的计算机安全漏洞,也是Web中对主流的攻击方式。XSS攻击是指通过特殊手段往网页中插入了恶意的JavaScript脚本,从而在用户浏览网页时,对用户客户端发起Cookie资料窃取、会话劫持、钓鱼欺骗等各种攻击。XSS (Cross Site Scripting, cross-site scripting vulnerability) is a computer security vulnerability that often appears in Web applications, and it is also a mainstream attack method on the Web. XSS attacks refer to inserting malicious JavaScript scripts into web pages through special means, so that when users browse web pages, various attacks such as cookie data theft, session hijacking, phishing and deception are launched on user clients.
CRSF(Cross-site Request Forgery,跨站请求伪造)是一种挟制用户在当前已登录的Web应用上执行非本意的操作的攻击方法。CRSF (Cross-site Request Forgery, cross-site request forgery) is an attack method that coerces users to perform unintended operations on the currently logged-in web application.
DOM(Document Object Model,文件对象模型)是操作HTML的一个手段,可以完成HTML文档中所有元素的获取,访问,标签属性和样式的设置操作。DOM (Document Object Model, file object model) is a means of operating HTML, which can complete the acquisition, access, label attributes and style setting operations of all elements in HTML documents.
下面对本申请实施例的设计思想进行简要介绍。The following briefly introduces the design idea of the embodiment of the present application.
随着web技术越来越广泛,许多应用程序通过Web平台来进行应用与部署,并且在客户端使用脚本语言来提高应用程序的响应时间、交互性和Web服务器上的开销。但是大量的用户交互行为也会为系统带来一定的风险。如果不对脚本输入输出接口进行特定的安全防护(包括解码、过滤等),可能会导致XSS和CSRF等严重的安全隐患,造成用户会话劫持、客户端cookie窃取、网络钓鱼等安全问题。在没有网页安全知识储备的前提下很难发现web端的网络安全漏洞,并进行分类与改进。另外在移动互联网时代,除了传统的XSS、CSRF等安全问题之外,又时常遭遇网络劫持、非法调用Hybrid API等新型安全问题。当然,客户端自身也在不断在进化和发展,不断引入CSP、Same-Site Cookies等新技术来增强安全性,但是仍存在很多潜在的威胁,需要不断进行“查漏补缺”,克服越来越多的黑客攻击。As web technology becomes more and more widespread, many applications are applied and deployed through the web platform, and scripting languages are used on the client side to improve the response time, interactivity and overhead of the web server of the application. However, a large number of user interaction behaviors will also bring certain risks to the system. If there is no specific security protection (including decoding, filtering, etc.) for script input and output interfaces, it may lead to serious security risks such as XSS and CSRF, and cause security problems such as user session hijacking, client cookie theft, and phishing. It is difficult to find network security vulnerabilities on the web side without a reserve of web security knowledge, and to classify and improve them. In addition, in the mobile Internet era, in addition to traditional security issues such as XSS and CSRF, new security issues such as network hijacking and illegal calls to Hybrid APIs are often encountered. Of course, the client itself is also constantly evolving and developing, and new technologies such as CSP and Same-Site Cookies are constantly being introduced to enhance security. Lots of hacking.
一般的网站前端渗透测试是基于JavaScript进行开发,功能比较单一且操作复杂,并且现有的基于JavaScript的XSS攻击渗透测试方法受到许多限制:首先,基于客户端的XSS攻击检测方法需要修改客户端java脚本解释器实现,以只执行合法的脚本代码。其次,大多数方法都需要源代码插装,这意味着web应用程序实现需要修改,插入一些注释或分隔符,以区分良性和恶意的JavaScript代码。General website front-end penetration testing is developed based on JavaScript, which has single functions and complex operations, and the existing JavaScript-based XSS attack penetration testing methods are subject to many limitations: First, the client-based XSS attack detection method needs to modify the client-side java script The interpreter is implemented to only execute legal script code. Second, most methods require source code instrumentation, which means that the web application implementation needs to be modified to insert some comments or delimiters to distinguish between benign and malicious JavaScript code.
有鉴于此,本申请实施例根据Node.js兼具的DOM操作和I/O、文件读写、操作数据库(服务器端)等能力在web中具有的优势,实现了一种网页漏洞检测与攻击的方法,操作简单,方便快捷的进行网页安全漏洞检测。且该方法能够自动爬取并存储网站资源;并根据漏洞分析规则,在Node服务器定义漏洞探测方法,该漏洞探测方法中包括基于Node.js特性使用哈希算法定义漏洞提取函数从而检测分析代码漏洞并进行漏洞分类分级,从而产生安全测试攻击代码并进行代码注入的方法,还包括进行安全测试演练,将漏洞检测获取的信息返回到Node服务器的日志管理组件,分析日志文件,以进行攻击结果分析,具有漏洞攻击一体化、灵活性强、低延迟与低耦合等优点,能够快速适配目标网页,检测安全漏洞,提醒管理者系统中存在的漏洞。In view of this, the embodiment of the present application implements a webpage vulnerability detection and attack based on the advantages of Node. The method is easy to operate, convenient and quick to detect webpage security vulnerabilities. And this method can automatically crawl and store website resources; and according to the vulnerability analysis rules, define a vulnerability detection method on the Node server. The vulnerability detection method includes using a hash algorithm to define a vulnerability extraction function based on Node.js characteristics to detect and analyze code vulnerabilities And classify and classify the vulnerabilities, so as to generate security test attack codes and perform code injection. It also includes conducting security test drills, returning the information obtained by vulnerability detection to the log management component of the Node server, and analyzing log files to analyze the attack results. , which has the advantages of integrated vulnerability attack, strong flexibility, low latency and low coupling, etc., can quickly adapt to the target webpage, detect security vulnerabilities, and remind the administrator of the loopholes in the system.
在介绍完本申请实施例的设计思想之后,下面对本申请设置的应用场景进行简要说明。需要说明的是,以下场景仅用于说明本申请实施例而非限定。在具体实施时,可以根据实际需要灵活地应用本申请实施例提供的技术方案。After introducing the design idea of the embodiment of the present application, the following briefly describes the application scenarios set in the present application. It should be noted that the following scenarios are only used to illustrate the embodiments of the present application rather than limit them. During specific implementation, the technical solutions provided by the embodiments of the present application may be flexibly applied according to actual needs.
参考图1,图1为本申请实施例提供的一种应用场景示意图,该应用场景中包括终端设备110和服务器120,终端设备110与服务器120之间可以通过通信网络进行通信。Referring to FIG. 1, FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. The application scenario includes a
在一种可选的实施方式中,通信网络可以是有线网络或无线网络。因此,终端设备110和服务器120可以通过有线或无线通信方式进行直接或间接地连接。比如,终端设备110可以通过无线接入点与服务器120间接地连接,或发终端设备110通过因特网与服务器120直接地连接,本申请在此不做限制。In an optional implementation manner, the communication network may be a wired network or a wireless network. Therefore, the
在本申请实施例中,终端设备110包括但不限于手机、平板电脑、笔记本电脑、台式电脑、电子书阅读器、智能语音交互设备、智能家电、车载终端等设备;终端设备上可以安装有各种客户端,该客户端可以是应用程序(例如浏览器、游戏软件等),也可以是网页、小程序等;In this embodiment of the application, the
服务器120是与终端设备110中安装的云桌面相对应的后台服务器。服务器120可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The
需要说明的是,图1所示只是举例说明,实际上终端设备110和服务器120的数量不受限制,在本申请实施例中不做具体限定。当服务器120的数量为多个时,多个服务器120可组成为一区块链,而服务器120为区块链上的节点;本申请实施例所公开的网页漏洞检测方法中涉及到的各种数据可保存于区块链上。It should be noted that what is shown in FIG. 1 is only an example, and actually the number of
本申请实施例提供的网页漏洞检测的方法可应用于项目web端安全漏洞测试系统、前端安全演练防护、护网活动攻击模拟等主要场景。The webpage vulnerability detection method provided by the embodiment of the present application can be applied to main scenarios such as project web-side security vulnerability testing system, front-end security drill protection, and network protection activity attack simulation.
其中,项目web端安全漏洞测试系统可以通过本申请实施例提供的网页漏洞检测的方法对现有项目中的web页面进行安全漏洞的扫描与攻击,自动爬取网页资源、检测代码漏洞、生成攻击代码并注入,节省了开发者自行编写漏洞测试脚本的时间成本以及学习成本,能够自动且高效的对系统中存在的前端安全漏洞进行扫描分析与攻击。Among them, the project web-side security vulnerability testing system can scan and attack the web pages in the existing project through the webpage vulnerability detection method provided by the embodiment of this application, automatically crawl webpage resources, detect code loopholes, and generate attack Code injection saves the time cost and learning cost for developers to write their own vulnerability test scripts, and can automatically and efficiently scan, analyze and attack the front-end security vulnerabilities existing in the system.
通过对于XSS与CSRF攻击的攻击特点进行分析,并且基于本申请实施例提供的网页漏洞检测的方法利用Node.js的高并发低延迟特性,可以延伸设计出web端的实时安全攻防演练系统。By analyzing the attack characteristics of XSS and CSRF attacks, and using the high concurrency and low delay characteristics of Node.js based on the web page vulnerability detection method provided by the embodiment of the present application, a real-time security attack and defense exercise system on the web side can be extended and designed.
护网活动攻击模拟场景中,通过本申请实施例提供的网页漏洞检测的方法可以模拟护网活动的攻击行为,对集团网站进行网络安全漏洞的自测自查,提前预警,及时修复安全漏洞。同时,未来可延申加入防护模块,自动检测与攻防一体相结合。In the network protection activity attack simulation scenario, the method for web page vulnerability detection provided by the embodiment of this application can simulate the attack behavior of the network protection activity, conduct self-test and self-examination of network security vulnerabilities on the group website, early warning, and timely repair of security vulnerabilities. At the same time, it can be extended to add a protection module in the future, combining automatic detection with attack and defense integration.
在本申请的具体实施方式中,涉及到网页信息、用户信息等相关的数据,当本申请以上实施例运用到具体产品或技术中时,需要获得许可或者同意,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。In the specific implementation of this application, data related to webpage information, user information, etc. are involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent must be obtained, and the collection, use and Processing needs to comply with relevant laws, regulations and standards of relevant countries and regions.
基于上述应用场景,下面结合上述描述的应用场景,根据附图来描述本申请示例性实施方式提供的网页漏洞检测方法,需要注意的是,上述应用场景仅是为了便于理解本申请的精神和原理而示出,本申请的实施方式在此方面不受任何限制。Based on the above application scenarios, the web page vulnerability detection method provided by the exemplary embodiments of the present application will be described below in combination with the above described application scenarios according to the accompanying drawings. It should be noted that the above application scenarios are only for the convenience of understanding the spirit and principle of the present application Rather, the embodiments of the present application are not limited in any way in this respect.
参考图2,图2为本申请实施例提供的一种网页漏洞检测方法流程图,包括如下步骤:Referring to Fig. 2, Fig. 2 is a flow chart of a web page vulnerability detection method provided by the embodiment of the present application, including the following steps:
步骤S200,接收网页访问指令,获取相应响应页面的响应网页资源。Step S200, receiving a webpage access instruction, and obtaining a response webpage resource of a corresponding response page.
步骤S201,提取响应网页资源中的目标脚本,并提取目标脚本的目标脚本特性;Step S201, extracting the target script in the response web resource, and extracting the target script characteristics of the target script;
在本申请实施例中,利用第一脚本提取器(JavaScript Extractor)从响应网页资源中提取目标脚本,以及利用第一特征提取器(Features Extractor)从目标脚本中提取目标脚本特征。In the embodiment of the present application, the first script extractor (JavaScript Extractor) is used to extract the target script from the response webpage resource, and the first feature extractor (Features Extractor) is used to extract the target script features from the target script.
在一种可能的实现方式中,利用哈希算法提取目标脚本中包含的第一方法定义和第一调用签名,并将第一方法定义和第一调用签名作为目标脚本特性。In a possible implementation manner, a hash algorithm is used to extract the first method definition and the first calling signature included in the target script, and the first method definition and the first calling signature are used as characteristics of the target script.
步骤S202,将目标脚本特性与数据库中存储的原始脚本特性进行匹配,并基于匹配结果,检测响应页面的网页漏洞。Step S202, matching the target script characteristics with the original script characteristics stored in the database, and based on the matching result, detecting webpage vulnerabilities of the response page.
即,将响应页面的目标脚本特性与数据库中存储的原始脚本特性进行偏差对比;其中,数据库包含有三个表组成,分别为页面表、脚本表和特性表;其中,页面表中包含Web应用程序的所有URL页面以及每个页面中脚本的数量;脚本表中包含脚本标识符,脚本编号,脚本漏洞类型,它的内容页URL也是该脚本的类型;特性表中包含从每个脚本的方法定义和调用签名中提取出的所有原始脚本特性。也就是说,本申请实施例中,数据库存储有脚本编号与原始脚本特性、漏洞类型以及漏洞等级的对应关系。That is, compare the target script characteristics of the response page with the original script characteristics stored in the database; wherein, the database consists of three tables, which are page table, script table and feature table; among them, the page table contains Web application All URL pages and the number of scripts in each page; the script table contains the script identifier, script number, script vulnerability type, and its content page URL is also the type of the script; the feature table contains the method definition from each script and all original script properties extracted from the call signature. That is to say, in the embodiment of the present application, the database stores the corresponding relationship between the script number and the original script characteristic, vulnerability type and vulnerability level.
在一种可能的实现方式中,基于匹配结果,检测响应页面的页面漏洞时:若匹配结果用于表征目标脚本特性与原始脚本特性匹配,则说明响应页面的目标脚本与数据库中存储的脚本编号相同,将数据库中存储的与原始脚本特性匹配的漏洞类型,作为响应页面的页面漏洞的目标漏洞类型;并基于目标漏洞类型生成对应脚本漏洞的漏洞测试代码,将生成的漏洞测试代码进行漏洞注入,在目标对象访问目标网页时,对埋点漏洞进行测试,获得测试结果,并将测试结果存储至Node服务器的日志管理组件中;其中,测试结果包括漏洞测试代码的运行情况和目标对象信息。In a possible implementation, based on the matching result, when detecting the page vulnerability of the response page: if the matching result is used to indicate that the target script feature matches the original script feature, then it indicates that the target script of the response page matches the script number stored in the database Similarly, the vulnerability type stored in the database that matches the characteristics of the original script is used as the target vulnerability type of the page vulnerability in the response page; and the vulnerability test code corresponding to the script vulnerability is generated based on the target vulnerability type, and the generated vulnerability test code is used for vulnerability injection. , when the target object visits the target webpage, test the buried vulnerability, obtain the test result, and store the test result in the log management component of the Node server; wherein, the test result includes the running status of the vulnerability test code and the target object information.
在本申请实施例中,将生成的漏洞测试代码进行漏洞注入时可采用常见的存储型XSS注入,也可以在内联脚本中注入。In the embodiment of the present application, the common stored XSS injection can be used for vulnerability injection of the generated vulnerability test code, or it can be injected in an inline script.
在内联脚本中注入时,可采用如下方式:When injecting in an inline script, the following methods can be used:
在HTML中内嵌的文本中,以script标签形成注入漏洞测试代码,在内联的JavaScript中,拼接的数据突破了原本的限制(字符串,变量,方法名等);In the text embedded in HTML, the injection vulnerability test code is formed by the script tag, and in the inline JavaScript, the spliced data breaks through the original limit (string, variable, method name, etc.);
在标签属性中,以其他属性或者标签注入漏洞测试代码,漏洞测试代码包含引号,从而突破属性值的限制。在标签的href、src等属性中,包含JavaScript等可执行代码;In the tag attribute, inject the vulnerability test code with other attributes or tags, and the vulnerability test code contains quotation marks, so as to break through the limitation of the attribute value. Include executable code such as JavaScript in the href, src and other attributes of the tag;
在onload()、onerror()、onclick()等用户输入或点击的交互事件中,注入漏洞测试代码;Inject the vulnerability test code in the interactive events of user input or click such as onload(), onerror(), onclick();
在style属性和标签中,注入漏洞测试代码;style属性和标签中包含类似background-image:url("JavaScript:...")的代码,可以生成CSRF攻击,因为image style的src属性可以忽略同源政策的限制(新版本客户端已经可以防范)。Inject the vulnerability test code into the style attribute and label; the style attribute and label contain code similar to background-image:url("JavaScript:..."), which can generate CSRF attacks, because the src attribute of the image style can ignore the same Restriction of the source policy (the new version of the client can already prevent it).
在本申请实施例中,埋点存储在目标客户端服务器,用户登陆访问目标服务器并读取到测试代码,从而遭受到攻击。In the embodiment of this application, the buried point is stored in the target client server, and the user logs in to access the target server and reads the test code, thereby being attacked.
在一种可能的实现方式中,在Node服务器部署日志管理组件,用于记录漏洞测试代码的运行情况与目标对象信息,从而进行网站漏洞分析。其中:In a possible implementation, a log management component is deployed on the Node server to record the running status of the vulnerability test code and target object information, so as to analyze the website vulnerability. in:
配置后端联调环境,配置MySQL数据库作为日志管理组件,并使用K/V键值对进行数据的缓存,效率高,运行速度快。Configure the back-end joint debugging environment, configure the MySQL database as the log management component, and use K/V key-value pairs to cache data, which is efficient and fast.
将拦截用户请求并返回的Attack-Time,Attack-Spot,用户cookie以及get/post请求内容(其中get请求直接读取URL,post请求则读取body-Query)等返回到Node服务器并存入日志管理组件,同时检测日志文件,对网站存在的漏洞进行分类分级处理。参考图3,图3为本申请实施例提供的一种网页漏洞检测的示意图。Return the Attack-Time, Attack-Spot, user cookie and get/post request content (where the get request directly reads the URL, and the post request reads the body-Query) to the Node server and store them in the log The management component detects log files at the same time, and classifies and grades the vulnerabilities existing in the website. Referring to FIG. 3 , FIG. 3 is a schematic diagram of web page vulnerability detection provided by an embodiment of the present application.
在另一种可能的实现方式中,若匹配结果用于表征目标脚本特性与原始脚本特性不匹配,则说明响应页面的目标脚本与数据库中存储的脚本编号不相同,并确定响应页面不存在页面漏洞。In another possible implementation, if the matching result is used to indicate that the characteristics of the target script do not match the characteristics of the original script, it means that the target script of the response page is different from the script number stored in the database, and it is determined that there is no page in the response page loophole.
需要说明的是,有可能是有新的注入脚本导致的脚本编号不同,也可能是有新的现有方法调用导致的脚本编号不同;因此在确定脚本编号不同的情况下,应该确定方法调用者来区分原始的和响应的方法调用者,以确定导致脚本编号不同的原因,并做进一步分析。It should be noted that the script number may be different due to a new injected script, or the script number may be different due to a new existing method call; therefore, when the script number is determined to be different, the method caller should be determined to distinguish between the original and the responding method callers to determine the cause of the different script numbers for further analysis.
在本申请实施例中,为了保证网页漏洞检测的准确性,设置训练阶段和检测阶段,训练阶段是检测阶段的初始化阶段,用于确定数据库中存储的脚本编号与原始脚本特性、漏洞类型以及漏洞等级的对应关系,以便检测阶段使用;检测阶段用于网页漏洞的检测,涉及到特性提取、漏洞分类以及漏洞测试代码生成注入等步骤,具体可参见图2和图3所示的内容。In the embodiment of the present application, in order to ensure the accuracy of web page vulnerability detection, a training phase and a detection phase are set. The training phase is the initialization phase of the detection phase, and is used to determine the script number stored in the database and the characteristics of the original script, the type of the vulnerability, and the vulnerability The corresponding relationship between levels is used in the detection stage; the detection stage is used for web page vulnerability detection, which involves steps such as feature extraction, vulnerability classification, and vulnerability test code generation and injection. For details, see Figure 2 and Figure 3.
为了实现本申请的网页漏洞检测方法,首先进行Node服务器部署。示例性的,配置Node环境,利用包管理系统API下载相关的资源包,其中资源包包括:爬虫工具包、URL模块资源包、fs模块资源包;即在Node服务器中配置爬虫工具、URL模块以及fs模块。In order to realize the web page vulnerability detection method of the present application, Node server deployment is firstly performed. Exemplary, configure the Node environment, and use the package management system API to download related resource packages, wherein the resource packages include: crawler toolkit, URL module resource package, fs module resource package; that is, configure the crawler tool, URL module and fs module.
在本申请实施例中,网页爬虫使用的是puppeteer,它是一个通过DevTools协议控制headless Chrome的Node库,可模仿用户行为进行客户端操作。URL模块是内置的Node资源库,可进行网页URL的获取与读写。fs模块是Node的文件读写模块。因此,利用puppeteer爬虫包与fs模块对目标网站进行资源的异步爬虫与复制。In the embodiment of this application, the web crawler uses puppeteer, which is a Node library that controls headless Chrome through the DevTools protocol, and can imitate user behavior for client operations. The URL module is a built-in Node resource library, which can obtain, read and write web page URLs. The fs module is Node's file read and write module. Therefore, use the puppeteer crawler package and the fs module to asynchronously crawl and copy the resources of the target website.
在本申请实施例中,利用爬虫工具对网站资源和网站下包含的所有网页资源进行资源爬取,示例性的,使用async()/await()函数对选定网站资源进行异步爬取,利用puppeteer.Launch(),browser.newPage(),browser.close()等API进行客户端操作,获取网站资源。使用page()方法选定特定的href的地址,前往指定网站,直接获取对应的网页资源,或通过再次使用page.goto方法进入,再调用page.evaluate()处理逻辑,获取指定网站下的网页资源。In the embodiment of this application, the crawler tool is used to crawl the resources of the website resources and all the webpage resources contained in the website. Exemplarily, the async()/await() function is used to crawl the selected website resources asynchronously. APIs such as puppeteer.Launch(), browser.newPage(), browser.close() perform client operations to obtain website resources. Use the page() method to select a specific href address, go to the specified website, and directly obtain the corresponding webpage resource, or use the page.goto method again to enter, and then call page.evaluate() to process the logic to obtain the webpage under the specified website resource.
在获取网站资源和网站下网页的网页资源后,将获得的资源,采用fs.writeFile()写操作,存储至fs模块中通过fs.mkdir()创建的文件存储空间。After obtaining the website resources and the webpage resources of the webpages under the website, use the fs.writeFile() write operation to store the obtained resources into the file storage space created by fs.mkdir() in the fs module.
本申请实施例中,爬虫获取资源是为了检测分析网页中常见的漏洞类型,以便检测阶段使用。In the embodiment of the present application, the crawler acquires resources to detect and analyze common types of vulnerabilities in web pages, so as to be used in the detection stage.
因此,使用Node的fs模块API对网页资源进行读取,通过关键字的正则进行循环查找,判断漏洞类型。Therefore, use Node's fs module API to read webpage resources, and use the regularization of keywords to search in a loop to determine the type of vulnerability.
示例性的,使用Spider组件,利用fs.readFile()遍历fs模块中存储的文件目录,读取文件,选取待监督检测网页URL对应的指定网页资源,即提取前端爬取的执行网页资源,如图4所示,为本申请实施例提供的一种网页资源模板示意图。Exemplarily, use the Spider component, use fs.readFile() to traverse the file directory stored in the fs module, read the file, select the specified webpage resource corresponding to the URL of the webpage to be supervised and detected, that is, extract the execution webpage resource crawled by the front end, such as FIG. 4 is a schematic diagram of a webpage resource template provided by the embodiment of the present application.
在获取到网页资源后,利用第二脚本提取器(script Extractor)从指定网页资源中提取合法脚本,并为合法脚本赋予脚本编号,并分析合法脚本的源代码,对合法脚本的源代码进行漏洞检测,确定漏洞类型;示例性的,采用正则关键字匹配查找如textArea、contenteditable、img等关键字,基于关键字与漏洞类型的映射关系,确定合法脚本对应的漏洞类型;漏洞类型主要包括:内联脚本、本地源插入、远程源插入、handler事件处理、URL属性。After obtaining the webpage resource, use the second script extractor (script Extractor) to extract the legal script from the specified webpage resource, and assign the script number to the legal script, and analyze the source code of the legal script, and find out the source code of the legal script. Detect and determine the vulnerability type; for example, use regular keyword matching to find keywords such as textArea, contenteditable, img, etc., and determine the vulnerability type corresponding to the legal script based on the mapping relationship between the keyword and the vulnerability type; the vulnerability types mainly include: Linked scripts, local source insertion, remote source insertion, handler event processing, URL attributes.
在获得漏洞类型后,还需确定漏洞类型属于哪一脚本,或哪一脚本特性具有该漏洞类型,因此,本申请实施例中,利用第二特征提取器(Features Extractor)进行代码特征提取分析,该步骤的主要作用是利用哈希算法提取合法脚本代码中包含的原始脚本特性。由于页面上的脚本数量不足以确定是否有注入脚本,也无法确定脚本出现在页面上的位置。为此,从合法脚本中提取第二方法定义和第二调用签名作为合法脚本的原始脚本特性。示例性的,利用Node解析器提取方法名、参数、其实现的散列代码和参数。其中,方法定义分为三类:用户定义的命名函数、匿名方法和主机对象方法重写。每种类型提取的特性是:方法名、形参的数量和它的实参,以及要由函数执行的代码的散列。通常有两种调用JavaScript函数的类型:简单函数和嵌套函数;其中,简单类型是当函数带有自变量时调用,嵌套类型是指函数参数是另一个函数。添加了对象调用者特性来解决方法调用注入攻击,从而提取不同脚本的攻击特性。After obtaining the vulnerability type, it is also necessary to determine which script the vulnerability type belongs to, or which script characteristic has the vulnerability type. Therefore, in the embodiment of the present application, the second feature extractor (Features Extractor) is used to extract and analyze the code features. The main function of this step is to use the hash algorithm to extract the original script characteristics contained in the legal script code. Since the amount of scripts on the page is insufficient to determine whether a script has been injected, it is also impossible to determine where the script appears on the page. To this end, the second method definition and the second call signature are extracted from the legal script as original script characteristics of the legal script. Exemplarily, a Node parser is used to extract method names, parameters, hash codes of its implementation, and parameters. Among them, method definitions are divided into three categories: user-defined named functions, anonymous methods, and host object method overrides. The features extracted for each type are: the method name, the number of formal parameters and its actual parameters, and a hash of the code to be executed by the function. There are usually two types of calling JavaScript functions: simple functions and nested functions; among them, the simple type is called when the function has an argument, and the nested type means that the function parameter is another function. Added object caller feature to address method call injection attacks to extract attack features from different scripts.
最后,基于所述合法脚本的脚本编号、合法脚本的漏洞类型,以及合法脚本的原始脚本特性,确定脚本编号对应的原始脚本特性、漏洞类型并存储至数据库中。Finally, based on the script number of the legal script, the vulnerability type of the legal script, and the original script characteristics of the legal script, the original script characteristics and vulnerability types corresponding to the script number are determined and stored in the database.
参考图5,图5为本申请实施例提供的另一种网页漏洞检测的具体实现方法流程图;从图5中可知:Referring to Fig. 5, Fig. 5 is a flow chart of another specific implementation method of webpage vulnerability detection provided by the embodiment of the present application; as can be seen from Fig. 5:
在训练阶段,首先爬虫获取选定网页资源,再利用script Extractor从爬虫获取的选定网页资源中提取合法脚本,接着利用Features Extractor对合法脚本进行特性提取获取原始脚本特性,以及分析合法脚本中的关键字,确定漏洞类型,最后将漏洞类型和原始脚本特性存储至数据库中;In the training phase, the crawler first obtains the selected webpage resources, and then uses the script Extractor to extract legal scripts from the selected webpage resources obtained by the crawler, and then uses the Features Extractor to extract the features of the legal scripts to obtain the original script features, and analyzes the legal scripts. Keywords to determine the type of vulnerability, and finally store the type of vulnerability and the characteristics of the original script in the database;
在检测阶段,获取响应页面,利用Javascript Extractor从响应页面中提取目标脚本,利用Features Extractor对目标脚本进行特性提取获取目标脚本特性,接着将目标脚本特性与数据库中存储的原始脚本特性进行比较,判断是否存在偏差,若存在偏差,则进行漏洞类型分析,并基于漏洞类型生成漏洞测试代码进行漏洞注入,若不存在偏差,则服务器正常响应。In the detection phase, obtain the response page, use Javascript Extractor to extract the target script from the response page, use Features Extractor to extract the characteristics of the target script to obtain the characteristics of the target script, and then compare the characteristics of the target script with the characteristics of the original script stored in the database to judge Whether there is a deviation, if there is a deviation, analyze the type of vulnerability, and generate a vulnerability test code based on the type of vulnerability for vulnerability injection, if there is no deviation, the server responds normally.
本申请具有如下效果:This application has the following effects:
1、打破传统的安全漏洞攻击开发系统使用JavaScript进行开发,功能单一,联调数据库操作复杂。而Node.js拓展了JavaScript的功能,使之兼具I/O、fs等只有语言才有的特性,能够同时具有DOM操作和I/O、文件读写、操作数据库(服务器端)等能力。因此在I/O密集型的web开发操作中,使用node具有独到的优势。1. Breaking the traditional security vulnerability attack development system uses JavaScript for development, which has a single function, and the joint debugging database operation is complicated. Node.js expands the functions of JavaScript, so that it has I/O, fs and other features that are unique to languages, and can simultaneously have DOM operations and I/O, file reading and writing, and database (server-side) operations. Therefore, in I/O-intensive web development operations, using node has unique advantages.
2、进行安全测试时,一般是开发者编写测试脚本进行漏洞的检测,过程繁琐且耗费时间,通过设计一个基于Node.js的网页漏洞检测方法,自动进行代码的爬取、检测、分类、攻击,实现检测攻击一体化,并设有日志管理系统,实时收集并存储漏洞攻击日志,从而全方位的进行网站的安全漏洞检测。2. When conducting security testing, developers usually write test scripts to detect vulnerabilities. The process is cumbersome and time-consuming. By designing a Node.js-based webpage vulnerability detection method, code crawling, detection, classification, and attacks are automatically performed. , to realize the integration of detection and attack, and has a log management system to collect and store vulnerability attack logs in real time, so as to conduct comprehensive website security vulnerability detection.
3、代码检测阶段分为训练和检测两个阶段,训练阶段利用哈希算法定义漏洞提取函数从而检测分析代码漏洞并进行分类,通过将响应页面的提取目标脚本特性与数据库存储的原始脚本特性进行偏差比对,确定是否存在漏洞,操作简单。3. The code detection stage is divided into two stages: training and detection. In the training stage, the hash algorithm is used to define the vulnerability extraction function to detect, analyze and classify code vulnerabilities. By comparing the extracted target script characteristics of the response page with the original script characteristics stored in the database Deviation comparison, to determine whether there are loopholes, easy to operate.
4、现有的主流防攻击方法是对用户交互组件进行严格的校验,不允许输入html标签与内联js语句等,本申请实施例提供的方法可以通过Node去主动去对一个有缺陷的网站进行攻击。4. The existing mainstream anti-attack method is to strictly verify the user interaction components, and does not allow the input of html tags and inline js statements. The website is attacked.
基于同一发明构思,本申请实施例还提供了一种网页漏洞检测装置600,如图6所示,该网页漏洞检测装置600包括:Based on the same inventive concept, the embodiment of the present application also provides a webpage vulnerability detection device 600, as shown in Figure 6, the webpage vulnerability detection device 600 includes:
接收单元601,用于接收网页访问指令,获取相应响应页面的响应网页资源;The receiving unit 601 is configured to receive a webpage access instruction, and obtain a response webpage resource of a corresponding response page;
提取单元602,用于提取响应网页资源中的目标脚本,并提取目标脚本的目标脚本特性;An extracting unit 602, configured to extract the target script in the response web resource, and extract the target script characteristics of the target script;
匹配检测单元603,用于将目标脚本特性与数据库中存储的原始脚本特性进行匹配,并基于匹配结果,检测响应页面的网页漏洞。The matching detection unit 603 is configured to match the characteristics of the target script with the characteristics of the original script stored in the database, and detect webpage vulnerabilities of the response page based on the matching result.
在一种可能的实现方式中,提取单元602具体用于:In a possible implementation manner, the extracting unit 602 is specifically configured to:
利用哈希算法,从目标脚本中提取第一方法定义和第一调用签名,并将第一方法定义和第一调用签名作为目标脚本特性。The hash algorithm is used to extract the first method definition and the first calling signature from the target script, and use the first method definition and the first calling signature as the characteristics of the target script.
在一种可能的实现方式中,匹配检测单元603具体用于:In a possible implementation manner, the matching detection unit 603 is specifically configured to:
若匹配结果用于表征目标脚本特性与原始脚本特性匹配,则将数据库中存储的与原始脚本特性匹配的漏洞类型,作为响应页面的页面漏洞的目标漏洞类型;If the matching result is used to indicate that the target script feature matches the original script feature, the vulnerability type stored in the database that matches the original script feature is used as the target vulnerability type of the page vulnerability of the response page;
若匹配结果用于表征目标脚本特性与原始脚本特性不匹配,则确定响应页面不存在页面漏洞。If the matching result is used to indicate that the characteristics of the target script do not match the characteristics of the original script, it is determined that there is no page vulnerability in the response page.
在一种可能的实现方式中,匹配检测单元603还用于:In a possible implementation manner, the matching detection unit 603 is also configured to:
将数据库中存储的与原始脚本特性匹配的漏洞类型,作为响应页面的页面漏洞的目标漏洞类型之后,针对目标漏洞类型,采用配置的漏洞测试代码进行漏洞注入,对响应页面的埋点漏洞进行测试,获得测试结果;其中,测试结果包括漏洞测试代码的运行情况和目标对象信息;After the vulnerability type stored in the database that matches the characteristics of the original script is used as the target vulnerability type of the page vulnerability of the response page, according to the target vulnerability type, the configured vulnerability test code is used to perform vulnerability injection to test the embedded vulnerability of the response page , to obtain test results; wherein, the test results include the running status of the vulnerability test code and target object information;
将测试结果存储至Node服务器的日志管理组件中。Store the test results in the log management component of the Node server.
在一种可能的实现方式中,匹配检测单元603具体用于:In a possible implementation manner, the matching detection unit 603 is specifically configured to:
在超文本标记语言HTML中内嵌的文本中,采用配置的漏洞测试代码以标签形成漏洞注入;或In the text embedded in the hypertext markup language HTML, using the configured vulnerability test code to form a vulnerability injection as a tag; or
在输入或点击的交互事件中,采用配置的漏洞测试代码进行漏洞注入。In the input or click interaction event, the configured vulnerability test code is used for vulnerability injection.
在一种可能的实现方式中,数据库中存储有脚本编号,以及脚本编号对应的原始脚本特性、漏洞类型以及漏洞等级。In a possible implementation manner, the script number, and the original script characteristic, vulnerability type and vulnerability level corresponding to the script number are stored in the database.
在一种可能的实现方式中,脚本编号对应的原始脚本特性、漏洞类型是通过如下方式确定的:In a possible implementation, the original script characteristics and vulnerability types corresponding to the script number are determined in the following manner:
通过Node服务器中部署的爬虫工具,获取选定网站资源,其中,选定网站资源中包括网站资源以及网站下包含的指定网页资源;Obtain selected website resources through the crawler tool deployed in the Node server, where the selected website resources include website resources and specified webpage resources contained under the website;
从选定网站资源中,选取待监督检测网页URL对应的指定网页资源;From the selected website resources, select the specified web resource corresponding to the URL of the web page to be supervised and detected;
从选取的指定网页资源中提取合法脚本,并为合法脚本赋予脚本编号;Extract legal scripts from the selected specified web resources, and assign script numbers to the legal scripts;
采用正则关键字匹配查找方式,确定合法脚本中包含的关键字,并基于关键字与漏洞类型的映射关系,确定合法脚本对应的漏洞类型;Use the regular keyword matching search method to determine the keywords contained in the legal script, and determine the corresponding vulnerability type of the legal script based on the mapping relationship between the keyword and the vulnerability type;
利用哈希算法,从合法脚本中提取第二方法定义和第二调用签名,将第二方法定义和第二调用签名,作为合法脚本的原始脚本特性;Extracting the second method definition and the second call signature from the legal script by using a hash algorithm, and using the second method definition and the second call signature as original script characteristics of the legal script;
基于合法脚本的脚本编号、合法脚本的漏洞类型,以及合法脚本的原始脚本特性,确定脚本编号对应的原始脚本特性、漏洞类型。Based on the script number of the legal script, the vulnerability type of the legal script, and the original script characteristics of the legal script, determine the original script characteristic and vulnerability type corresponding to the script number.
为了描述的方便,以上各部分按照功能划分为各单元(或模块)分别描述。当然,在实施本申请时可以把各单元(或模块)的功能在同一个或多个软件或硬件中实现。For the convenience of description, the above parts are divided into units (or modules) according to their functions and described separately. Of course, the functions of each unit (or module) can be implemented in one or more pieces of software or hardware when implementing the present application.
在介绍了本申请示例性实施方式的网页漏洞检测方法及装置后,接下来介绍本申请的另一示例性实施方式计算设备。After introducing the web page vulnerability detection method and device of the exemplary embodiment of the present application, another exemplary embodiment of the present application is introduced next, the computing device.
所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art can understand that various aspects of the present application can be implemented as a system, method or program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, that is: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as "circuit", "module" or "system".
在一种可能的实现方式中,本申请实施例提供的计算设备可以至少包括处理器和存储器。其中,存储器存储有程序代码,当程序代码被处理器执行时,使得处理器执行本申请中各种示例性实施方式的网页漏洞检测方法中的任一步骤。In a possible implementation manner, the computing device provided in the embodiment of the present application may at least include a processor and a memory. Wherein, the memory stores program codes, and when the program codes are executed by the processor, the processor is made to execute any step in the method for detecting web page vulnerabilities in various exemplary embodiments of the present application.
在该实施例中,计算设备的结构可以如图7所示,包括:包括存储器701,通讯模块703以及一个或多个处理器702。In this embodiment, the structure of the computing device may be as shown in FIG. 7 , including: a
存储器701,用于存储处理器702执行的计算机程序。存储器701可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统,以及运行即时通讯功能所需的程序等;存储数据区可存储各种即时通讯信息和操作指令集等。The
存储器701可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器701也可以是非易失性存储器(non-volatilememory),例如只读存储器,快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);或者存储器701是能够用于携带或存储具有指令或数据结构形式的期望的计算机程序并能够由计算机存取的任何其他介质,但不限于此。存储器701可以是上述存储器的组合。The
处理器702,可以包括一个或多个中央处理单元(central processing unit,CPU)或者为数字处理单元等等。处理器702,用于调用存储器701中存储的计算机程序时实现上述网页漏洞检测方法。The
通讯模块703用于与终端设备和其他服务器进行通信。The
本申请实施例中不限定上述存储器701、通讯模块703和处理器702之间的具体连接介质。本申请实施例在图7中以存储器701和处理器702之间通过总线704连接,总线704在图7中以粗线描述,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。总线704可以分为地址总线、数据总线、控制总线等。为便于描述,图7中仅用一条粗线描述,但并不描述仅有一根总线或一种类型的总线。The embodiment of the present application does not limit the specific connection medium among the
存储器701中存储有计算机存储介质,计算机存储介质中存储有计算机可执行指令,计算机可执行指令用于实现本申请实施例的网页漏洞检测方法。处理器702用于执行上述的网页漏洞检测方法。A computer storage medium is stored in the
在一些可能的实施方式中,本申请提供的网页漏洞检测方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在计算机设备上运行时,程序代码用于使计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的网页漏洞检测方法中的步骤。In some possible implementations, various aspects of the web page vulnerability detection method provided in this application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to use The computer device executes the steps in the method for detecting web page vulnerabilities according to various exemplary embodiments of the present application described above in this specification.
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。A program product may take the form of any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
本申请的实施方式的网页漏洞检测的程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在计算装置上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被命令执行系统、装置或者器件使用或者与其结合使用。The program product for web page vulnerability detection according to the embodiment of the present application may adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and may run on a computing device. However, the program product of the present application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with a command execution system, device or device.
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由命令执行系统、装置或者器件使用或者与其结合使用的程序。A readable signal medium may include a data signal carrying readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium, other than a readable storage medium, that can transmit, propagate, or transport a program for use by or in conjunction with a command execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算装置上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算装置上部分在远程计算装置上执行、或者完全在远程计算装置或服务器上执行。在涉及远程计算装置的情形中,远程计算装置可以通过任意种类的网络包括局域网(LAN)或广域网(WAN)连接到用户计算装置,或者,可以连接到外部计算装置(例如利用因特网服务提供商来通过因特网连接)。Program codes for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming Language - such as "C" or similar programming language. The program code may execute entirely on the user computing device, partly on the user device, as a stand-alone software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or server to execute. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connected via the Internet).
应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。It should be noted that although several units or subunits of the apparatus are mentioned in the above detailed description, this division is only exemplary and not mandatory. Actually, according to the embodiment of the present application, the features and functions of two or more units described above may be embodied in one unit. Conversely, the features and functions of one unit described above may be further divided to be embodied by a plurality of units.
此外,尽管在附图中以特定顺序描述了本申请方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。In addition, while operations of the methods of the present application are depicted in the figures in a particular order, there is no requirement or implication that these operations must be performed in that particular order, or that all illustrated operations must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序命令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序命令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的命令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program commands. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a machine An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序命令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的命令产生包括命令装置的制造品,该命令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising command means, the order The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序命令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的命令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, whereby the The commands provide steps for implementing the functions specified in the flowchart flow or flow and/or block diagram block or blocks.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While preferred embodiments of the present application have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, the appended claims are intended to be construed to cover the preferred embodiment and all changes and modifications which fall within the scope of the application.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211663405.4A CN115987638A (en) | 2022-12-23 | 2022-12-23 | A webpage vulnerability detection method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211663405.4A CN115987638A (en) | 2022-12-23 | 2022-12-23 | A webpage vulnerability detection method, device, equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115987638A true CN115987638A (en) | 2023-04-18 |
Family
ID=85973467
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211663405.4A Pending CN115987638A (en) | 2022-12-23 | 2022-12-23 | A webpage vulnerability detection method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115987638A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118631583A (en) * | 2024-07-18 | 2024-09-10 | 杭州孝道科技有限公司 | Web application vulnerability association method, system, electronic device and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101741645A (en) * | 2009-12-17 | 2010-06-16 | 成都市华为赛门铁克科技有限公司 | Method, device and system for detecting storage-type cross-site scripting attack and attack detector |
| CN104200166A (en) * | 2014-08-05 | 2014-12-10 | 杭州安恒信息技术有限公司 | Script-based website vulnerability scanning method and system |
| CN107103243A (en) * | 2017-05-11 | 2017-08-29 | 北京安赛创想科技有限公司 | The detection method and device of leak |
| KR20180075881A (en) * | 2016-12-27 | 2018-07-05 | 한국인터넷진흥원 | Method and Apparatus for Analyzing Web Vulnerability for Client-side |
| CN114329466A (en) * | 2021-12-17 | 2022-04-12 | 深圳萨摩耶数字科技有限公司 | Cross-site script vulnerability attack detection method and system |
-
2022
- 2022-12-23 CN CN202211663405.4A patent/CN115987638A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101741645A (en) * | 2009-12-17 | 2010-06-16 | 成都市华为赛门铁克科技有限公司 | Method, device and system for detecting storage-type cross-site scripting attack and attack detector |
| CN104200166A (en) * | 2014-08-05 | 2014-12-10 | 杭州安恒信息技术有限公司 | Script-based website vulnerability scanning method and system |
| KR20180075881A (en) * | 2016-12-27 | 2018-07-05 | 한국인터넷진흥원 | Method and Apparatus for Analyzing Web Vulnerability for Client-side |
| CN107103243A (en) * | 2017-05-11 | 2017-08-29 | 北京安赛创想科技有限公司 | The detection method and device of leak |
| CN114329466A (en) * | 2021-12-17 | 2022-04-12 | 深圳萨摩耶数字科技有限公司 | Cross-site script vulnerability attack detection method and system |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118631583A (en) * | 2024-07-18 | 2024-09-10 | 杭州孝道科技有限公司 | Web application vulnerability association method, system, electronic device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11601462B2 (en) | Systems and methods of intelligent and directed dynamic application security testing | |
| US10243679B2 (en) | Vulnerability detection | |
| CN105940654B (en) | Privileged statically hosted web application | |
| US9712560B2 (en) | Web page and web browser protection against malicious injections | |
| US9509714B2 (en) | Web page and web browser protection against malicious injections | |
| CN106022135A (en) | Automatic detection system capable of dynamically determining XSS vulnerability | |
| CN104992117B (en) | The anomaly detection method and behavior model method for building up of HTML5 mobile applications | |
| CN105303109A (en) | Malicious code information analysis method and system | |
| Wang et al. | A new cross-site scripting detection mechanism integrated with HTML5 and CORS properties by using browser extensions | |
| CN116340943A (en) | Application program protection method, device, equipment, storage medium and program product | |
| WO2019225216A1 (en) | Determination method, determination device and determination program | |
| EP4717017A1 (en) | Data privacy inconsistency detection | |
| Yin et al. | Scanner++: Enhanced vulnerability detection of web applications with attack intent synchronization | |
| Barua et al. | Server side detection of content sniffing attacks | |
| Xie et al. | JTaint: finding privacy-leakage in chrome extensions | |
| CN104375935B (en) | The test method and device of SQL injection attack | |
| Liu et al. | A XSS vulnerability detection approach based on simulating browser behavior | |
| CN115987638A (en) | A webpage vulnerability detection method, device, equipment and storage medium | |
| US20230177166A1 (en) | Security Vulnerability Detection | |
| US20250298902A1 (en) | Multimodal large language model (llm)-based threat modeling | |
| Zhao et al. | Large-scale detection of privacy leaks for BAT browsers extensions in China | |
| Fu et al. | Malicious attacks on the web and crawling of information data by Python technology | |
| CN110851840A (en) | WEB backdoor detection method and device based on website vulnerability | |
| CN116389122A (en) | An attack detection method, device, medium and machine based on abnormal state | |
| Liu et al. | The {DOMino} Effect: Detecting and Exploiting {DOM} Clobbering Gadgets via Concolic Execution with Symbolic {DOM} |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |