[go: up one dir, main page]

CN103336693B - The creation method of refer chain, device and security detection equipment - Google Patents

The creation method of refer chain, device and security detection equipment Download PDF

Info

Publication number
CN103336693B
CN103336693B CN201310279974.3A CN201310279974A CN103336693B CN 103336693 B CN103336693 B CN 103336693B CN 201310279974 A CN201310279974 A CN 201310279974A CN 103336693 B CN103336693 B CN 103336693B
Authority
CN
China
Prior art keywords
page
level
url
node
level page
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.)
Active
Application number
CN201310279974.3A
Other languages
Chinese (zh)
Other versions
CN103336693A (en
Inventor
肖鹏
郑劲松
刘起
符云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201310279974.3A priority Critical patent/CN103336693B/en
Publication of CN103336693A publication Critical patent/CN103336693A/en
Application granted granted Critical
Publication of CN103336693B publication Critical patent/CN103336693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种refer链的创建方法、装置及安全检测设备。其中方法包括:在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点;在监控到第i级页面的访问请求后,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL;以及,查询包含第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点;通过本步骤创建refer链的各级节点。通过该技术方案,能够在页面访问的同时实时地获取由各级页面的URL组成的refer链,使得客户端可以利用该refer链检测当前页面的访问行为是否安全。

The invention discloses a refer chain creation method, device and safety detection equipment. The method includes: after monitoring the access request of the initial page, generating the page ID of the initial page, obtaining the URL of the initial page, and creating the first-level node of the refer chain; after monitoring the access request of the i-th level page, generating the first-level node The page ID of the i-level page, obtain the URL of the i-level page and the page ID or URL of the i-1 level page; and query the refer chain containing the page ID or URL of the i-1 level page, and create the refer chain The i-th level node of ; create all levels of nodes of the refer chain through this step. Through this technical solution, a refer chain composed of URLs of pages at various levels can be obtained in real time while the page is accessed, so that the client can use the refer chain to detect whether the access behavior of the current page is safe.

Description

refer链的创建方法、装置及安全检测设备Refer chain creation method, device and safety detection equipment

技术领域technical field

本发明涉及计算机网络技术领域,具体涉及一种refer链的创建方法、装置及安全检测设备。The invention relates to the technical field of computer networks, in particular to a refer chain creation method, device and safety detection equipment.

背景技术Background technique

随着互联网的发展,基于WEB的应用日益普及,人们通过浏览器可以查询银行账户、网上购物、电子商务、查询信息、获取知识、进行娱乐等,WEB为人们提供了方便和快捷的交互方式。With the development of the Internet, WEB-based applications are becoming more and more popular. People can query bank accounts, online shopping, e-commerce, query information, acquire knowledge, and perform entertainment through browsers. WEB provides people with a convenient and fast way of interaction.

然而,人们在上网冲浪浏览网页的同时,经常会遭遇到恶意网站的侵袭,导致计算机被病毒、木马等感染。However, when people are surfing the Internet and browsing the web, they often encounter attacks from malicious websites, causing computers to be infected by viruses, Trojan horses, and the like.

恶意网站,例如钓鱼网站、或者是欺诈,仿冒网站等,主要是通过仿冒真实网站的URL地址或是页面内容,伪装成银行及电子商务等类型的网站,或是利用真实网站服务器程序上的漏洞,在该网站的某些网页中插入危险的网页代码,以此来骗取用户银行或信用卡账号、密码等私人资料。恶意网页中包含着许多敏感的特征,例如,金融欺诈类的恶意网页会在文字、图片等方面仿冒官网,或是在真实网页中插入虚假票务、虚假中奖、假冒网银、虚假购物等信息,这些特征大多以文本串的形式出现在网页中。Malicious websites, such as phishing websites, fraudulent websites, counterfeit websites, etc., mainly fake the URL addresses or page content of real websites, pretend to be banking and e-commerce websites, or use loopholes in real website server programs , inserting dangerous webpage codes into some webpages of the website to defraud users of private information such as bank or credit card account numbers and passwords. Malicious webpages contain many sensitive features. For example, malicious webpages related to financial fraud will imitate the official website in terms of text and pictures, or insert information such as fake ticketing, fake lottery winning, fake online banking, and fake shopping into real webpages. Features mostly appear in web pages in the form of text strings.

目前对恶意网页识别的方法,主要是通过人工审核恶意网页,以收集一些简单的恶意网站的文本特征,供浏览器插件依据这些文本特征对网页内容进行判断,过滤掉这些已报告的攻击网站。但是,现今恶意网站的存活期越来越短,新的恶意网页层出不穷,需要审核的网页量太大;并且恶意网站的特征变化加快,按照传统的人工审核的方式,提取信息的效率会比较低。The current method for identifying malicious webpages is mainly to manually review malicious webpages to collect text features of some simple malicious websites, which are used by browser plug-ins to judge webpage content based on these text features, and filter out these reported attack websites. However, the survival period of malicious websites is getting shorter and shorter, new malicious webpages emerge in endlessly, and the amount of webpages that need to be reviewed is too large; and the characteristics of malicious websites are changing rapidly. According to the traditional manual review method, the efficiency of extracting information will be relatively low. .

现有的为了防范恶意网站的主要手段是当用户访问某网站时,客户端将网站的URL发送至服务器端的黑白名单数据库进行查询,所谓的黑名单数据库即是已审核确认的恶意网站的URL名单数据库,所谓的白名单数据库即是已审核确认的安全网站的URL。服务器端经过查询后,将网站是否属于恶意网站的结果反馈给客户端。The existing main means to prevent malicious websites is that when a user visits a certain website, the client sends the URL of the website to the black and white list database on the server side for query. The so-called blacklist database is the URL list of malicious websites that have been verified and confirmed. Database, the so-called white list database is the URL of the safe website that has been audited and confirmed. After querying, the server will feed back the result of whether the website is a malicious website to the client.

上述现有的技术手段仅能针对单一的URL进行检测。但是由于目前恶意网站的URL不断变化,服务器端的黑白名单数据库的更新速度远不及恶意网站的变化速度快,因此针对单一的URL进行检测的技术手段不能有效的检测出恶意网站,因而不能实时快速有效地保护客户端的网页浏览安全。The above existing technical means can only detect a single URL. However, because the URLs of malicious websites are constantly changing, the update speed of the black and white list database on the server side is far slower than that of malicious websites. Therefore, the technical means of detecting a single URL cannot effectively detect malicious websites, so it cannot be real-time, fast and effective. Protect the client's web browsing security.

现有的浏览器提供了获取URL的refer信息的接口,即get_refer接口。但是,通过get_refer接口所获取的refer信息仅包含在访问当前网页之前上一次所访问的网页的URL,通过当前网页的URL和上一次所访问的网页的URL也不能有效的检测出恶意网站。并且,从一个网页打开至get_refer接口可以使用需要较长的时间,如果等到get_refer接口可以使用后再去进行检测所需花费的时间过长,对于用户来说就需要等待很长的时间才能得到当前访问的网页的检测结果,因此按照该方法不能实时快速的保护客户端的网页浏览安全。Existing browsers provide an interface for obtaining refer information of a URL, that is, a get_refer interface. However, the refer information obtained through the get_refer interface only includes the URL of the webpage visited last time before the current webpage is accessed, and malicious websites cannot be effectively detected through the URL of the current webpage and the URL of the webpage visited last time. Moreover, it takes a long time to open a web page until the get_refer interface is available. If it takes too long to perform detection after the get_refer interface is available, it will take a long time for the user to get the current Therefore, according to this method, the webpage browsing security of the client cannot be protected in real time and quickly.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的refer链的创建方法和相应的refer链的创建装置和安全检测设备。In view of the above problems, the present invention is proposed to provide a method for creating a refer chain, a corresponding device for creating a refer chain, and a security detection device that overcome the above problems or at least partially solve the above problems.

根据本发明的一个方面,提供了一种refer链的创建方法,包括:According to one aspect of the present invention, a method for creating a refer chain is provided, including:

在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将所述初始页面的页面ID和URL作为第1级节点的信息写入refer链;After monitoring the access request of the initial page, generate the page ID of the initial page, obtain the URL of the initial page, create the first-level node of the refer chain, and write the page ID and URL of the initial page as the information of the first-level node Enter the refer chain;

在监控到第i级页面的访问请求后,i≥2,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,所述第i级页面是第i-1级页面的页面级跳转页面;以及,查询包含所述第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将所述第i级页面的页面ID和URL作为第i级节点的信息;通过本步骤创建所述refer链的各级节点。After monitoring the access request of the i-th level page, i≥2, generate the page ID of the i-th level page, obtain the URL of the i-th level page and the page ID or URL of the i-1th level page, the i-th level The page is a page-level jump page of the i-1th level page; and, query the refer chain containing the page ID or URL of the i-1th level page, create the i-th level node of the refer chain, and convert the i-th level The page ID and URL of the i-level page are used as the information of the i-level node; through this step, all levels of nodes of the refer chain are created.

根据本发明的另一方面,提供了一种refer链的创建装置,包括:According to another aspect of the present invention, a device for creating a refer chain is provided, including:

第一节点创建单元,适于在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将所述初始页面的页面ID和URL作为第1级节点的信息写入refer链;The first node creation unit is suitable for generating the page ID of the initial page after monitoring the access request of the initial page, obtaining the URL of the initial page, creating a first-level node of the refer chain, and combining the page ID and URL of the initial page Write the refer chain as the information of the first-level node;

第二节点创建单元,适于在监控到第i级页面的访问请求后,i≥2,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,所述第i级页面是第i-1级页面的页面级跳转页面;以及,查询包含所述第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将所述第i级页面的页面ID和URL作为第i级节点的信息;The second node creation unit is adapted to generate the page ID of the i-level page after monitoring the access request of the i-level page, and obtain the URL of the i-level page and the page ID of the i-1-th level page or URL, the i-th level page is the page-level jump page of the i-1th level page; The i-level node uses the page ID and URL of the i-level page as the information of the i-level node;

所述第二节点创建单元适于创建所述refer链的各级节点。The second node creation unit is adapted to create nodes at all levels of the refer chain.

根据本发明的另一方面,提供了一种安全检测设备,包括上述refer链的创建装置,还包括:检测模块,适于利用所述refer链所包含的所有URL,对页面的访问行为进行处理。According to another aspect of the present invention, there is provided a security detection device, including the above-mentioned refer chain creation device, and also includes: a detection module, adapted to use all URLs contained in the refer chain to process the page access behavior .

根据本发明提供的创建refer链的方法、装置及安全检测设备,每当通过初始页面的各级链接打开新页面时,获取新页面的页面ID和URL以及新页面的上一级页面的页面ID或URL,根据该上一级页面的页面ID或URL查询对应的refer链,创建refer链的对应节点。通过该技术方案,能够在页面访问的同时实时地获取由各级页面的URL组成的refer链,使得客户端可以利用该refer链检测当前页面的访问行为是否安全。According to the method, device and safety detection device for creating a refer chain provided by the present invention, whenever a new page is opened through the links of all levels of the initial page, the page ID and URL of the new page and the page ID of the upper-level page of the new page are obtained or URL, query the corresponding refer chain according to the page ID or URL of the upper-level page, and create the corresponding node of the refer chain. Through this technical solution, a refer chain composed of URLs of pages at various levels can be obtained in real time while the page is accessed, so that the client can use the refer chain to detect whether the access behavior of the current page is safe.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的创建refer链的方法的流程图;Fig. 1 shows a flowchart of a method for creating a refer chain according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的创建refer链的装置的结构框图;FIG. 2 shows a structural block diagram of an apparatus for creating a refer chain according to an embodiment of the present invention;

图3示出了根据本发明一个实施例的作为安全检测设备的客户端与服务器交互的结构框图。Fig. 3 shows a structural block diagram of interaction between a client as a security detection device and a server according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

浏览器需要将用户所要访问或其可能访问网页的网址信息,发送至过滤模块;其中,该网址信息包括浏览网页的网址、浏览网页网址中的部分内容、用户收藏夹的网址、收藏夹中网址的部分内容等,以下将其统称为网址信息。The browser needs to send the URL information of the webpage that the user wants to visit or may visit to the filtering module; wherein, the URL information includes the URL of the browsed webpage, part of the content of the browsed webpage URL, the URL of the user's favorites, and the URLs in the favorites Part of the content, etc., hereinafter collectively referred to as URL information.

现有的浏览器提供了获取URL的refer信息的接口,即get_refer接口。但是,通过get_refer接口所获取的refer信息仅包含在访问当前页面之前上一次所访问的页面的URL,即链接到当前页面的前一级页面的URL;并且,从一个页面打开至get_refer接口可以使用需要较长的时间,如果等到get_refer接口可以使用后再去进行检测所需花费的时间过长。为了能够实时获取由各级页面的URL组成的refer链,本发明提供了创建refer链的方法,该方法具体为:每当通过初始页面的各级链接打开新页面时,负责维护refer链的进程获取新页面的页面ID和URL以及新页面的上一级页面的页面ID或URL,根据该上一级页面的页面ID或URL查询对应的refer链,创建refer链的对应节点。Existing browsers provide an interface for obtaining refer information of a URL, that is, a get_refer interface. However, the refer information obtained through the get_refer interface only includes the URL of the page visited last time before visiting the current page, that is, the URL of the previous page linked to the current page; and, opening from a page to the get_refer interface can use It takes a long time. If you wait until the get_refer interface is available, it will take too long to perform detection. In order to obtain the refer chain composed of URLs of pages at all levels in real time, the present invention provides a method for creating a refer chain, which specifically includes: whenever a new page is opened through the links of all levels of the initial page, the process of maintaining the refer chain Obtain the page ID and URL of the new page and the page ID or URL of the upper-level page of the new page, query the corresponding refer chain according to the page ID or URL of the upper-level page, and create the corresponding node of the refer chain.

通常,在用户打开浏览器后,浏览器访问默认的初始页面或者通过用户在地址栏的输入触发初始页面的访问请求,通过用户在初始页面上点击链接或者其它链接方式由初始页面链接到第2级页面,通过用户在第2级页面上点击链接或者其它链接方式由第2级页面链接到第3级页面,依此类推,最后由第i-1级页面链接到第i级页面。举例来说,用户打开浏览器后在地址栏输入www.so.com,该页面就是初始页面(下面用A来表示其URL);然后,用户在搜索栏输入“话费充值”,点击搜索按钮,浏览器会跳到http://www.so.com/s?ie=utf-8&src=360sou_home&q=%E8%AF%9D%E8%B4%B9%E5%85%85%E5%80%BC,该页面为第2级页面(下面用B来表示其URL);第2级页面提供了很多链接,用户点击其中一个链接,浏览器会跳到此链接对应的页面http://chongzhi.360.cn/mobile/,该页面为第3级页面(下面用C来表示其URL);用户在第3级页面上点击“网游点卡”链接,浏览器会跳到http://chongzhi.360.cn/GameCard/index,该页面为第4级页面(下面用D来表示其URL)。对于当前用户正在访问的页面,其refer信息为该当前页面的父页面的URL,即链接到该当前页面的前一级页面的URL。本发明根据链接到当前页面的若干级页面的URL得到refer链,该refer链可用于对网页访问行为进行处理。Usually, after the user opens the browser, the browser accesses the default initial page or triggers the initial page access request through the user's input in the address bar, and the initial page is linked to the second page by the user clicking a link on the initial page or other links. The level page is linked from the level 2 page to the level 3 page through the user clicking a link on the level 2 page or other link methods, and so on, and finally the i-1 level page is linked to the i level page. For example, after the user opens the browser and enters www.so.com in the address bar, this page is the initial page (the URL is represented by A in the following); then, the user enters "phone recharge" in the search bar and clicks the search button, The browser will jump to http://www.so.com/s?ie=utf-8&src=360sou_home&q=%E8%AF%9D%E8%B4%B9%E5%85%85%E5%80%BC, This page is a second-level page (B is used to indicate its URL below); the second-level page provides many links, and the user clicks one of the links, and the browser will jump to the page corresponding to this link http://chongzhi.360. cn/mobile/, this page is the third-level page (C is used to represent its URL below); the user clicks the link of "online game point card" on the third-level page, and the browser will jump to http://chongzhi.360. cn/GameCard/index, this page is a level 4 page (D is used below to represent its URL). For the page that the current user is visiting, its refer information is the URL of the parent page of the current page, that is, the URL of the previous page linked to the current page. The present invention obtains the refer chain according to the URLs of several levels of pages linked to the current page, and the refer chain can be used to process the web page access behavior.

图1示出了根据本发明一个实施例的创建refer链的方法100的流程图。如图1所示,方法100始于第1级节点创建步骤S101。在第1级节点创建步骤S101中,在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将初始页面的页面ID和URL作为第1级节点的信息写入refer链。针对浏览器访问的默认页面或通过用户在地址栏的输入触发访问的页面,将其作为初始页面,创建一个新的refer链。具体地,浏览器监控到初始页面的访问请求后,会加载该初始页面。在加载初始页面的过程中,浏览器生成一个唯一的ID作为该初始页面的页面ID,并且获取初始页面的URL。其中初始页面的URL可通过指定响应事件接口来获取,例如通过实现标准插件机制的指定响应事件接口来获取。Fig. 1 shows a flowchart of a method 100 for creating a refer chain according to an embodiment of the present invention. As shown in FIG. 1 , the method 100 starts at step S101 of creating a first-level node. In the first-level node creation step S101, after monitoring the access request of the initial page, generate the page ID of the initial page, obtain the URL of the initial page, create the first-level node of the refer chain, and combine the page ID and URL of the initial page It is written into the refer chain as the information of the first-level node. For the default page accessed by the browser or the page triggered by the user's input in the address bar, use it as the initial page and create a new refer chain. Specifically, after monitoring the access request of the initial page, the browser loads the initial page. During the process of loading the initial page, the browser generates a unique ID as the page ID of the initial page, and obtains the URL of the initial page. Wherein, the URL of the initial page may be obtained by specifying a response event interface, for example, by implementing a specified response event interface of a standard plug-in mechanism.

在IE(InternetExplorer)浏览器中使用浏览器辅助对象(BrowserHelperObject,简称:BHO)插件机制,通过响应“BeforeNavigate2”事件可以获取IE当前加载的URL。在火狐(Firefox)浏览器中使用火狐扩展机制提供的指定响应事件接口,获取火狐浏览器当前加载的URL。在谷歌(chrome)浏览器中使用网景插件应用程序编程接口(NetscapePluginApplicationProgrammingInterface,简称:NPAPI)插件机制,获取谷歌浏览器当前加载的URL。在获取初始页面的页面ID(如ID1)和URL(如A)后,将ID1和A作为该refer链的第1级节点的信息,创建refer链为:A(ID1)。其中,ID1为索引信息。In the IE (Internet Explorer) browser, the browser helper object (BrowserHelperObject, referred to as: BHO) plug-in mechanism can be used to obtain the currently loaded URL of IE by responding to the "BeforeNavigate2" event. In the Firefox browser, use the specified response event interface provided by the Firefox extension mechanism to obtain the URL currently loaded by the Firefox browser. Use the Netscape Plugin Application Programming Interface (NPAPI for short) plug-in mechanism in the Google (chrome) browser to obtain the URL currently loaded by the Google browser. After obtaining the page ID (such as ID1) and URL (such as A) of the initial page, use ID1 and A as the first-level node information of the refer chain, and create a refer chain as: A(ID1). Wherein, ID1 is index information.

需要说明的是,由于实际应用中,人们使用计算机的应用环境,如操作系统、浏览器类型等的不尽相同,因此,前述各个步骤的执行主体也可以有多种实现方式。例如可以是一种带有识别及添加标记功能的浏览器,其中,浏览器可以是Windows操作系统自带的浏览器InternetExplorer(简称IE),以及其他第三方浏览器。所谓第三方浏览器,通常指在Windows操作系统上运行的非IE的浏览器软件,这类第三方浏览器通常会因其有着针对用户的丰富的独特功能设计和个性化扩展,为用户提供了许多方便的应用。例如,同样的插件机制可以运行于多种类型的浏览器,例如,浏览器为IE、firefox、googlechrome、safari、opera、QQ浏览器、遨游浏览器、搜狗浏览器或猎豹浏览器等等。It should be noted that, since in actual applications, people use computers with different application environments, such as operating systems, browser types, etc., therefore, there may be multiple implementations for the executing entities of the foregoing steps. For example, it may be a browser with the function of identifying and adding tags, wherein the browser may be Internet Explorer (IE for short) which is a built-in browser of the Windows operating system, or other third-party browsers. The so-called third-party browsers usually refer to non-IE browser software running on the Windows operating system. Such third-party browsers usually provide users with rich and unique function designs and personalized extensions for users. Many handy apps. For example, the same plug-in mechanism can run on multiple types of browsers, for example, the browsers are IE, firefox, google chrome, safari, opera, QQ browser, Aoyou browser, Sogou browser or Cheetah browser and so on.

在第1级节点创建步骤S101之后,方法100进入循环创建第i级节点的过程。从i=2开始,方法100进入步骤S102,其中在监控到第i级页面的访问请求后,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,第i级页面是第i-1级页面的页面级跳转页面。本文将通过用户在第i-1级页面上点击链接或者其它用户行为触发的链接方式由第i-1级页面链接到第i级页面称为页面级跳转。在浏览器监控到经过页面级跳转的第i级页面的访问请求后,会加载第i级页面。在加载第i级页面的过程中,浏览器生成一个唯一的ID作为该第i级页面的页面ID,并且获取第i级页面的URL。其中第i级页面的URL可通过指定响应事件接口来获取,例如通过实现标准插件机制的指定响应事件接口来获取。具体方式可参见前面关于如何获取初始页面的URL的相关描述。After the first-level node creation step S101, the method 100 enters into the process of creating the i-th level node in a loop. Starting from i=2, the method 100 enters step S102, wherein after monitoring the access request of the i-th level page, the page ID of the i-th level page is generated, and the URL of the i-th level page and the page of the i-1th level page are obtained ID or URL, the i-th level page is the page-level redirection page of the i-1 level page. In this article, linking from the i-1th level page to the i-th level page by clicking on a link on the i-1th level page or by other user actions is called page-level jumping. After the browser monitors the access request of the i-th level page through the page-level jump, it will load the i-th level page. During the process of loading the i-th level page, the browser generates a unique ID as the page ID of the i-th level page, and obtains the URL of the i-th level page. Wherein, the URL of the i-th level page can be obtained by specifying a response event interface, for example, by implementing a specified response event interface of a standard plug-in mechanism. For specific methods, refer to the previous description about how to obtain the URL of the initial page.

为了查找到相应的refer链并在其上继续创建节点,在步骤S102中还需要获取第i-1级页面的页面ID或URL。本发明针对浏览器访问新页面的不同情况提供了两种不同的方式来获取第i-1级页面的信息,一种方式(即下述方式一)适用于通过新窗口或新标签(tab)页打开第i级页面的情况;另一种方式(即下述方式二)适用于仍通过当前窗口或当前标签页打开第i级页面的情况。In order to find the corresponding refer chain and continue to create nodes on it, in step S102 it is also necessary to obtain the page ID or URL of the i-1th level page. The present invention provides two different ways to obtain the information of the i-1th level page according to the different situations of the browser accessing the new page, one way (i.e. the following way 1) is applicable to the new window or new tab (tab) The situation where the i-level page is opened by the first page; the other method (i.e. the second method below) is applicable to the situation that the i-level page is still opened through the current window or the current tab page.

方式一:method one:

首先,在监控到第i级页面的访问请求后,获取第i级页面的接口对象指针,根据接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID。然后,在加载第i级页面的过程中,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的页面ID。First, after monitoring the access request of the i-th level page, obtain the interface object pointer of the i-th level page, and write the interface object of the i-th level page according to the interface object pointer to the interface object of the i-th level page. Get the page ID of the i-1th level page. Then, in the process of loading the i-th level page, the page ID of the i-1 level page is obtained by reading the information provided by the interface object of the i-th level page.

上述方式一适用于通过新窗口或新标签(tab)页打开第i级页面的情况。以IE浏览器为例,通过分析IE浏览器打开新窗口或新tab页,找到IE浏览器内部模块创建的新窗口或新tab页所调用的相关处理函数,捕获(Hook)该函数,利用该函数的返回值获取新窗口或新tab页(将要加载第i级页面的窗口或tab页)的接口对象指针,如IWEBBROWSER2指针;由于此时浏览器还未开始加载第i级页面,浏览器所记录的当前页面的页面ID还是在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID,因此,此时浏览器可根据该接口对象指针向IWEBBROWSER2对象写入第i-1级页面的页面ID。在开始加载第i级页面之后,通过读取第i级页面的IWEBBROWSER2对象所提供的信息,就可以获取第i-1级页面的页面ID。The above method 1 is applicable to the situation that the i-th level page is opened through a new window or a new tab (tab) page. Taking IE browser as an example, by analyzing IE browser to open a new window or new tab page, find the relevant processing function called by the new window or new tab page created by the internal module of IE browser, capture (Hook) this function, and use this The return value of the function obtains the interface object pointer of the new window or new tab page (the window or tab page that will load the i-level page), such as the IWEBBROWSER2 pointer; since the browser has not started loading the i-level page at this time, the browser’s The recorded page ID of the current page is still the page ID of the i-1th level page obtained during the loading of the i-1th level page. Therefore, at this time, the browser can write the IWEBBROWSER2 object to the IWEBBROWSER2 object according to the interface object pointer. The page ID of the page at level i-1. After starting to load the i-th level page, the page ID of the i-1 level page can be obtained by reading the information provided by the IWEBBROWSER2 object of the i-th level page.

方式二:Method 2:

在监控到第i级页面的访问请求之后并在加载第i级页面之前,通过浏览器提供的get_locationURL接口获取第i-1级页面的URL。After monitoring the access request of the i-level page and before loading the i-level page, obtain the URL of the i-1 level page through the get_locationURL interface provided by the browser.

上述方式二适用于仍通过当前窗口或当前标签页打开第i级页面的情况。在这种情况下,由于没有打开新窗口或新标签页,所以不能够采用与方式一类似的方式获取第i-1级页面的页面ID。针对这种情况,在监控到第i级页面的访问请求之后,但在第i级页面的“BeforeNavigate2”事件之前,get_locationURL接口所提供的仍然还是第i-1级页面的URL,因此利用get_locationURL接口可以获取第i-1级页面的URL。The second method above is applicable to the situation that the i-th level page is still opened through the current window or the current tab page. In this case, since no new window or new tab page is opened, the page ID of the i-1th level page cannot be obtained in a manner similar to the first method. In this case, after monitoring the access request of the i-level page, but before the "BeforeNavigate2" event of the i-level page, the get_locationURL interface still provides the URL of the i-1 level page, so use the get_locationURL interface The URL of the i-1 level page can be obtained.

但是,在通过浏览器提供的get_locationURL接口获取第i-1级页面的URL的步骤之后还需要判断是否由浏览器地址栏的输入行为触发打开第i级页面,具体地,可以通过根据浏览器地址栏的点击和输入动作来判断;若判断结果为是,则将通过浏览器提供的get_locationURL接口获取的第i-1级页面的URL清空,将第i级页面作为初始页面进行处理,执行步骤S101;若判断结果为否,执行步骤S103。However, after the step of obtaining the URL of the i-1th level page through the get_locationURL interface provided by the browser, it is necessary to determine whether the opening of the i-th level page is triggered by the input behavior of the browser address bar. Specifically, according to the browser address If the judgment result is yes, clear the URL of the i-1th level page obtained through the get_locationURL interface provided by the browser, process the i-th level page as the initial page, and execute step S101 ; If the judgment result is no, execute step S103.

上述方式一和方式二分别针对不同的情况。如果第i级页面是通过新窗口或新标签页打开的,那么步骤S102通过上述方式一获得第i-1级页面的页面ID;如果第i级页面是通过当前窗口或当前标签页打开的,那么步骤S102通过上述方式二获得第i-1级页面的URL。如果步骤S102获得的是第i-1级页面的页面ID,那么后续则根据该页面ID查询对应的refer链;如果步骤S102获得的是第i-1级页面的URL,那么后续则根据该URL查询对应的refer链。The above method 1 and method 2 are respectively aimed at different situations. If the i-th level page is opened through a new window or a new tab page, step S102 obtains the page ID of the i-1th level page through the above method 1; if the i-th level page is opened through a current window or a current tab page, Then step S102 obtains the URL of the i-1th level page through the second method above. If step S102 obtains the page ID of the i-1th level page, then follow up to query the corresponding refer chain according to the page ID; if step S102 obtains the URL of the i-1th level page, then follow up according to the URL Query the corresponding refer chain.

在步骤S102之后,方法100进入步骤S103,其中查询包含第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将第i级页面的页面ID和URL作为第i级节点的信息。After step S102, the method 100 proceeds to step S103, wherein the refer chain containing the page ID or URL of the i-1th level page is queried, the i-th level node of the refer chain is created, and the page ID and URL of the i-th level page are used as The information of the i-level node.

具体地,如果在步骤S102中,采用上述方式一获取得到第i-1级页面的页面ID,那么直接查询包含第i-1级页面的页面ID的refer链即可。例如,如果通过步骤S102得到第2级页面的页面ID为ID2,URL为B,以及第1级页面(就是初始页面)的页面ID为ID1,则在本步骤中,查询包含ID1的refer链,并且该refer链的最后一级节点的索引信息为ID1,即A(ID1);创建该refer链的第2级节点,将ID2和B作为第2级节点的信息,得到refer链为A(ID1)->B(ID2)。如果在步骤S102中,采用上述方式二获取得到第i-1级页面的URL,那么则需要查询包含第i-1级页面的URL的refer链。由于维护refer链的进程有可能维护有多条包含相同URL的refer链,所以本步骤有可能查询得到多条包含第i-1级页面的URL的refer链。但是,由于在上述方式二所适用的仍通过当前窗口或当前标签页打开第i级页面的情况下,页面跳转的时序性良好,所以可以选择最近更新的refer链作为待创建第i级节点的refer链。Specifically, if in step S102, the page ID of the i-1th level page is acquired by the above method 1, then it is sufficient to directly query the refer chain including the page ID of the i-1th level page. For example, if the page ID of the second-level page is ID2, the URL is B, and the page ID of the first-level page (that is, the initial page) is ID1 through step S102, then in this step, query the refer chain containing ID1, And the index information of the last-level node of the refer chain is ID1, that is, A(ID1); create the second-level node of the refer chain, use ID2 and B as the information of the second-level node, and obtain the refer chain as A(ID1 )->B(ID2). If in step S102, the URL of the i-1th level page is obtained by using the second method above, then it is necessary to query the refer chain containing the URL of the i-1th level page. Since the process of maintaining the refer chain may maintain multiple refer chains containing the same URL, this step may query and obtain multiple refer chains containing the URL of the i-1th level page. However, since the timing of page jumps is good when the i-level page is still opened through the current window or the current tab page, which is applicable to the above-mentioned method 2, the latest updated refer chain can be selected as the i-level node to be created The refer chain.

可选地,在上述步骤S102的方式一中,也可以仅向第i级页面的接口对象写入第i-1级页面的URL,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的URL。接着,在步骤S103中,查询包含第i-1级页面的URL的refer链,并在查询到多条refer链的情况下选择最近更新的refer链作为待创建第i级节点的refer链。但是,由于在上述方式一所适用的通过新窗口或新标签(tab)页打开第i级页面的情况下,页面跳转的时序性较差,所以根据页面ID查找refer链的方法的准确度会高于根据URL查找refer链的方法。Optionally, in the first method of step S102, it is also possible to write only the URL of the i-1th level page to the interface object of the i-th level page, and by reading the information provided by the interface object of the i-th level page, Get the URL of the i-1 level page. Next, in step S103, query the refer chain containing the URL of the i-1th level page, and select the latest updated refer chain as the refer chain of the i-th level node to be created if multiple refer chains are found. However, in the case of opening the i-th level page through a new window or a new tab (tab) page applicable to the above method 1, the timing of the page jump is poor, so the accuracy of the method of finding the refer chain based on the page ID It will be higher than the method of finding the refer chain based on the URL.

循环执行上述步骤S102和步骤S103,由此创建完整的refer链。对于上述示例,所创建的refer链为:A(ID1)->B(ID2)->C(ID3)->D(ID4)。The above step S102 and step S103 are executed cyclically, thereby creating a complete refer chain. For the above example, the created refer chain is: A(ID1)->B(ID2)->C(ID3)->D(ID4).

在创建refer链的过程中,还需要考虑到一种特殊情况,即:在访问某些页面时,该页面会发生多次自动跳转的情况,例如3xx等跳转情况,本文将这种跳转称为页面间跳转。在IE浏览器中,在访问同一个页面时BHO机制提供了三个事件,分别为BeforeNavigate2,NavigateComplete2和DocumentComplete2。在正常情况下,三个事件对应的URL都是相同的,但如果发生多次302跳转,就会发生如下情况:(BeforeNavigate2)url0->(302)url1->(302)url2->(NavigateComplete2)url2->(DocumentComplete2)url2。如果仍以上述示例为例,在访问页面C时,页面C有可能发生多次自动跳转,依次跳转到C1和C2。因此,如果发生页面间跳转的情况,依靠上述方法可能无法捕获到所有跳转页面的URL。In the process of creating the refer chain, you also need to consider a special situation, that is, when you visit certain pages, the page will automatically jump multiple times, such as 3xx and other jumps. This article will refer to this jump Turning is called jumping between pages. In IE browser, the BHO mechanism provides three events when visiting the same page, namely BeforeNavigate2, NavigateComplete2 and DocumentComplete2. Under normal circumstances, the URLs corresponding to the three events are the same, but if multiple 302 redirects occur, the following will happen: (BeforeNavigate2)url0->(302)url1->(302)url2->( NavigateComplete2) url2 -> (DocumentComplete2) url2. If the above example is still taken as an example, when page C is accessed, page C may automatically jump multiple times, jumping to C1 and C2 in turn. Therefore, if there is a jump between pages, it may not be possible to capture URLs of all the jump pages by relying on the above method.

鉴于上述特殊情况,本发明实施例在上述步骤S103之后还包括创建至少一个第i级子节点的步骤,即步骤S104,该步骤是在第i级页面发生页面间跳转的情况下执行的,其中至少一个第i级子节点对应于第i级页面的至少一个页面间跳转页面。在步骤S104中,捕获重定向处理时所调用的函数,从重定向处理时所调用的函数的输入参数中获取第i级页面的至少一个页面间跳转页面的URL;以及,查询包含第i级页面的页面ID的refer链,创建该refer链的至少一个第i级子节点,将第i级页面的页面ID和第i级页面的至少一个页面间跳转页面的URL作为至少一个第i级子节点的信息。具体地,在发生3xx等跳转情况时,浏览器会进行重定向处理,在重定向处理时浏览器会调用“Urlmon!CINet::OnRedirect”函数,该函数的输入参数就记录了页面间跳转页面的URL,通过捕获该函数,就可以获取第i级页面的至少一个页面间跳转页面的URL。将通过这种方法获得的页面间跳转页面的URL作为第i级子节点的信息,该页面间跳转页面的索引ID与第i级页面的页面ID相同。对于上述示例,所创建的refer链为:A(ID1)->B(ID2)->C(ID3)->C1(ID3)->C2(ID3)->D(ID4)。In view of the above-mentioned special circumstances, the embodiment of the present invention further includes the step of creating at least one i-th child node after the above-mentioned step S103, that is, step S104. This step is performed when an inter-page jump occurs on the i-th level page, Wherein at least one i-th child node corresponds to at least one inter-page jump page of the i-th level page. In step S104, the function called during redirection processing is captured, and the URL of at least one jump page between pages of the i-level page is obtained from the input parameters of the function called during redirection processing; and, the query includes the i-level The refer chain of the page ID of the page, create at least one i-th child node of the refer chain, and use the page ID of the i-th page and the URL of at least one jump page between pages of the i-th page as at least one i-th level Information about child nodes. Specifically, when a jump such as 3xx occurs, the browser will perform redirection processing. During the redirection processing, the browser will call the "Urlmon!CINet::OnRedirect" function, and the input parameter of this function will record the jump between pages. The URL of the redirected page. By capturing this function, the URL of at least one inter-page jump page of the i-th level page can be obtained. The URL of the inter-page jump page obtained by this method is used as the information of the i-th child node, and the index ID of the inter-page jump page is the same as the page ID of the i-th level page. For the above example, the created refer chain is: A(ID1)->B(ID2)->C(ID3)->C1(ID3)->C2(ID3)->D(ID4).

根据本发明实施例提供的创建refer链的方法,能够在页面访问的同时实时地获取由各级页面的URL组成的refer链,这样客户端可以利用该refer链检测当前页面的访问行为是否安全。具体地,客户端可以提取出refer链所包含的所有URL,然后将这些URL与自身所保存的黑/白名单数据库进行比对,得到检测结果。云安全服务器通过全网蜘蛛云安全服务器集群构建云安全服务器,并保存有恶意网址库、钓鱼网址库、广告欺诈库等,从中可以发现变动的网页和新增的网页。优选的,云安全服务器可以将提取到的特征与数据库中的危险网址信息进行匹配,以便确定该特征所属网站的安全类别及相应安全等级;其中,该网站安全类别可分为挂马网站、钓鱼网站、欺诈网站、恶意网站、安全网站等,且每一类别网站均设有相应安全等级,如安全等级从1级到10级,云安全服务器能够将该匹配到信息进行归类,并获得该匹配到信息在该类别中所处安全等级。According to the method for creating a refer chain provided by an embodiment of the present invention, a refer chain composed of URLs of pages at various levels can be obtained in real time while the page is accessed, so that the client can use the refer chain to detect whether the access behavior of the current page is safe. Specifically, the client can extract all the URLs contained in the refer chain, and then compare these URLs with the blacklist/whitelist database stored by itself to obtain the detection result. The cloud security server builds a cloud security server through the cloud security server cluster of the whole web spider, and stores a library of malicious URLs, a library of phishing URLs, a library of advertising fraud, etc., from which we can find changed webpages and newly added webpages. Preferably, the cloud security server can match the extracted features with the dangerous website information in the database, so as to determine the security category and corresponding security level of the website to which the feature belongs; Websites, fraudulent websites, malicious websites, safe websites, etc., and each type of website has a corresponding security level. For example, if the security level is from level 1 to level 10, the cloud security server can classify the matched information and obtain the Matches the security level of the information in this category.

本发明实施例中,浏览器可以根据地址栏中的网页地址连接到对应的网站,因此可以首先从浏览器的地址栏获取网页地址等信息。客户端可以在提取出refer链所包含的所有URL之后,将这些URL加密为网址密文发送给云安全服务器,在上传URL的网址密文到云安全服务器的时候,需要首先屏蔽可能带有用户密码的网址字符串,不上传此类URL。云安全服务器将这些URL与自身所保存的黑/白名单数据库进行比对,得到检测结果,然后将检测结果反馈给客户端,其反馈的结果可以包括可信、钓鱼、广告欺诈等信息,或者其他的恶意网址类型,以便用户能够根据不同的类型进行相应的处理。本发明通过实时地获取由各级页面的URL组成的refer链,利用refer链所包含的所有URL对页面的访问行为进行处理,与现有技术仅利用新页面的URL进行检测相比,由于refer链所提供的URL更多,覆盖面更广,因而检测效率更高,能够更为实时快速并有效地保护客户端网页浏览的安全性。In the embodiment of the present invention, the browser can connect to the corresponding website according to the web page address in the address bar, so information such as the web page address can be obtained first from the address bar of the browser. After extracting all the URLs contained in the refer chain, the client can encrypt these URLs into URL ciphertexts and send them to the cloud security server. URL string for password, do not upload such URLs. The cloud security server compares these URLs with the blacklist/whitelist database saved by itself, obtains the detection results, and then feeds back the detection results to the client. The feedback results can include information such as credible, phishing, and advertising fraud, or Other types of malicious URLs, so that users can deal with them according to different types. The present invention obtains in real time a refer chain composed of URLs of pages at all levels, and utilizes all URLs included in the refer chain to process page access behaviors. The link provides more URLs and wider coverage, so the detection efficiency is higher, and it can protect the security of client web browsing more quickly and effectively in real time.

图2示出了根据本发明一个实施例的创建refer链的装置的结构框图。如图2所示,该装置包括:第一节点创建单元21和第二节点创建单元22。Fig. 2 shows a structural block diagram of an apparatus for creating a refer chain according to an embodiment of the present invention. As shown in FIG. 2 , the device includes: a first node creation unit 21 and a second node creation unit 22 .

第一节点创建单元21适于在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将初始页面的页面ID和URL作为第1级节点的信息写入refer链。进一步的,第一节点创建单元21包括:初始页面的页面ID生成单元211、初始页面的URL获取单元212和第一节点创建子单元213。初始页面的页面ID生成单元211适于在监控到初始页面的访问请求后,生成初始页面的页面ID。初始页面的URL获取单元212适于在加载初始页面的过程中,通过指定响应事件接口获取当前加载的初始页面的URL。例如,通过实现标准插件机制的指定响应事件接口来获取。在IE浏览器中使用浏览器辅助对象BHO插件机制,通过响应“BeforeNavigate2”事件可以获取IE当前加载的URL。在火狐(Firefox)浏览器中使用火狐扩展机制提供的指定响应事件接口,获取火狐浏览器当前加载的URL。在谷歌(chrome)浏览器中使用NPAPI插件机制,获取谷歌浏览器当前加载的URL。第一节点创建子单元213适于创建refer链的第1级节点,将初始页面的页面ID和URL作为第1级节点的信息写入refer链。The first node creation unit 21 is adapted to generate the page ID of the initial page after monitoring the access request of the initial page, obtain the URL of the initial page, create the first-level node of the refer chain, and use the page ID and URL of the initial page as the first node The information of level 1 nodes is written into the refer chain. Further, the first node creation unit 21 includes: an initial page page ID generation unit 211 , an initial page URL acquisition unit 212 and a first node creation subunit 213 . The page ID generating unit 211 of the initial page is adapted to generate a page ID of the initial page after monitoring an access request of the initial page. The URL acquiring unit 212 of the initial page is adapted to acquire the URL of the currently loaded initial page through a designated response event interface during the process of loading the initial page. For example, by implementing the specified response event interface of the standard plug-in mechanism. Use the BHO plug-in mechanism of the browser helper object in the IE browser to obtain the currently loaded URL of the IE by responding to the "BeforeNavigate2" event. In the Firefox browser, use the specified response event interface provided by the Firefox extension mechanism to obtain the URL currently loaded by the Firefox browser. Use the NPAPI plug-in mechanism in the Google (chrome) browser to get the URL currently loaded by the Google browser. The first node creation subunit 213 is adapted to create a first-level node of the refer chain, and write the page ID and URL of the initial page as information of the first-level node into the refer chain.

第二节点创建单元22,i≥2,适于在监控到第i级页面的访问请求后,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,第i级页面是第i-1级页面的页面级跳转页面;以及,查询包含第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将第i级页面的页面ID和URL作为第i级节点的信息;第二节点创建单元22适于创建refer链的各级节点。进一步的,第二节点创建单元22包括:第i级页面的页面ID生成单元221、第i级页面的URL获取单元222、第i-1级页面的页面ID或URL获取单元223和第二节点创建子单元224。第i级页面的页面ID生成单元221适于在监控到第i级页面的访问请求后,生成第i级页面的页面ID。第i级页面的URL获取单元222适于在加载第i级页面的过程中,通过指定响应事件接口获取当前加载的第i级页面的URL。获取当前加载的第i级页面的URL的具体方式可参见获取初始页面的URL的相关描述。第i-1级页面的页面ID或URL获取单元223适于在监控到第i级页面的访问请求后,获取第i-1级页面的页面ID或URL。第二节点创建子单元224适于查询包含第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将第i级页面的页面ID和URL作为第i级节点的信息。The second node creation unit 22, i≥2, is adapted to generate the page ID of the i-th page after monitoring the access request of the i-th page, and obtain the URL of the i-th page and the page of the i-1th page ID or URL, the i-level page is the page-level jump page of the i-1 level page; and, query the refer chain containing the page ID or URL of the i-1 level page, and create the i-level node of the refer chain , the page ID and URL of the i-th level page are used as the information of the i-th level node; the second node creating unit 22 is adapted to create all levels of nodes of the refer chain. Further, the second node creation unit 22 includes: the page ID generation unit 221 of the i-th level page, the URL acquisition unit 222 of the i-th level page, the page ID or URL acquisition unit 223 of the i-1th level page and the second node Subunit 224 is created. The page ID generating unit 221 of the i-th level page is adapted to generate the page ID of the i-th level page after monitoring the access request of the i-th level page. The URL acquiring unit 222 of the i-th level page is adapted to acquire the URL of the currently loaded i-th level page through a designated response event interface during the loading of the i-th level page. For a specific manner of obtaining the URL of the currently loaded i-th level page, refer to the relevant description of obtaining the URL of the initial page. The page ID or URL acquiring unit 223 of the i-1th level page is adapted to acquire the page ID or URL of the i-1th level page after monitoring the access request of the i-th level page. The second node creation subunit 224 is adapted to query the refer chain containing the page ID or URL of the i-1th level page, create the i-th level node of the refer chain, and use the page ID and URL of the i-th level page as the i-th level Node information.

可选地,客户端的第二节点创建单元22还包括:捕获单元225和写入单元226。捕获单元225适于在监控到第i级页面的访问请求后,获取第i级页面的接口对象指针。写入单元226适于根据接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID。这种实施方式适用于通过新窗口或新标签(tab)页打开第i级页面的情况。以IE浏览器为例,捕获单元225进一步适于在监控到第i级页面的访问请求后,捕获浏览器创建新窗口或新标签页所调用的函数,利用该函数的返回值获取第i级页面的接口对象指针,如IWEBBROWSER2指针。由于此时浏览器还未开始加载第i级页面,浏览器所记录的当前页面的页面ID还是在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID,因此,此时写入单元226可根据该接口对象指针向IWEBBROWSER2对象写入第i-1级页面的页面ID。第i-1级页面的页面ID或URL获取单元223具体适于:在加载第i级页面的过程中,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的页面ID。可选地,写入单元226适于根据接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的URL。Optionally, the second node creation unit 22 of the client further includes: a capturing unit 225 and a writing unit 226 . The capture unit 225 is adapted to obtain the interface object pointer of the i-th level page after monitoring the access request of the i-th level page. The writing unit 226 is adapted to write the page ID of the i-1th level page acquired during the process of loading the i-1th level page into the interface object of the i-th level page according to the interface object pointer. This implementation manner is applicable to the situation that the i-th level page is opened through a new window or a new tab (tab) page. Taking the IE browser as an example, the capture unit 225 is further adapted to capture the function called by the browser to create a new window or new tab page after monitoring the access request of the i-level page, and use the return value of the function to obtain the i-level page. Interface object pointer of the page, such as IWEBBROWSER2 pointer. Since the browser has not yet started loading the i-th level page at this time, the page ID of the current page recorded by the browser is still the page ID of the i-1th level page obtained during the loading of the i-1th level page, so At this time, the writing unit 226 can write the page ID of the i-1th level page to the IWEBBROWSER2 object according to the interface object pointer. The page ID or URL obtaining unit 223 of the i-1th level page is specifically adapted to: in the process of loading the i-th level page, by reading the information provided by the interface object of the i-th level page, to obtain the i-1th level page The page ID of the . Optionally, the writing unit 226 is adapted to write the URL of the i-1th level page acquired during the process of loading the i-1th level page to the interface object of the i-th level page according to the interface object pointer.

可选地,第i-1级页面的页面ID或URL获取单元223进一步适于:在监控到第i级页面的访问请求之后并在加载第i级页面之前,通过浏览器提供的get_locationURL接口获取第i-1级页面的URL。第二节点创建单元22还包括:判断单元227和清空单元228。其中,判断单元227适于判断是否由浏览器地址栏的输入行为触发打开第i级页面,具体地,可以通过根据浏览器地址栏的点击和输入动作来判断;清空单元228适于在判断单元227的判断结果为是的情况下,将第i-1级页面的页面ID或URL获取单元223所获取的第i-1级页面的URL清空,并触发第一节点创建单元21将第i级页面作为初始页面进行处理;在判断单元227的判断结果为否的情况下,判断单元227触发第二节点创建子单元224创建refer链的第i级节点。Optionally, the page ID or URL acquisition unit 223 of the i-1th level page is further adapted to: after monitoring the access request of the i-th level page and before loading the i-th level page, obtain the URL through the get_locationURL interface provided by the browser The URL of the page at level i-1. The second node creating unit 22 also includes: a judging unit 227 and a clearing unit 228 . Wherein, the judging unit 227 is suitable for judging whether the i-th level page is triggered by the input behavior of the browser address bar, specifically, it can be judged by clicking and inputting actions according to the browser address bar; When the judgment result of 227 is yes, the page ID of the i-1th level page or the URL of the i-1th level page acquired by the URL acquisition unit 223 is cleared, and the first node creation unit 21 is triggered to convert the i-th level The page is processed as the initial page; in the case that the judgment result of the judging unit 227 is negative, the judging unit 227 triggers the second node creating subunit 224 to create the i-th level node of the refer chain.

如果第i-1级页面的页面ID或URL获取单元223获取得到第i-1级页面的页面ID,那么第二节点创建子单元224直接查询包含第i-1级页面的页面ID的refer链,创建该refer链的第i级节点,将第i级页面的页面ID和URL作为第i级节点的信息。如果第i-1级页面的页面ID或URL获取单元223获取得到第i-1级页面的URL,那么第二节点创建子单元224查询包含第i-1级页面的URL的refer链,并在查询到多条refer链的情况下选择最近更新的refer链,创建该refer链的第i级节点,将第i级页面的页面ID和URL作为第i级节点的信息。If the page ID or URL acquisition unit 223 of the i-1th level page obtains the page ID of the i-1th level page, then the second node creation subunit 224 directly queries the refer chain containing the page ID of the i-1th level page , create the i-th level node of the refer chain, and use the page ID and URL of the i-th level page as the information of the i-th level node. If the page ID of the i-1th level page or the URL obtaining unit 223 obtains the URL of the i-1th level page, then the second node creation subunit 224 queries the refer chain containing the URL of the i-1th level page, and in When multiple refer chains are found, select the most recently updated refer chain, create the i-th level node of the refer chain, and use the page ID and URL of the i-th level page as the information of the i-th level node.

在创建refer链的过程中,考虑到页面发生多次自动跳转的情况,该装置还包括:第二子节点创建单元23,适于捕获重定向处理时所调用的函数,从重定向处理时所调用的函数的输入参数中获取第i级页面的至少一个页面间跳转页面的URL;以及,查询包含第i级页面的页面ID的refer链,创建该refer链的至少一个第i级子节点,将第i级页面的页面ID和所述第i级页面的至少一个页面间跳转页面的URL作为至少一个第i级子节点的信息。具体地,在发生3xx等跳转情况时,浏览器会进行重定向处理,在重定向处理时浏览器会调用“Urlmon!CINet::OnRedirect”函数,该函数的输入参数就记录了页面间跳转页面的URL,第二子节点创建单元23通过捕获该函数,就可以获取第i级页面的至少一个页面间跳转页面的URL。将通过这种方式获得的页面间跳转页面的URL作为第i级子节点的信息,该页面间跳转页面的索引ID与第i级页面的页面ID相同。In the process of creating the refer chain, considering the situation that multiple automatic jumps occur on the page, the device further includes: a second child node creation unit 23, adapted to capture the function called during redirection processing, from the redirection processing Obtain the URL of at least one inter-page jump page of the i-level page in the input parameter of the called function; and query the refer chain containing the page ID of the i-level page, and create at least one i-level child node of the refer chain , using the page ID of the i-th level page and the URL of at least one inter-page jump page of the i-th level page as the information of at least one i-th level child node. Specifically, when a jump such as 3xx occurs, the browser will perform redirection processing. During the redirection processing, the browser will call the "Urlmon!CINet::OnRedirect" function, and the input parameter of this function will record the jump between pages. For the URL of the redirected page, the second child node creating unit 23 can obtain the URL of at least one inter-page jump page of the i-th level page by capturing this function. The URL of the inter-page jump page obtained in this way is used as the information of the i-th child node, and the index ID of the inter-page jump page is the same as the page ID of the i-th level page.

根据本发明实施例提供的创建refer链的装置,能够在页面访问的同时实时地获取由各级页面的URL组成的refer链,这样客户端可以利用该refer链检测当前页面的访问行为是否安全。According to the device for creating a refer chain provided by the embodiment of the present invention, the refer chain composed of URLs of pages at all levels can be obtained in real time while the page is accessed, so that the client can use the refer chain to detect whether the access behavior of the current page is safe.

本发明还提供了一种安全检测设备,该安全检测设备包括上述refer链的创建装置,该安全检测设备可以利用refer链所包含的URL对页面的访问行为进行处理。可选地,安全检测设备为客户端,它与服务器之间完成交互。图3示出了根据本发明一个实施例的作为安全检测设备的客户端与服务器交互的结构框图。如图3所示,客户端31包括refer链的创建装置311和处理模块312,其中refer链的创建装置311的具体结构与上述实施例相同,处理模块312适于利用refer链所包含的所有URL,对页面的访问行为进行处理。服务器32可以为通过全网蜘蛛云安全服务器集群构建的云安全服务器,并保存有恶意网址库、钓鱼网址库、广告欺诈库等,从中可以发现变动的网页和新增的网页。处理模块312提取出refer链所包含的所有URL之后,将这些URL加密为网址密文发送给服务器32,在上传URL的网址密文到服务器32的时候,需要首先屏蔽可能带有用户密码的网址字符串,不上传此类URL的网址密文。服务器32将这些URL与自身所保存的黑/白名单数据库进行比对,得到检测结果,然后将检测结果反馈给客户端,其反馈的结果可以包括可信、钓鱼、广告欺诈等信息,或者其他的恶意网址类型,以便用户能够根据不同的类型进行相应的处理。本发明通过实时地获取由各级页面的URL组成的refer链,利用refer链所包含的所有URL对页面的访问行为进行处理,与现有技术仅利用新页面的URL进行检测相比,由于refer链所提供的URL更多,覆盖面更广,因而检测效率更高,能够更为实时快速并有效地保护客户端网页浏览的安全性。The present invention also provides a safety detection device, which includes the above refer chain creation device, and the safety detection device can use the URL contained in the refer chain to process the page access behavior. Optionally, the security detection device is a client, which completes the interaction with the server. Fig. 3 shows a structural block diagram of interaction between a client as a security detection device and a server according to an embodiment of the present invention. As shown in Figure 3, the client 31 includes a refer chain creation device 311 and a processing module 312, wherein the specific structure of the refer chain creation device 311 is the same as the above-mentioned embodiment, and the processing module 312 is suitable for utilizing all URLs contained in the refer chain , to process the access behavior of the page. The server 32 can be a cloud security server constructed by the cloud security server cluster of the whole web spider, and stores a library of malicious URLs, a library of phishing URLs, a library of advertising fraud, etc., from which changed webpages and newly added webpages can be found. After the processing module 312 extracts all the URLs included in the refer chain, it encrypts these URLs into URL ciphertexts and sends them to the server 32. When uploading the URL ciphertexts of the URLs to the server 32, it is necessary to block the URLs that may contain user passwords first. String, do not upload URL ciphertext of this type of URL. The server 32 compares these URLs with the black/white list database stored by itself, obtains the detection results, and then feeds back the detection results to the client. The feedback results can include information such as credible, phishing, advertising fraud, or other types of malicious URLs, so that users can deal with them according to different types. The present invention obtains in real time a refer chain composed of URLs of pages at all levels, and utilizes all URLs included in the refer chain to process page access behaviors. The link provides more URLs and wider coverage, so the detection efficiency is higher, and it can protect the security of client web browsing more quickly and effectively in real time.

本发明实施例提供,第二节点创建单元还包括:捕获单元,适于在监控到第i级页面的访问请求后,获取第i级页面的接口对象指针;以及,写入单元,适于根据所述接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID;The embodiment of the present invention provides that the second node creation unit further includes: a capture unit adapted to obtain the interface object pointer of the i-th level page after monitoring the access request of the i-th level page; and a writing unit adapted to The interface object pointer writes the page ID of the i-1th level page obtained during loading the i-1th level page into the interface object of the i-th level page;

第i-1级页面的页面ID或URL获取单元具体适于:在加载第i级页面的过程中,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的页面ID。The page ID or URL acquisition unit of the i-1th level page is specifically suitable for: during the process of loading the i-th level page, by reading the information provided by the interface object of the i-th level page, to obtain the i-1th level page page ID.

根据本发明实施例所述的装置,所述捕获单元进一步适于:在监控到第i级页面的访问请求后,捕获浏览器创建新窗口或新标签页所调用的函数,利用该函数的返回值获取第i级页面的接口对象指针。According to the device described in the embodiment of the present invention, the capture unit is further adapted to: after monitoring the access request of the i-th level page, capture the function called by the browser to create a new window or a new tab page, and use the function returned The value gets the interface object pointer of the i-th level page.

根据本发明实施例所述的装置,所述第i-1级页面的页面ID或URL获取单元进一步适于:在监控到第i级页面的访问请求之后并在加载第i级页面之前,通过浏览器提供的get_locationURL接口获取第i-1级页面的URL。According to the device described in the embodiment of the present invention, the page ID or URL acquisition unit of the i-1th level page is further adapted to: after monitoring the access request of the i-th level page and before loading the i-th level page, by The get_locationURL interface provided by the browser obtains the URL of the i-1 level page.

根据本发明实施例所述的装置,所述第二节点创建单元还包括:According to the device described in the embodiment of the present invention, the second node creation unit further includes:

判断单元,适于判断是否是由浏览器地址栏的输入行为触发打开第i级页面;The judging unit is suitable for judging whether the i-th level page is triggered by the input behavior of the browser address bar;

清空单元,适于在所述判断单元的判断结果为是的情况下,将所述第i-1级页面的页面ID或URL获取单元所获取的第i-1级页面的URL清空,并触发第一节点创建单元将第i级页面作为初始页面进行处理;The emptying unit is adapted to clear the page ID of the i-1th level page or the URL of the i-1th level page acquired by the URL acquisition unit when the judgment result of the judgment unit is yes, and trigger The first node creation unit processes the i-th level page as the initial page;

在所述判断单元的判断结果为否的情况下,所述判断单元触发所述第二节点创建子单元创建所述refer链的第i级节点。If the judging result of the judging unit is negative, the judging unit triggers the second node creation subunit to create the i-th level node of the refer chain.

根据本发明实施例所述的装置,所述refer链创建模块还包括:第二子节点创建单元,适于捕获重定向处理时所调用的函数,从所述重定向处理时所调用的函数的输入参数中获取第i级页面的至少一个页面间跳转页面的URL;以及,查询包含所述第i级页面的页面ID的refer链,创建该refer链的至少一个第i级子节点,将所述第i级页面的页面ID和所述第i级页面的至少一个页面间跳转页面的URL作为至少一个第i级子节点的信息。According to the device described in the embodiment of the present invention, the refer chain creation module further includes: a second child node creation unit, adapted to capture the function called during redirection processing, from the function called during redirection processing Obtain the URL of at least one inter-page jump page of the i-level page in the input parameter; and query the refer chain containing the page ID of the i-level page, create at least one i-level child node of the refer chain, and The page ID of the i-th level page and the URL of at least one inter-page jump page of the i-th level page are used as information of at least one i-th level child node.

本发明实施例还提供了一种安全检测设备,包括上述述的refer链的创建装置,还包括:处理模块,适于利用所述refer链所包含的所有URL,对页面的访问行为进行处理。The embodiment of the present invention also provides a security detection device, which includes the above-mentioned refer chain creation device, and further includes: a processing module, adapted to use all URLs included in the refer chain to process page access behaviors.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的refer链的创建装置和安全检测设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the refer chain creation device and some or all of the components in the security detection device according to the embodiment of the present invention. Full functionality. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (16)

1.一种refer链的创建方法,包括:1. A method for creating a refer chain, comprising: 在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将所述初始页面的页面ID和URL作为第1级节点的信息写入refer链;After monitoring the access request of the initial page, generate the page ID of the initial page, obtain the URL of the initial page, create the first-level node of the refer chain, and write the page ID and URL of the initial page as the information of the first-level node Enter the refer chain; 在监控到第i级页面的访问请求后,i≥2,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,所述第i级页面是第i-1级页面的页面级跳转页面,在第i-1级页面上点击链接或者其它用户行为触发的链接方式由第i-1级页面链接到第i级页面;以及,查询包含所述第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将所述第i级页面的页面ID和URL作为第i级节点的信息;通过本步骤创建所述refer链的各级节点。After monitoring the access request of the i-th level page, i≥2, generate the page ID of the i-th level page, obtain the URL of the i-th level page and the page ID or URL of the i-1th level page, the i-th level The page is the page-level jump page of the i-1 level page, and the i-1 level page is linked to the i-level page by clicking on a link on the i-1 level page or other links triggered by user behavior; and, query Including the refer chain of the page ID or URL of the i-1th level page, creating the i-th level node of the refer chain, using the page ID and URL of the i-th level page as the information of the i-th level node; through this The step is to create nodes at all levels of the refer chain. 2.根据权利要求1所述的方法,所述在监控到初始页面的访问请求后,获取初始页面的URL具体为:在加载初始页面的过程中,通过指定响应事件接口获取当前加载的初始页面的URL;2. The method according to claim 1, after monitoring the access request of the initial page, obtaining the URL of the initial page is specifically: in the process of loading the initial page, obtaining the currently loaded initial page by specifying the response event interface the URL; 所述在监控到第i级页面的访问请求后,获取第i级页面的URL具体为:在加载第i级页面的过程中,通过指定响应事件接口获取当前加载的第i级页面的URL。After monitoring the access request of the i-level page, obtaining the URL of the i-level page specifically includes: during the process of loading the i-level page, obtaining the URL of the currently loaded i-level page through a designated response event interface. 3.根据权利要求2所述的方法,所述获取第i-1级页面的页面ID进一步包括:3. The method according to claim 2, said obtaining the page ID of the i-1th level page further comprising: 在监控到第i级页面的访问请求后,获取第i级页面的接口对象指针,根据所述接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID;After monitoring the access request of the i-th level page, obtain the interface object pointer of the i-th level page, and write the interface object of the i-th level page according to the interface object pointer to the interface object of the i-th level page in the process of loading the i-1 level page The obtained page ID of the i-1th level page; 在加载第i级页面的过程中,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的页面ID。In the process of loading the i-th level page, the page ID of the i-1 level page is obtained by reading the information provided by the interface object of the i-th level page. 4.根据权利要求3所述的方法,所述获取第i级页面的接口对象指针的步骤包括:捕获浏览器创建新窗口或新标签页所调用的函数,利用该函数的返回值获取第i级页面的接口对象指针。4. The method according to claim 3, the step of obtaining the interface object pointer of the i-level page comprises: capturing the function called by the browser to create a new window or a new tab page, and utilizing the return value of the function to obtain the i-th level page The interface object pointer of the level page. 5.根据权利要求2所述的方法,所述获取第i-1级页面的URL进一步包括:5. The method according to claim 2, said obtaining the URL of the i-1th level page further comprising: 在监控到第i级页面的访问请求之后并在加载第i级页面之前,通过浏览器提供的get_locationURL接口获取第i-1级页面的URL。After monitoring the access request of the i-level page and before loading the i-level page, obtain the URL of the i-1 level page through the get_locationURL interface provided by the browser. 6.根据权利要求5所述的方法,在所述通过浏览器提供的get_locationURL接口获取第i-1级页面的页面ID和URL的步骤之后还包括:6. The method according to claim 5, after the step of obtaining the page ID and URL of the i-1th level page through the get_locationURL interface provided by the browser, it also includes: 判断是否是由浏览器地址栏的输入行为触发打开第i级页面;Determine whether the opening of the i-level page is triggered by the input behavior of the browser address bar; 若判断结果为是,则将通过浏览器提供的get_locationURL接口获取的第i-1级页面的URL清空,将第i级页面作为初始页面进行处理;If the judgment result is yes, clear the URL of the i-1 level page obtained through the get_locationURL interface provided by the browser, and process the i-level page as the initial page; 若判断结果为否,则执行所述创建所述refer链的第i级节点的步骤。If the judgment result is no, execute the step of creating the i-th level node of the refer chain. 7.根据权利要求1所述的方法,在所述第i级节点创建步骤之后还包括:至少一个第i级子节点创建步骤,所述至少一个第i级子节点对应于第i级页面的至少一个页面间跳转页面:捕获重定向处理时所调用的函数,从所述重定向处理时所调用的函数的输入参数中获取第i级页面的至少一个页面间跳转页面的URL;以及,查询包含所述第i级页面的页面ID的refer链,创建该refer链的至少一个第i级子节点,将所述第i级页面的页面ID和所述第i级页面的至少一个页面间跳转页面的URL作为至少一个第i级子节点的信息。7. The method according to claim 1, after the i-th level node creation step, further comprising: at least one i-th level child node creation step, said at least one i-th level child node corresponding to the i-th level page At least one inter-page jump page: capture the function called during redirection processing, and obtain the URL of at least one inter-page jump page of the i-level page from the input parameters of the function called during redirection processing; and , query the refer chain containing the page ID of the i-th level page, create at least one i-th level child node of the refer chain, and combine the page ID of the i-th level page and at least one page of the i-th level page The URL of the inter-jump page is used as the information of at least one i-th child node. 8.根据权利要求1-7任一项所述的方法,在所述创建refer链的各级节点之后还包括:利用所述refer链所包含的所有URL,对页面的访问行为进行处理。8. The method according to any one of claims 1-7, after creating the nodes of all levels of the refer chain, further comprising: using all the URLs included in the refer chain to process the page access behavior. 9.一种refer链的创建装置,包括:9. A device for creating a refer chain, comprising: 第一节点创建单元,适于在监控到初始页面的访问请求后,生成初始页面的页面ID,获取初始页面的URL,创建refer链的第1级节点,将所述初始页面的页面ID和URL作为第1级节点的信息写入refer链;The first node creation unit is suitable for generating the page ID of the initial page after monitoring the access request of the initial page, obtaining the URL of the initial page, creating a first-level node of the refer chain, and combining the page ID and URL of the initial page Write the refer chain as the information of the first-level node; 第二节点创建单元,适于在监控到第i级页面的访问请求后,i≥2,生成第i级页面的页面ID,获取第i级页面的URL以及第i-1级页面的页面ID或URL,所述第i级页面是第i-1级页面的页面级跳转页面,在第i-1级页面上点击链接或者其它用户行为触发的链接方式由第i-1级页面链接到第i级页面;以及,查询包含所述第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将所述第i级页面的页面ID和URL作为第i级节点的信息;The second node creation unit is adapted to generate the page ID of the i-level page after monitoring the access request of the i-level page, and obtain the URL of the i-level page and the page ID of the i-1-th level page Or URL, the i-th level page is the page-level jump page of the i-1th level page, and the i-1th level page is linked to by clicking on a link on the i-1th level page or other link methods triggered by user behavior The i-th level page; and, query the refer chain containing the page ID or URL of the i-1th level page, create the i-th level node of the refer chain, and use the page ID and URL of the i-th level page as the first The information of the i-level node; 所述第二节点创建单元适于创建所述refer链的各级节点。The second node creation unit is adapted to create nodes at all levels of the refer chain. 10.根据权利要求9所述的装置,10. The device of claim 9, 所述第一节点创建单元包括:The first node creation unit includes: 初始页面的页面ID生成单元,适于在监控到初始页面的访问请求后,生成初始页面的页面ID;The page ID generating unit of the initial page is adapted to generate the page ID of the initial page after monitoring the access request of the initial page; 初始页面的URL获取单元,适于在加载初始页面的过程中,通过指定响应事件接口获取当前加载的初始页面的URL;The URL acquisition unit of the initial page is adapted to obtain the URL of the currently loaded initial page by specifying a response event interface during the process of loading the initial page; 第一节点创建子单元,适于创建refer链的第1级节点,将所述初始页面的页面ID和URL作为第1级节点的信息写入refer链;The first node creation subunit is adapted to create a first-level node of the refer chain, and writes the page ID and URL of the initial page into the refer chain as information of the first-level node; 所述第二节点创建单元包括:The second node creation unit includes: 第i级页面的页面ID生成单元,适于在监控到第i级页面的访问请求后,生成第i级页面的页面ID;The page ID generating unit of the i-level page is adapted to generate the page ID of the i-level page after monitoring the access request of the i-level page; 第i级页面的URL获取单元,适于在加载第i级页面的过程中,通过指定响应事件接口获取当前加载的第i级页面的URL;The URL obtaining unit of the i-level page is adapted to obtain the URL of the currently loaded i-level page through a specified response event interface during the loading of the i-level page; 第i-1级页面的页面ID或URL获取单元,适于在监控到第i级页面的访问请求后,获取第i-1级页面的页面ID或URL;The page ID or URL acquisition unit of the i-1th level page is adapted to obtain the page ID or URL of the i-1th level page after monitoring the access request of the i-th level page; 第二节点创建子单元,适于查询包含所述第i-1级页面的页面ID或URL的refer链,创建该refer链的第i级节点,将所述第i级页面的页面ID和URL作为第i级节点的信息。The second node creates a subunit, which is suitable for querying the refer chain containing the page ID or URL of the i-1th level page, creating the i-level node of the refer chain, and using the page ID and URL of the i-th level page As the information of the i-th level node. 11.根据权利要求10所述的装置,所述第二节点创建单元还包括:捕获单元,适于在监控到第i级页面的访问请求后,获取第i级页面的接口对象指针;以及,写入单元,适于根据所述接口对象指针向第i级页面的接口对象写入在加载第i-1级页面的过程中所获取的第i-1级页面的页面ID;11. The device according to claim 10, the second node creating unit further comprising: a capturing unit adapted to acquire the interface object pointer of the i-th level page after monitoring the access request of the i-th level page; and, The writing unit is adapted to write the page ID of the i-1th level page acquired during the process of loading the i-1th level page to the interface object of the i-th level page according to the interface object pointer; 所述第i-1级页面的页面ID或URL获取单元具体适于:在加载第i级页面的过程中,通过读取第i级页面的接口对象所提供的信息,获取第i-1级页面的页面ID。The page ID or URL acquiring unit of the i-1th level page is specifically adapted to: in the process of loading the i-th level page, by reading the information provided by the interface object of the i-th level page, to obtain the i-1th level The page ID of the page. 12.根据权利要求11所述的装置,所述捕获单元进一步适于:在监控到第i级页面的访问请求后,捕获浏览器创建新窗口或新标签页所调用的函数,利用该函数的返回值获取第i级页面的接口对象指针。12. The device according to claim 11, the capture unit is further adapted to: after monitoring the access request of the i-th level page, capture the function called by the browser to create a new window or a new tab page, utilize the function The return value obtains the interface object pointer of the i-level page. 13.根据权利要求10所述的装置,所述第i-1级页面的页面ID或URL获取单元进一步适于:在监控到第i级页面的访问请求之后并在加载第i级页面之前,通过浏览器提供的get_locationURL接口获取第i-1级页面的URL。13. The device according to claim 10, the page ID or URL obtaining unit of the i-1th level page is further adapted to: after monitoring the access request of the i-th level page and before loading the i-th level page, Obtain the URL of the i-1 level page through the get_locationURL interface provided by the browser. 14.根据权利要求13所述的装置,所述第二节点创建单元还包括:14. The device according to claim 13, the second node creation unit further comprising: 判断单元,适于判断是否是由浏览器地址栏的输入行为触发打开第i级页面;The judging unit is suitable for judging whether the i-th level page is triggered by the input behavior of the browser address bar; 清空单元,适于在所述判断单元的判断结果为是的情况下,将所述第i-1级页面的页面ID或URL获取单元所获取的第i-1级页面的URL清空,并触发第一节点创建单元将第i级页面作为初始页面进行处理;The emptying unit is adapted to clear the page ID of the i-1th level page or the URL of the i-1th level page acquired by the URL acquisition unit when the judgment result of the judgment unit is yes, and trigger The first node creation unit processes the i-th level page as the initial page; 在所述判断单元的判断结果为否的情况下,所述判断单元触发所述第二节点创建子单元创建所述refer链的第i级节点。If the judging result of the judging unit is negative, the judging unit triggers the second node creation subunit to create the i-th level node of the refer chain. 15.根据权利要求9所述的装置,所述refer链创建模块还包括:第二子节点创建单元,适于捕获重定向处理时所调用的函数,从所述重定向处理时所调用的函数的输入参数中获取第i级页面的至少一个页面间跳转页面的URL;以及,查询包含所述第i级页面的页面ID的refer链,创建该refer链的至少一个第i级子节点,将所述第i级页面的页面ID和所述第i级页面的至少一个页面间跳转页面的URL作为至少一个第i级子节点的信息。15. The device according to claim 9, the refer chain creation module further comprising: a second child node creation unit adapted to capture a function called during redirection processing, from the function called during redirection processing Obtain the URL of at least one inter-page jump page of the i-level page in the input parameter of the i-level page; and query the refer chain containing the page ID of the i-level page, and create at least one i-level child node of the refer chain, The page ID of the i-th level page and the URL of at least one inter-page jump page of the i-th level page are used as the information of at least one i-th level child node. 16.一种安全检测设备,包括上述权利要求9-15任一项所述的refer链的创建装置,还包括:处理模块,适于利用所述refer链所包含的所有URL,对页面的访问行为进行处理。16. A security detection device, comprising the creation device of the refer chain according to any one of claims 9-15, further comprising: a processing module adapted to use all URLs contained in the refer chain to access the page Behavior is processed.
CN201310279974.3A 2013-07-04 2013-07-04 The creation method of refer chain, device and security detection equipment Active CN103336693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310279974.3A CN103336693B (en) 2013-07-04 2013-07-04 The creation method of refer chain, device and security detection equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310279974.3A CN103336693B (en) 2013-07-04 2013-07-04 The creation method of refer chain, device and security detection equipment

Publications (2)

Publication Number Publication Date
CN103336693A CN103336693A (en) 2013-10-02
CN103336693B true CN103336693B (en) 2016-06-22

Family

ID=49244870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310279974.3A Active CN103336693B (en) 2013-07-04 2013-07-04 The creation method of refer chain, device and security detection equipment

Country Status (1)

Country Link
CN (1) CN103336693B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581321B (en) * 2013-11-06 2017-05-31 北京奇虎科技有限公司 A kind of creation method of refer chains, device and safety detection method and client
CN104679747B (en) * 2013-11-26 2020-03-17 腾讯科技(深圳)有限公司 Detection device and method for website redirection
CN105243134B (en) * 2015-09-30 2019-07-16 北京奇虎科技有限公司 A method and device for processing a hijacked browser
CN108062398A (en) * 2017-12-21 2018-05-22 武汉极意网络科技有限公司 A kind of method, equipment and the storage device of webpage tracking user's access link
CN111327594A (en) * 2020-01-20 2020-06-23 Oppo广东移动通信有限公司 Web page processing method, device, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079062A (en) * 2007-06-22 2007-11-28 腾讯科技(深圳)有限公司 Web page importance evaluation method and system
CN102402620A (en) * 2011-12-26 2012-04-04 余姚市供电局 Malicious webpage defense method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1868103A1 (en) * 2005-03-28 2007-12-19 Duaxes Corporation Communication control device and communication control system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079062A (en) * 2007-06-22 2007-11-28 腾讯科技(深圳)有限公司 Web page importance evaluation method and system
CN102402620A (en) * 2011-12-26 2012-04-04 余姚市供电局 Malicious webpage defense method and system

Also Published As

Publication number Publication date
CN103336693A (en) 2013-10-02

Similar Documents

Publication Publication Date Title
CN103368957B (en) Method and system that web page access behavior is processed, client, server
Iqbal et al. The ad wars: retrospective measurement and analysis of anti-adblock filter lists
CN102419808B (en) Method, device and system for detecting safety of download link
CN103617395B (en) Method, device and system for intercepting advertisement programs based on cloud security
Liu et al. A novel approach for detecting browser-based silent miner
CN104980309B (en) website security detection method and device
CN101340434B (en) Malicious content detection and verification method and system for network station
Pan et al. Cspautogen: Black-box enforcement of content security policy upon real-world websites
CN104168293B (en) The method and system of suspicious fishing webpage are recognized with reference to local content rule base
CN102467633A (en) Method and system for safely browsing webpage
CN103605924B (en) A kind of method and device preventing rogue program attacking network from paying the page
WO2016201819A1 (en) Method and apparatus for detecting malicious file
CN103491543A (en) Method for detecting malicious websites through wireless terminal, and wireless terminal
JP2016053956A (en) System and method for detecting web-based malicious codes
CN103473501B (en) A malware tracking method based on cloud security
CN104143008B (en) The method and device of fishing webpage is detected based on picture match
WO2015096528A1 (en) Method and device for detecting security of online shopping environment
WO2013044744A1 (en) Download resource providing method and device
CN103685308A (en) Detection method and system of phishing web pages, client and server
CN104158828B (en) The method and system of suspicious fishing webpage are identified based on cloud content rule base
CN106899549B (en) Network security detection method and device
CN103336693B (en) The creation method of refer chain, device and security detection equipment
CN105959324A (en) Regular matching-based network attack detection method and apparatus
CN103986731A (en) Method and device for detecting phishing web pages through image matching
WO2015109928A1 (en) Method, device and system for loading recommendation information and detecting url

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220713

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.