Webpage hierarchy establishment method and device, medium and electronic equipment
By modifying the V8 engine and trigger hook technology, dynamically capturing links to dynamic websites has been solved, and the problem of being unable to construct dynamic website hierarchical relationships in the existing technology has been achieved, and efficient, secure and customized website hierarchical establishment is achieved.
Patent Information
- Application Number
- CN202510477795.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
AI Technical Summary
It is difficult for the existing technology to effectively establish hierarchical relationships of dynamic websites, and traditional methods cannot obtain links in dynamic web pages, resulting in the inability of web page evidence software to build a complete website hierarchical structure.
By modifying the V8 engine to bypass read-only protection, use the trigger hook to dynamically capture the links of the next level of page, establish a hierarchical relationship of web page links, including rewriting location, history and windows methods, and dynamically generate execution scripts to fix the website hierarchy.
It realizes the efficient and accurate construction of hierarchical relationships of dynamic websites under user-defined operations, avoids inefficient sequential click tests, meets the fixed needs of different users, and keeps the website operation logic unchanged.
Smart Images

Figure CN120372113A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of web forensics, and relates to a method for establishing web page levels, in particular to a method, device, medium and electronic device for establishing web page levels. Background Art
[0002] In the field of web forensics, when forensically investigating a third-party website, it is often not just a single page that is extracted. Instead, starting from the website's home page as an entry point, the entire website needs to be fixed. The website can be regarded as a tree structure, with the home page entry as the first level of the website. Clicking on the links in the home page leads to the pages of the second level, and clicking on the links in the pages of the second level leads to the pages of the third level, and so on. By traversing layer by layer, the entire website is fixed.
[0003] It can be seen that the most crucial part here is to obtain the links in the third-party web pages and construct the hierarchical relationship. The traditional way to obtain web page links is to analyze the web page structure and extract the links in the a tags. With the development of technology, such static websites are becoming fewer and fewer, and are replaced by dynamic web pages that use js for direct jump navigation. For such websites, it is impossible to obtain the links by directly analyzing the page structure, and it is also impossible to know which elements can be clicked and jumped by analyzing the website structure. This poses a great challenge to web forensics, and currently, web forensics software on the market cannot well establish the hierarchical relationship of dynamic websites. Summary of the Invention
[0004] The purpose of the present disclosure is to provide a method, device, medium and electronic device for establishing web page levels, which is used to solve the problem that it is difficult to establish the hierarchical relationship of dynamic websites in the actual current forensics process.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for establishing web page levels, including: Step S1, modifying the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten; Step S2, loading the current web page and injecting a script after successful loading; Step S3, based on the jump elements of the current web page, jumping to the next-level page, and dynamically capturing the links of the next-level page by triggering a hook to obtain the links of the next-level page; Step S4, if the next-level page is the finally jumped page, establishing the hierarchical relationship of the web page links based on the link of the current web page and the link of the next-level page, otherwise returning to Step S2, and the current web page in Step S2 is the next-level page.
[0006] According to the above description, it can be known that the hierarchical establishment method can intercept the jump method in the current web page standard and establish the hierarchical relationship of the web page links based on the link of the current web page and the link of the next-level page by modifying the V8 engine and dynamically capturing the links of the next-level page by triggering a hook.
[0007] In one embodiment of the present disclosure, the implementation method of modifying the web page V8 engine to bypass the read-only protection of the global variable to be modified includes: skipping the read-only check of the global variable to be rewritten in the V8 engine, and the variables to be rewritten include location, history, and windows.
[0008] In one embodiment of the present disclosure, the implementation method of dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page includes: dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page, including: dynamically capturing the link of the next-level page based on the rewritten location.href property, rewritten location.hash property, rewritten location.replace method, rewritten location.assign method, rewritten history.pushState method, rewritten history.replaceState method, and windows.open method to obtain the link of the next-level page.
[0009] In one embodiment of the present disclosure, the implementation method of dynamically capturing the link of the next-level page based on the rewritten windows.open method to obtain the link of the next-level page includes: storing the original windows.open method; storing the link of the next-level page in the page cache based on the rewritten windows.open method to obtain the link of the next-level page; and restoring using the stored windows.open method.
[0010] In one embodiment of the present disclosure, the implementation method of jumping to the next-level page based on the jump element of the current web page and dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page includes: obtaining the jump element selected by the user; jumping to the next-level page based on the selected jump element; and dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page.
[0011] In one embodiment of the present disclosure, it further includes: dynamically generating an execution script based on the hierarchical relationship; and fixing the website associated with the hierarchical relationship layer by layer based on the execution script.
[0012] In one embodiment of the present disclosure, the read-only protection includes: when the global variable attribute of the V8 engine contains read-only or non-enumerable, throwing a prohibition of redefinition exception.
[0013] In a second aspect, embodiments of the present disclosure provide a web page hierarchy establishment device, including: an engine modification module for modifying the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten; a web page loading module for loading the current web page and injecting a script after successful loading; a link capture module for jumping to the next-level page based on the jump elements of the current web page and dynamically capturing the links of the next-level page by triggering a hook to obtain the links of the next-level page; a hierarchy establishment module for, if the next-level page is the finally jumped page, establishing a hierarchical relationship of the web page links based on the link of the current web page and the link of the next-level page, otherwise returning to the web page loading module, and the page of the current web page in the web page loading module is the next-level page.
[0014] In a third aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the hierarchical establishment method described in the second aspect is implemented.
[0015] In a fourth aspect, embodiments of the present disclosure provide an electronic device, including: a memory; a processor coupled to the memory and configured to execute the hierarchical establishment method described in the second aspect.
[0016] As described above, the web page hierarchy establishment method, device, medium, and electronic device of the present application have the following beneficial effects:
[0017] The hierarchical establishment method can intercept the jump method in the current web page standard and establish a hierarchical relationship of the web page links based on the link of the current web page and the link of the next-level page by modifying the V8 engine and dynamically capturing the links of the next-level page by triggering a hook.
[0018] In addition, the hierarchical establishment method also has the following features: Customizability: The jump elements are specified by the user. Different users can select different jump elements for the same page, and the final hierarchical relationship of the website is also different, meeting the different fixed requirements of different users for the website. Security: This method dynamically intercepts without changing the running logic of the website itself, and the jump elements are specified by the user, thus avoiding clicking on buttons such as the delete button on the web page that change the status of the web page. Efficiency: The jump elements are specified and filtered by the user, and accurate jump interception is performed, avoiding the inefficiency problem existing in analyzing the entire website and performing sequential click tests and waiting. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It shows a schematic diagram of a scenario of the electronic device of the present disclosure in an embodiment.
[0020] Figure 2 It shows a flowchart of the web page hierarchy establishment method according to an embodiment of the present disclosure.
[0021] Figure 3 It is shown as a schematic diagram of browser anomalies in the embodiments of the present disclosure.
[0022] Figure 4 It is shown as a flowchart of an implementation method for dynamically capturing the link of the next-level page based on the rewritten windows.open method in the embodiments of the present disclosure to obtain the link of the next-level page.
[0023] Figure 5 It is shown as a flowchart of an implementation method for jumping to the next-level page based on the jump element of the current web page and dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page in the embodiments of the present disclosure.
[0024] Figure 6 It is shown as a flowchart of a web page hierarchy establishment method in the embodiments of the present disclosure.
[0025] Figure 7 It is shown as a flowchart of a web page hierarchy establishment method in the embodiments of the present disclosure.
[0026] Figure 8 It is shown as a schematic structural diagram of a web page hierarchy establishment device in the embodiments of the present disclosure.
[0027] Figure 9 It is shown as a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners
[0028] The following uses specific specific examples to illustrate the implementation manners of the present disclosure. Those skilled in the art can easily understand other advantages and effects of the present disclosure from the content disclosed in this specification. The present disclosure can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0029] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present disclosure schematically. Therefore, only the components related to the present disclosure are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The types, quantities, and proportions of the components in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0030] The following describes in detail the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure.
[0031] The principles and implementation manners of the web page hierarchy establishment method and the web page hierarchy establishment device according to the embodiments of the present disclosure will be described in detail below, so that those skilled in the art can understand the web page hierarchy establishment method and the web page hierarchy establishment device according to the embodiments of the present disclosure without creative labor.
[0032] The following embodiments of the present disclosure provide a web page hierarchy establishment method, which can be applied to an electronic device as shown in Figure 1 The electronic device described in the present disclosure may include a mobile phone 11 with wireless charging function, a tablet computer 12, a notebook computer 13, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The specific type of the electronic device is not limited in the embodiments of the present invention.
[0033] For example, the electronic device may be a station (STAION, ST) in a WLAN with wireless charging function, a cellular phone with wireless charging function, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA) device, a handheld device with wireless charging function, a computing device or other processing device, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system, and a next-generation communication system, for example, a mobile terminal in a 5G network, a mobile terminal in a future evolved public land mobile network (PLMN), or a mobile terminal in a future evolved non-terrestrial network (NTN).
[0034] For example, the electronic device can communicate with a network and other devices via wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0035] Figure 2 is a flowchart showing a method for establishing a web page hierarchy according to an embodiment of the present disclosure. As Figure 2 shown, this embodiment provides a method for establishing a web page hierarchy, including:
[0036] Step S1, modify the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten.
[0037] Optionally, V8 is the name of a JavaScript engine that provides support for the Chrome browser and can be used to execute browser-side JavaScript code. The V8 runtime code can be located in the chromium / src / v8 / src / runtime directory. After modifying the V8 engine runtime code, recompile the browser source code to obtain a new version of the browser, and re-execute the rewriting of the methods in the variable object to be rewritten in the new version of the browser to successfully complete the rewriting.
[0038] Optionally, the method for modifying the web page V8 engine to bypass the read-only protection implementation of the global variables to be rewritten by the V8 engine includes: skipping the read-only check of the global variables to be rewritten in the V8 engine, where the variables to be rewritten include location, history, and windows. Here, location, history, and windows are global variables in the HTML (HyperText Markup Language) web page standard, which will not be elaborated in this embodiment.
[0039] Optionally, the read-only protection includes: when the global variable attribute of the V8 engine contains read-only or non-enumerable, a prohibition of redefinition exception is thrown.
[0040] Optionally, when the global variable attribute of the V8 engine contains read-only or non-enumerable, the specific situation of throwing a prohibition of redefinition exception can be: before modifying the V8 engine, when JavaScript attempts to modify an object, it first uses the LookupIterator method to search for the variable in the global variables. If found, it calls JSReceiver::GetPropertyAttributes to obtain the property of the object, and determines whether its property contains read-only (READ_ONLY) or non-enumerable (DONT_ENUM). If the property contains read-only or non-enumerable, a prohibition of redefinition exception is thrown. The specific form of this exception can be as Figure 3 shown.
[0041] Step S2, load the current web page and inject a script after successful loading.
[0042] Optionally, the script may refer to a script for dynamically capturing web page links through a hook, and the script is injected into each successfully loaded web page.
[0043] Step S3, based on the jump element of the current web page, jump to the next-level page, and dynamically capture the link of the next-level page by triggering the hook to obtain the link of the next-level page.
[0044] Optionally, the jump element may refer to the element on the current web page that can jump to the next-level page.
[0045] Optionally, a hook may refer to various techniques for modifying or extending the behavior of an operating system, application program, or other software components by intercepting function calls, message passing, and event passing between software modules. The code for processing intercepted function calls, events, and messages is called a hook.
[0046] Optionally, the next-level page may refer to the next-level page of the current web page. For example, if the current web page is at the second level, the first-level page is the third-level page.
[0047] Optionally, the implementation method of dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page includes: dynamically capturing the link of the next-level page based on the rewritten location.href property, rewritten location.hash property, rewritten location.replace method, rewritten location.assign method, rewritten history.pushState method, rewritten history.replaceState method, and rewritten windows.open method to obtain the link of the next-level page.
[0048] Optionally, location may refer to the location property provided by the window object, which is used to obtain or set the URL (Uniform Resource Locator) of the form and can be used to parse the URL. The property returns an object, and this property can be called the location object. Using the properties and methods of location can implement the acquisition and operation of the URL in the browser address bar. window may refer to the window object, and the window object represents the window opened by the browser. history may refer to the history object, and the history object stores all the page URLs visited by the current window.
[0049] The location.href property can set or obtain the URL of the current page. By setting its value to a new URL, page redirection can be achieved. The location.hash property can return the hash in the URL. The location.replace method can replace the history of the current page, preventing the user from returning to the previous page. The location.assign method can load a new URL to achieve the function of page redirection. The history.pushState method means adding a new history record to the current browsing history stack, and the page will not be reloaded after adding. The history.replaceState method is basically the same as the history.pushState method, with only one difference. The history.replaceState method does not generate a new history record but replaces the current history record, and is often used for landing pages. The windows.open method means loading a resource into a new browsing context (such as a window) or an existing browsing context according to the specified parameters.
[0050] Optionally, the implementation method for dynamically capturing the link of the next-level page based on the rewritten history.pushState method includes: Executing the hook: storing the original pushState method of the history object; storing the obtained web page link (the link of the next-level page) in the page cache for subsequent acquisition; calling the stored original pushState method to update the web page normally; after a delay, reverting the web page to the original state. Canceling the hook: restoring it using the stored pushState method.
[0051] Optionally, the implementation method for dynamically capturing the link of the next-level page based on the rewritten history.replaceState method includes: Executing the hook: storing the original replaceState method of the history object; storing the obtained web page link (the link of the next-level page) in the page cache for subsequent acquisition; calling the stored original replaceState method to update the web page normally; after a delay, reverting the web page to the original state. Canceling the hook: restoring it using the stored replaceState method.
[0052] Optionally, an implementation method for dynamically capturing the link of the next-level page based on the rewritten location.href property, rewritten location.hash property, rewritten location.replace method, and rewritten location.assign method includes: Executing the hook: Customize the setHookUrl (set hook URL) method, and this customized setHookUrl method stores the obtained web page link (the link of the next-level page) in the page cache for subsequent acquisition; Store the original location object; Determine the methods and properties that need to be rewritten, namely the replace and assign methods, and the href and hash properties; Traverse all method and property names in the original location. If it is a method that does not need to be rewritten, directly copy the original method. If it is a property that does not need to be rewritten, copy the original property value; Assign values to the replace method and assign method using the customized setHookUrl method; Modify (set) the href property using the customized setHookUrl method, and read (get) the href property using the original href property; Modify (set) the hash property using the customized setHookUrl method, and read (get) the hash property using the original hash property; Canceling the hook: Restore using the stored location object.
[0053] Optionally, an implementation method for dynamically capturing the link of the next-level page based on the rewritten location.href property, rewritten location.hash property, rewritten location.replace method, and rewritten location.assign method can be represented by the following code:
[0054]
[0055]
[0056]
[0057] Optionally, an implementation method for dynamically capturing the link of the next-level page based on the rewritten history.replaceState and pushState methods can be represented by the following code:
[0058]
[0059]
[0060]
[0061] Step S4. If the next-level page is the finally jumped page, establish a hierarchical relationship of web page links based on the link of the current web page and the link of the next-level page; otherwise, return to Step S2, and the page of the current web page in Step S2 is the next-level page.
[0062] Optionally, the hierarchical relationship of the web page links may refer to the hierarchical relationship between the page of the current web page and the next-level page, that is, the hierarchical relationship between the web page pages loaded during the process from Step S1 to Step S4. A website can be regarded as a tree structure. The home page entry is the first level of the website. Jumping to the link in the home page enters the page of the second level. Jumping to the link in the page of the second level enters the page of the third level, and so on. Jumping to the link in the page of the (N - 1)th level enters the page of the Nth level, where N is a positive integer.
[0063] Optionally, the finally jumped page can be flexibly set according to the actual situation, and this embodiment does not clearly limit this.
[0064] According to the above description, the hierarchical relationship establishing method includes: Step S1, modify the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten; Step S2, load the current web page and inject a script after successful loading; Step S3, jump to the next-level page based on the jump element of the current web page, and dynamically capture the link of the next-level page by triggering a hook to obtain the link of the next-level page; Step S4, if the next-level page is the finally jumped page, establish a hierarchical relationship of web page links based on the link of the current web page and the link of the next-level page; otherwise, return to Step S2, and the page of the current web page in Step S2 is the next-level page.
[0065] The hierarchical relationship establishing method can intercept the jump method in the current web page standard and establish a hierarchical relationship of web page links according to the link of the current web page and the link of the next-level page by modifying the V8 engine and dynamically capturing the link of the next-level page by triggering a hook.
[0066] Figure 4 is a flowchart showing an implementation method for dynamically capturing the link of the next-level page based on the rewritten windows.open method according to an embodiment of the present disclosure to obtain the link of the next-level page. As Figure 4 shown, this embodiment provides an implementation method for dynamically capturing the link of the next-level page based on the rewritten windows.open method to obtain the link of the next-level page, including:
[0067] S21. Store the original `windows.open` method.
[0068] Optionally, the original `windows.open` method may refer to the original `windows.open` method of the browser.
[0069] Optionally, the method of storing the original `windows.open` method includes: performing a hook: storing the original `open` method of the `windows` object.
[0070] S22. Store the link of the next-level page in the page cache based on the rewritten `windows.open` method to obtain the link of the next-level page.
[0071] Optionally, the rewritten `windows.open` method may include storing the obtained link in the page cache for subsequent acquisition. The method of storing the link of the next-level page in the page cache based on the rewritten `windows.open` method to obtain the link of the next-level page includes: storing the obtained link (the link of the next-level page) in the page cache to obtain the link of the next-level page.
[0072] Optionally, the page cache is used for subsequent acquisition of the link of the next-level page.
[0073] S23. Restore using the stored `windows.open` method.
[0074] Optionally, restoring using the stored `windows.open` method may refer to restoring the rewritten `windows.open` method to the original `windows.open` method using the stored `windows.open` method.
[0075] Optionally, the method of restoring using the stored `windows.open` method includes: canceling the hook: restoring using the stored `windows.open` method.
[0076] Optionally, the implementation method of dynamically capturing the link of the next-level page based on the rewritten `windows.open` method to obtain the link of the next-level page can be represented by the following code:
[0077]
[0078]
[0079] Figure 5It is a flowchart showing an implementation method of jumping to the next-level page based on a jump element of the current web page according to an embodiment of the present disclosure, and dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page, as Figure 5 As shown, this embodiment provides an implementation method of jumping to the next-level page based on a jump element of the current web page, and dynamically capturing the link of the next-level page by triggering a hook to obtain the link of the next-level page, including:
[0080] S31, obtain the jump element selected by the user.
[0081] Optionally, the selected jump element may be an element that the user records or batch-selects on the web page that needs to be jumped, and the user may also select to extract table data, pictures, etc. on the web page for custom operations.
[0082] Optionally, the script in step S2 may include the rewritten location.href property, the rewritten location.hash property, the rewritten location.replace method, the location.assign method, the rewritten history.pushState method, the rewritten history.replaceState method, and the rewritten windows.open method, event listening (for recording the user's operations), and the user's interaction interface.
[0083] S32, based on the selected jump element, jump to the next-level page.
[0084] Optionally, the implementation method of jumping to the next-level page based on the selected jump element may be to click on the selected jump element to jump to the next-level page.
[0085] Preferably, the implementation method of jumping to the next-level page based on the selected jump element may include: clicking on the first selected jump element or a relatively typical selected element. The meaning of only selecting one of them is that these batch elements are similar, and as long as one of them is set, it can correspond to the batch elements. The significance of jumping to the next-level page is to open the next-level page to allow the user to continue with the visual setting.
[0086] S33, dynamically capture the link of the next-level page by triggering a hook to obtain the link of the next-level page.
[0087] Figure 6 It is a flowchart showing a method for establishing a web page hierarchy according to an embodiment of the present disclosure, as Figure 6 As shown, this embodiment of the present disclosure provides a method for establishing a web page hierarchy, including:
[0088] S41. Dynamically generate an execution script based on the hierarchical relationship.
[0089] Optionally, the hierarchical relationship may refer to the hierarchical relationship of web page links established by recording user settings. The execution script may refer to a script dynamically generated during the process of constructing the hierarchical relationship according to user settings, and the execution script can fix the websites associated with the hierarchical relationship.
[0090] S42. Fix the websites associated with the hierarchical relationship layer by layer based on the execution script.
[0091] Optionally, the implementation method of fixing the websites associated with the hierarchical relationship layer by layer based on the execution script includes: by executing the generated execution script, batch-fixing the websites according to the user's settings layer by layer, so as to ultimately achieve the purpose of fixing the entire site layer by layer. The websites associated with the hierarchical relationship refer to the entire website including the current web page and the next-level page.
[0092] Figure 7 is a flowchart showing the method for establishing web page levels in an embodiment of the present disclosure. As Figure 7 shown, an embodiment of the present disclosure provides a method for establishing web page levels. As Figure 7 shown, the method for establishing web page levels includes:
[0093] 1. Modify the V8 engine to bypass the read-only protection of global variables such as location by the V8 engine.
[0094] 2. Load the web page and inject the script after the web page is successfully loaded.
[0095] 3. Hook all methods for dynamic web page jumps and dynamically capture jump links when the web page code is executed. This includes rewriting the location.href property, location.hash property, location.replace method, location.assign method, history.pushState method, history.replaceState method, and windows.open method.
[0096] 4. Guide the user to record or batch-select the elements on the web page that need to be jumped. During this period, the user can also choose to extract custom operations such as table data and pictures on the page.
[0097] 5. After the user finishes setting on the current page, click to enter the next-level page. By default, the first element is selected for jumping, or a relatively typical element selected by the user is used for jumping. The meaning of only selecting one of them here is that all elements in this batch are similar, and setting only one of them can correspond to the batch of elements. The significance of jumping to the next-level page is to open the next-level page to allow the user to continue visual setting.
[0098] 6. After the method for triggering the hook dynamically intercepts the link, repeat step 2 until the user exits and continues to jump.
[0099] 7. Record the user's operations, establish the hierarchical relationship of the link according to the user's guidance, and dynamically generate an execution script.
[0100] 8. Execute the generated script to fix the target website in batches according to the user's settings layer by layer, so as to finally achieve the purpose of fixing the entire site layer by layer. The difference between this disclosure and general interception methods lies in: General interception methods have limitations and can only hook some methods and variables not protected by V8, while this disclosure has no such limitation and can intercept all jump methods in the current web page standard. More importantly, the construction of the web page hierarchical relationship is constructed under the user's custom operations, with a more definite target and meeting the requirements for accuracy in the field of evidence collection.
[0101] In an embodiment of the present disclosure, the hierarchical establishment method can fix the evidence collection of a certain illegal website. The hierarchical establishment method includes:
[0102] 1. Prepare a customized version browser with the V8 engine modified.
[0103] 2. Load the illegal website link.
[0104] 3. Automatically inject a script after the website is successfully loaded to hook the method of dynamic jumping.
[0105] 4. Guide the user to batch-select jump elements and enter the next-level page to continue setting.
[0106] 5. Trigger the method of the hook to intercept the jump link.
[0107] 6. Repeat the above step 2 until the user exits the setting.
[0108] 7. Build a hierarchical key according to the user's settings and dynamically generate a script.
[0109] 8. Execute the generated script to fix the entire site layer by layer.
[0110] The protection scope of the web page hierarchy establishment method described in the embodiments of the present disclosure is not limited to the execution order of the steps listed in this embodiment. Any solution achieved by adding or subtracting steps of the prior art or replacing steps according to the principles of the present disclosure is included in the protection scope of the present disclosure.
[0111] Figure 8 shows a web page hierarchy establishment device in the embodiments of the present disclosure. As Figure 8 shown, this embodiment provides a web page hierarchy establishment device 80, including:
[0112] An engine modification module 810, configured to modify the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten.
[0113] A web page loading module 820, configured to load the current web page and inject a script after successful loading.
[0114] A link capture module 830, configured to jump to the next-level page based on the jump element of the current web page, and dynamically capture the link of the next-level page by triggering a hook to obtain the link of the next-level page.
[0115] A hierarchy establishment module 840, configured to, if the next-level page is the finally jumped page, establish a hierarchical relationship of the web page links based on the link of the current web page and the link of the next-level page; otherwise, return to the web page loading module, and the page of the current web page in the web page loading module is the next-level page.
[0116] In the web page hierarchy establishment device, the engine modification module 810 corresponds to step S11 one by one, the web page loading module 820 corresponds to step S12 one by one, the link capture module 830 corresponds to step S13 one by one, and the hierarchy i establishment module 840 corresponds to step S14 one by one.
[0117] In several embodiments provided by the present disclosure, it should be understood that the disclosed device or method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules / units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, and the indirect coupling or communication connection of devices or modules or units may be in electrical, mechanical or other forms.
[0118] The modules / units described as separate components may or may not be physically separated, and the components shown as modules / units may or may not be physical modules, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected according to actual needs to achieve the objectives of the embodiments of the present disclosure. For example, in the embodiments of the present disclosure, the functional modules / units can be integrated into one processing module, or each module / unit can exist physically alone, or two or more modules / units can be integrated into one module / unit.
[0119] Those of ordinary skill in the art should further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0120] As Figure 9 shown, the electronic device of the present invention is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: one or more processors or processing units 91, a memory 92, and a bus 93 connecting different system components (including the memory 92 and the processing unit 91).
[0121] The bus 93 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0122] The electronic device typically includes a variety of computer system-readable media. These media can be any available media accessible by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0123] The memory 92 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 921 and / or cache memory 922. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 923 may be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 9 not shown, commonly referred to as a "hard disk drive"). Although Figure 9 not shown in, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk"), and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 93 through one or more data media interfaces. The memory 92 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0124] A program / utility 924 having a set (at least one) of program modules 9241 may be stored, for example, in the memory 92. Such program modules 9241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 9241 generally execute the functions and / or methods in the embodiments described in the present invention.
[0125] The electronic device may also communicate with one or more external devices (such as a keyboard, a pointing device, a display, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device, and / or communicate with any device that enables the electronic device to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through the input / output (I / O) interface 94. Also, the electronic device may communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 95. As Figure 9 shown, the network adapter 95 communicates with other modules of the electronic device through the bus 93. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0126] Embodiments of the present disclosure also provide a computer-readable storage medium. Those of ordinary skill in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing a processor through a program. The program can be stored in a computer-readable storage medium. The storage medium is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrating one or more available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid-state disk (SSD)), etc.
[0127] Embodiments of the present disclosure may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in the embodiments of the present disclosure are generated. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, or data center to another website, computer, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.).
[0128] When the computer program product is executed by a computer, the computer executes the method described in the foregoing method embodiments. The computer program product can be a software installation package. In the case where the foregoing method is required, the computer program product can be downloaded and executed on the computer.
[0129] The descriptions of the processes or structures corresponding to the above respective drawings each have their own focuses. For parts not detailed in a certain process or structure, reference can be made to the relevant descriptions of other processes or structures.
[0130] The above embodiments are only illustrative of the principles and effects of the present disclosure, and are not used to limit the present disclosure. Any person familiar with this technology can make modifications or changes to the above embodiments without departing from the spirit and scope of the present disclosure. Therefore, all equivalent modifications or changes made by those of ordinary skill in the art in the technical field without departing from the spirit and technical ideas disclosed by the present disclosure should still be covered by the claims of the present disclosure.
Claims
1. A method for establishing a web page hierarchy, characterized in that, Including: Step S1, modify the web page V8 engine to bypass the read-only protection of the global variables to be rewritten by the V8 engine; Step S2, load the current web page and inject a script after successful loading; Step S3, based on the jump element of the current web page, jump to the next-level page, and dynamically capture the link of the next-level page through a trigger hook to obtain the link of the next-level page; Step S4, if the next-level page is the finally jumped page, establish a hierarchical relationship of web page links based on the link of the current web page and the link of the next-level page, otherwise return to Step S2, and the current web page in Step S2 is the next-level page.
2. The hierarchical building method according to claim 1, wherein The implementation method of modifying the web page V8 engine to bypass the read-only protection of the global variables to be rewritten by the V8 engine includes: skipping the read-only check of the global variables to be rewritten in the V8 engine, and the global variables to be rewritten include location, history, and windows.
3. The hierarchical building method according to claim 1, characterized in that, The implementation method of dynamically capturing the link of the next-level page through a trigger hook to obtain the link of the next-level page includes: dynamically capturing the link of the next-level page through a trigger hook to obtain the link of the next-level page, and the implementation method includes: dynamically capturing the link of the next-level page based on the rewritten location.href property, rewritten location.hash property, rewritten location.replace method, location.assign method, rewritten history.pushState method, rewritten history.replaceState method, and rewritten windows.open method to obtain the link of the next-level page.
4. The hierarchical establishment method according to claim 3, characterized in that The implementation method of dynamically capturing the link of the next-level page based on the rewritten windows.open method to obtain the link of the next-level page includes: Store the original windows.open method; Based on the rewritten windows.open method, store the link of the next-level page in the page cache to obtain the link of the next-level page; Restore using the stored windows.open method.
5. The hierarchical establishment method according to claim 1, characterized in that The implementation method of jumping to the next-level page based on the jump element of the current web page and dynamically capturing the link of the next-level page through a trigger hook to obtain the link of the next-level page includes: Obtain the jump element selected by the user; Based on the selected jump element, jump to the next-level page; Dynamically capture the link of the next-level page through a trigger hook to obtain the link of the next-level page.
6. The hierarchical establishment method according to claim 1, wherein Also including: Dynamically generate an execution script based on the hierarchical relationship; Based on the execution script, fix the websites associated with the hierarchical relationship layer by layer.
7. The hierarchical establishment method according to claim 1, wherein The read-only protection includes: when the global variable attribute of the V8 engine contains read-only or non-enumerable, throw a prohibited redefinition exception.
8. A web page hierarchy establishment device, characterized in that, Including: An engine modification module for modifying the web page V8 engine to bypass the read-only protection of the V8 engine for the global variables to be rewritten; A web page loading module for loading the current web page and injecting scripts after successful loading; A link capture module for jumping to the next-level page based on the jump elements of the current web page and dynamically capturing the links of the next-level page by triggering a hook to obtain the links of the next-level page; A hierarchy establishment module for establishing a hierarchical relationship of web page links based on the link of the current web page and the link of the next-level page if the next-level page is the finally jumped page, otherwise returning to the web page loading module, and the current web page in the web page loading module is the next-level page; 9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the hierarchical establishment method described in claims 1-7.
10. An electronic device, characterized in that, Comprising: A memory; A processor coupled to the memory and configured to execute the hierarchical establishment method described in claims 1-7.