CN115033877A - Method for restoring webpage watermark, computer readable storage medium and computer equipment - Google Patents

Method for restoring webpage watermark, computer readable storage medium and computer equipment Download PDF

Info

Publication number
CN115033877A
CN115033877A CN202210743288.6A CN202210743288A CN115033877A CN 115033877 A CN115033877 A CN 115033877A CN 202210743288 A CN202210743288 A CN 202210743288A CN 115033877 A CN115033877 A CN 115033877A
Authority
CN
China
Prior art keywords
watermark
watermark element
webpage
changed
user information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210743288.6A
Other languages
Chinese (zh)
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.)
Shenzhen Yishi Huolala Technology Co Ltd
Original Assignee
Shenzhen Yishi Huolala Technology 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 Shenzhen Yishi Huolala Technology Co Ltd filed Critical Shenzhen Yishi Huolala Technology Co Ltd
Priority to CN202210743288.6A priority Critical patent/CN115033877A/en
Publication of CN115033877A publication Critical patent/CN115033877A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a method for restoring a webpage watermark, a computer readable storage medium and a computer device, comprising the following steps: generating watermark elements on the opened webpage, and storing the patterns of the watermark elements; acquiring user information logged in by a user before opening a webpage; monitoring whether a Document Object Model (DOM) element is changed or not, and binding a processing function; if the watermark element is changed, triggering a processing function to check whether the watermark element is changed; if the watermark element is changed, the watermark element is restored through the stored style of the watermark element, and a watermark element change message and user information causing the watermark element change are sent to the back-end server. The webpage watermark can be restored, and the user who changes the watermark can be tracked.

Description

Method for restoring webpage watermark, computer readable storage medium and computer equipment
Technical Field
The present application relates to the field of image processing, and in particular, to a method for restoring a web watermark, a computer-readable storage medium, and a computer device.
Background
A developer of the WEB page determines whether the watermark elements on the webpage are deleted or modified by using a polling technology, namely JavaScript is used uninterruptedly, whether the watermark elements on the webpage exist is searched at regular intervals, and whether the style of the watermark elements is changed is checked.
However, this approach is very computer resource consuming, and may result in a stuck impact on the user experience; the high-frequency polling may cause the page version of the user to be blocked, and the user experience is greatly influenced; and lacks the identity tracing means of the person who destroys the watermark.
Disclosure of Invention
The application aims to provide a method for restoring a webpage watermark, a computer readable storage medium and computer equipment, and aims to solve the problem that a tracing means of a user for changing the webpage watermark is lacked.
In a first aspect, the present application provides a method for restoring a watermark of a web page, including:
generating watermark elements on the opened webpage, and storing the patterns of the watermark elements;
acquiring user information logged in by a user before opening a webpage;
monitoring whether a Document Object Model (DOM) element changes or not, and binding a processing function; the processing function is used for detecting whether the watermark elements are changed or not by monitoring the patterns of the watermark elements, obtaining opened webpage information and user information and recovering the states of the watermark elements;
if no change occurs, the processing function is not triggered; if the watermark elements are changed, triggering a processing function to check whether the watermark elements are changed;
if the watermark element is changed, the watermark element is restored through the stored style of the watermark element, and a watermark element change message and user information causing the watermark element change are sent to the back-end server.
Further, the user information is information registered in real name or information of account number inside the company.
Further, the method further comprises: and the back-end server sends the watermark element change message and the user information causing the watermark element change to a responsible person.
Further, the sending the watermark element change message and the user information causing the watermark element change to the backend server specifically includes: the processing function encrypts and disguises the watermark element change message and the user information causing the watermark element change into a common request to be sent to the back-end server, and the back-end server analyzes the request to obtain the watermark element change message and the user information causing the watermark element change.
Further, the method further comprises: when the network is disconnected and the analysis request fails, the analysis request is stored, and the analysis request is reinitiated after the network is recovered.
Further, the generating of the watermark element on the opened webpage and the storing of the style of the watermark element specifically include: generating a picture of the watermark element by using a JavaScript canvas object, setting a unique id value for the watermark element, and storing the style of the current watermark element in a background database, wherein the style is written on an inner link in a form of highest priority.
Further, the watermark element is changed by deleting the watermark element or modifying the style of the watermark element; the pattern of the watermark element is modified such that the id and/or the inline of the watermark element is changed.
Further, the monitoring whether the DOM element of the document object model changes specifically includes: monitoring a Document Object Model (DOM) element through a variable observer MutationObserver of JavaScript;
the change is that: the characteristics of the DOM elements of the document object model are changed, or the nodes of the text are changed, or one or a plurality of combinations of the sub-elements are added or deleted.
Further, the method further comprises: if the JavaScript is forbidden before the webpage is loaded, the content on the webpage is not loaded;
the variable observer multimedia observer is initialized before the content on the webpage is loaded out, and if the JavaScript is forbidden after the content on the webpage is loaded out, the variable observer multimedia observer will normally run;
and if the memory is cleared, clearing the content on the webpage.
In a second aspect, the present application provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of the method for restoring a watermark of a web page.
In a third aspect, the present application provides a computer device comprising: one or more processors, a memory, and one or more computer programs, the processors and the memory being connected by a bus, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, which when executing the computer programs implement the steps of the method of restoring a watermark of a web page.
In the method, whether a DOM element of a document object model is changed or not is monitored through a JavaScript change observer, if the DOM element is changed, a processing function is triggered, the monitoring performance is improved, and the defects of a traditional polling method are avoided; and simultaneously, tracing the real identity of the user with the element watermark change through the real name grade of the user.
Drawings
Fig. 1 is a flowchart of a method for restoring a web watermark according to an embodiment of the present application.
Fig. 2 is a block diagram illustrating a specific structure of a computer device according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solution and beneficial effects of the present application more clear and more obvious, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 1, a method for restoring a web watermark according to an embodiment of the present application includes the following steps: it should be noted that, if the result is substantially the same, the method for restoring the web page watermark is not limited to the flow sequence shown in fig. 1.
S101, generating watermark elements on an opened webpage, and storing the patterns of the watermark elements;
s102, obtaining user information logged in by a user before the user opens a webpage;
s103, monitoring whether a Document Object Model (DOM) element changes or not, and binding a processing function; the processing function is used for detecting whether the watermark elements are changed or not by monitoring the patterns of the watermark elements, obtaining opened webpage information and user information and recovering the states of the watermark elements;
s104, if the change does not occur, the processing function is not triggered; if the watermark element is changed, triggering a processing function to check whether the watermark element is changed;
and S105, if the watermark elements are changed, restoring the watermark elements according to the stored watermark element patterns, and sending watermark element change information and user information causing the watermark element change to a back-end server.
The web page includes HTML, CSS, and JavaScript.
In an embodiment of the present application, the user information is information registered in a real name or information about an internal account of a company.
In an embodiment of the present application, the method further includes: and the back-end server sends the watermark element change message and the user information causing the watermark element change to a responsible person.
In an embodiment of the present application, the sending the watermark element change message and the user information causing the watermark element change to the backend server specifically includes: the processing function encrypts and disguises the watermark element change message and the user information causing the watermark element change into a common request to be sent to the back-end server, and the back-end server analyzes the request to obtain the watermark element change message and the user information causing the watermark element change.
In an embodiment of the present application, the method further includes: when the network is disconnected and the analysis request fails, the analysis request is stored, and the analysis request is reinitiated after the network is recovered.
In an embodiment of the present application, the generating a watermark element on an open web page and storing a style of the watermark element specifically includes: generating a picture of the watermark element by using a JavaScript canvas object, setting a unique id value for the watermark element, and storing the style of the current watermark element in a background database, wherein the style is written on an inner link in a form of highest priority.
In an embodiment of the present application, the watermark element change is that the watermark element is deleted or that the pattern of the watermark element is modified; the pattern of the watermark element is modified such that the id and/or the inline of the watermark element is changed.
In an embodiment of the present application, the monitoring whether a document object model DOM element changes specifically includes: monitoring a Document Object Model (DOM) element through a variable observer MutationObserver of JavaScript;
the change is that: the characteristics of the DOM elements of the document object model change, or the text nodes change, or one or a combination of several of the sub-elements are added or deleted.
In an embodiment of the present application, the method further includes: if the JavaScript is forbidden before the webpage is loaded, the content on the webpage is not loaded;
the variable observer multimedia observer is initialized before the content on the webpage is loaded out, and if the JavaScript is forbidden after the content on the webpage is loaded out, the variable observer multimedia observer will normally run;
and if the memory is cleared, clearing the content on the webpage.
An embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method for restoring a watermark of a web page provided in an embodiment of the present application.
Fig. 2 shows a specific block diagram of a computer device provided in an embodiment of the present application, where the computer device 100 includes: one or more processors 101, a memory 102, and one or more computer programs, wherein the processors 101 and the memory 102 are connected by a bus, the one or more computer programs are stored in the memory 102 and configured to be executed by the one or more processors 101, and the processor 101 implements the steps of the method of restoring a web page watermark as provided by an embodiment of the present application when executing the computer programs.
The computer equipment comprises a server, a terminal and the like. The computer device may be a desktop computer, a mobile terminal or a vehicle-mounted device, and the mobile terminal includes at least one of a mobile phone, a tablet computer, a personal digital assistant or a wearable device.
In the embodiment of the application, whether a DOM element of a document object model is changed or not is monitored through a JavaScript change observer, and if the DOM element is changed, a processing function is triggered, so that the monitoring performance is improved, and the defects of the traditional polling method are overcome; and simultaneously, tracing the real identity of the user with the element watermark changed through the real name grade of the user.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for restoring a watermark to a web page, comprising:
generating watermark elements on the opened webpage, and storing the patterns of the watermark elements;
acquiring user information logged in by a user before opening a webpage;
monitoring whether a Document Object Model (DOM) element changes or not, and binding a processing function; the processing function is used for detecting whether the watermark element is changed or not by monitoring the style of the watermark element, obtaining opened webpage information and user information and recovering the state of the watermark element;
if no change occurs, the processing function is not triggered; if the watermark element is changed, triggering a processing function to check whether the watermark element is changed;
if the watermark element is changed, the watermark element is restored through the stored style of the watermark element, and a watermark element change message and user information causing the watermark element change are sent to the back-end server.
2. The method of claim 1, wherein the user information is information of real name registration or company internal account information;
the method further comprises the following steps: and the back-end server sends the watermark element change message and the user information causing the watermark element change to a responsible person.
3. The method according to claim 1, wherein the sending the watermark element change message and the user information causing the watermark element change to the backend server is specifically: the processing function encrypts and disguises the watermark element change message and the user information causing the watermark element change into a common request to be sent to the back-end server, and the back-end server analyzes the request to obtain the watermark element change message and the user information causing the watermark element change.
4. The method of claim 3, wherein the method further comprises: when the network is disconnected and the analysis request fails, the analysis request is stored, and the analysis request is reinitiated after the network is recovered.
5. The method of claim 1, wherein the generating of the watermark element on the open web page and the saving of the pattern of the watermark element are specifically: generating a picture of the watermark element by using a JavaScript canvas object, setting a unique id value for the watermark element, and storing the style of the current watermark element in a background database, wherein the style is written on an inner link in a form of highest priority.
6. The method of claim 1, wherein the watermark element change is a watermark element deletion or a watermark element pattern modification; the pattern of the watermark element is modified such that the id and/or the inline of the watermark element is changed.
7. The method according to claim 5, wherein said monitoring whether Document Object Model (DOM) elements are changed is specifically: monitoring a Document Object Model (DOM) element through a variable observer MutationObserver of JavaScript;
the change is that: the characteristics of the DOM elements of the document object model are changed, or the nodes of the text are changed, or one or a plurality of combinations of the sub-elements are added or deleted.
8. The method of claim 1, wherein the method further comprises: if the JavaScript is forbidden before the webpage is loaded, the content on the webpage is not loaded;
the variable observer multimedia observer is initialized before the content on the webpage is loaded out, and if the JavaScript is forbidden after the content on the webpage is loaded out, the variable observer multimedia observer will normally run;
and if the memory is cleared, clearing the content on the webpage.
9. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of restoring a watermark of a web page according to any one of claims 1 to 8.
10. A computer device, comprising: one or more processors, a memory, and one or more computer programs, the processors and the memory being connected by a bus, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, characterized in that the steps of the method of restoring a web page watermark according to any one of claims 1 to 8 are implemented when the computer programs are executed by the processors.
CN202210743288.6A 2022-06-28 2022-06-28 Method for restoring webpage watermark, computer readable storage medium and computer equipment Pending CN115033877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210743288.6A CN115033877A (en) 2022-06-28 2022-06-28 Method for restoring webpage watermark, computer readable storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210743288.6A CN115033877A (en) 2022-06-28 2022-06-28 Method for restoring webpage watermark, computer readable storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN115033877A true CN115033877A (en) 2022-09-09

Family

ID=83127060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210743288.6A Pending CN115033877A (en) 2022-06-28 2022-06-28 Method for restoring webpage watermark, computer readable storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN115033877A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756708A (en) * 2023-05-30 2023-09-15 佛山众陶联供应链服务有限公司 Protection method for variable granularity of digital product page copyright

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756708A (en) * 2023-05-30 2023-09-15 佛山众陶联供应链服务有限公司 Protection method for variable granularity of digital product page copyright
CN116756708B (en) * 2023-05-30 2023-12-05 佛山众陶联供应链服务有限公司 Protection method for variable granularity of digital product page copyright

Similar Documents

Publication Publication Date Title
US8326830B2 (en) Pattern recognition in web search engine result pages
CN104486140B (en) It is a kind of to detect device and its detection method that webpage is held as a hostage
CN104348803B (en) Link kidnaps detection method, device, user equipment, Analysis server and system
US9436763B1 (en) Infrastructure enabling intelligent execution and crawling of a web application
CN109034993A (en) Account checking method, equipment, system and computer readable storage medium
CN108366058B (en) Method, device, equipment and storage medium for preventing traffic hijacking of advertisement operator
CN109688097A (en) Website protection method, website protective device, website safeguard and storage medium
CN101888311B (en) Equipment, method and system for preventing network contents from being tampered
CN104766014A (en) Method and system used for detecting malicious website
CN109344661B (en) Machine learning-based micro-proxy webpage tamper-proofing method
CN110035075A (en) Detection method, device, computer equipment and the storage medium of fishing website
CN105868231A (en) Cache data updating method and device
CN115033877A (en) Method for restoring webpage watermark, computer readable storage medium and computer equipment
CN110336812A (en) Resource intercepting processing method, device, computer equipment and storage medium
CN109446801A (en) Detect method, apparatus, server and the storage medium of simulator access
CN111597422A (en) Buried point mapping method and device, computer equipment and storage medium
CN110417746A (en) Cross-site scripting attack defence method, device, equipment and storage medium
CN104915404A (en) Method and device for accessing invalid website
CN113810375B (en) Webshell detection method, device and equipment and readable storage medium
CN111309578A (en) Method and device for identifying object
CN108696519B (en) Webpage tamper-proofing system and method based on shared storage
CN112579958B (en) Webpage conversion method, webpage conversion device, computer equipment and readable storage medium
WO2024051017A1 (en) Distributed website tampering detection system and method
WO2021189766A1 (en) Data visualization method and related device
US9824140B2 (en) Method of creating classification pattern, apparatus, and recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination