CN113722639A - Website access verification method and device, electronic equipment and readable storage medium - Google Patents

Website access verification method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113722639A
CN113722639A CN202110984559.2A CN202110984559A CN113722639A CN 113722639 A CN113722639 A CN 113722639A CN 202110984559 A CN202110984559 A CN 202110984559A CN 113722639 A CN113722639 A CN 113722639A
Authority
CN
China
Prior art keywords
website
preset protection
code
format
protection code
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.)
Granted
Application number
CN202110984559.2A
Other languages
Chinese (zh)
Other versions
CN113722639B (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110984559.2A priority Critical patent/CN113722639B/en
Publication of CN113722639A publication Critical patent/CN113722639A/en
Application granted granted Critical
Publication of CN113722639B publication Critical patent/CN113722639B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Storage Device Security (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a website access verification method, a website access verification device, electronic equipment and a readable storage medium, wherein the format of part of source codes in a target website is converted into the format of preset protection codes from the original format in advance, the preset protection codes are combined with the part of the source codes in the target website, when the target website is accessed, the preset protection codes can be loaded to perform security verification on the target website, when the result of the security verification is failure, the target website can be determined not to be the security website, at the moment, non-reduction operation can be performed on part of the source codes through the preset protection codes in the process of loading the target website, and as the part of the source codes are not reduced, the target website cannot be loaded completely, the effect of protecting the security website is achieved, the information security is ensured, and as the domain name of the security website does not need to be bound, And IP does not need to modify the file of the safe website every time the domain name and the IP are replaced, so that the operation is simple and convenient, and the cost is low.

Description

Website access verification method and device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of information security, in particular to a website access verification method, a website access verification device, electronic equipment and a readable storage medium.
Background
The website is a tool for providing network services for other objects or acquiring the network services from other objects, and the behavior of stealing websites is more and more along with the richness of network resources.
The hacking station is also called an imitation station, and refers to downloading resources such as HTML (hypertext Markup Language), JS (JavaScript, and CSS (Cascading Style Sheets) of a total station in a specified website, and building a behavior of a similar imitation station through the resources, which may cause a potential safety hazard.
At present, a 'domain name/IP binding' technology is often adopted for preventing the website stealing behavior, specifically, the method includes binding a domain name of a current website in a JS file of the website, and not executing website loading when the domain names are inconsistent so as to prevent website imitation. However, the "domain name/IP binding" requires that the JS file be modified in time when the domain name and the IP of the website change, so as to ensure the protection effect on the website, thereby resulting in complex operation and higher cost.
Disclosure of Invention
The embodiment of the invention aims to provide a website access verification method, a website access verification device, electronic equipment and a readable storage medium, so that website stealing protection with simple and convenient operation and low cost is realized, and the website protection effect is improved.
The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a method for verifying website access is provided first, where the method may include:
loading a preset protection code when a target website is accessed, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of the source codes is converted into the format of the preset protection code from the original format in advance;
performing security verification on the target website by executing the preset protection code;
and under the condition that the result of the security verification is failure, in the process of loading the target website, performing non-reduction operation on the part of the source code through the preset protection code.
Optionally, the performing, by the preset protection code, a non-restoration operation on the part of the source code includes:
outputting a messy code through the preset protection code; or the like, or, alternatively,
and not outputting the part of the source code through the preset protection code.
Optionally, the format of the preset protection code is a dynamic execution format, and the performing security verification on the target website by executing the preset protection code includes:
and acquiring a verification file from a file directory of the target website by executing the preset protection code in the dynamic execution format, and performing the security verification.
Optionally, after the performing security verification on the target website by executing the preset protection code, the method further includes:
and under the condition that the result of the security verification is successful, in the process of loading the target website, restoring the partial source code into the original format through the preset protection code and then outputting the original format.
Optionally, before loading the preset protection code when the target website is accessed, the method further includes:
converting the format of part of source codes of the original website from the original format so as to enable the format of the part of source codes to be the same as that of the preset protection codes;
and merging the preset protection code with the partial source code.
Optionally, after merging the preset protection code with the partial source code, the method further includes:
and creating a verification file in a file directory of the original website, wherein the verification file is used for acquiring from the file directory by executing the preset protection code in the dynamic execution format.
Optionally, after merging the preset protection code with the partial source code, the method further includes:
and mixing the merged preset protection code with the preset protection code.
In a second aspect of the embodiments of the present invention, there is also provided a website access verification apparatus, which may include:
the website access module is used for loading a preset protection code when a target website is accessed, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of source codes is converted into the format of the preset protection code from the original format in advance;
the website verification module is used for performing security verification on the target website by executing the preset protection code;
and the website loading module is used for executing non-reduction operation on the part of the source codes through the preset protection codes in the process of loading the target website under the condition that the result of the security verification is failure.
Optionally, the website loading module is specifically configured to output a messy code through the preset protection code; or the like, or, alternatively,
the website loading module is specifically configured to not output the part of the source code through the preset protection code.
Optionally, the format of the preset protection code is a dynamic execution format, and the website verification module is specifically configured to obtain a verification file from a file directory of the target website by executing the preset protection code in the dynamic execution format, and perform the security verification.
Optionally, the website loading module is further configured to, in a process of loading the target website, restore the part of the source code to the original format through the preset protection code and output the restored part of the source code when the result of the security verification is successful.
Optionally, the apparatus further comprises:
the code conversion module is used for converting the format of part of source codes of the original website from the original format so as to enable the format of the part of source codes to be the same as that of the preset protection codes;
and the code merging module is used for merging the preset protection code and the part of the source code.
Optionally, the apparatus further comprises:
and the verification file module is used for creating a verification file in a file directory of the original website, and the verification file is used for acquiring the verification file from the file directory by executing the preset protection code in the dynamic execution format.
Optionally, the apparatus further comprises:
and the code obfuscating module is used for obfuscating the combined preset protection code and the preset protection code.
In another aspect of the embodiments of the present invention, an electronic device is further provided, where the electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the above website access verification methods when executing the program stored in the memory.
In yet another aspect of the embodiments of the present invention, there is also provided a readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute any one of the above described website access verification methods.
In yet another aspect of the embodiments of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above described methods for verifying website access.
In the embodiment of the invention, the format of part of source codes in a target website is converted into the format of preset protection codes in advance from the original format, the preset protection codes are combined with part of the source codes of the target website, when the target website is accessed, the preset protection codes can be loaded to carry out safety verification on the target website, when the result of the safety verification is failure, the target website can be determined not to be the safety website, at the moment, non-reduction operation can be carried out on part of the source codes through the preset protection codes in the process of loading the target website, and the target website cannot be loaded normally because part of the source codes are not reduced, so that the target website is loaded incompletely, the effect of protecting the safety website is achieved, the information safety is ensured, and because the domain name and the IP of the safety website are not bound, the files of the safety website are not required to be modified during each time of domain name and IP replacement, the operation is simple and convenient, and the cost is low.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flowchart illustrating steps of a website access verification method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another method for verifying website access according to an embodiment of the present invention;
FIG. 3 is a logic diagram of a web site code processing tool according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating a website access verification apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Fig. 1 is a flowchart illustrating steps of a website access verification method according to an embodiment of the present invention, where as shown in fig. 1, the method may include:
step 101, when a target website is accessed, loading a preset protection code, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of source codes is converted into the format of the preset protection code from an original format in advance.
In the embodiment of the present invention, the target website may be any website such as a video website, a shopping website, a news website, a blog website, etc., the preset protection code is configured in the code of the target website, and is merged with a part of source codes of the target website, the format of the preset protection code is different from the original format of the part of source codes of the target website, and the part of source codes is converted from the original format to the format of the preset protection code, and in the case that the format of the part of source codes is not the original format, the target website cannot be completely loaded, wherein the part of source codes may be codes that are specified by a user in advance from the source codes of the target website, or codes that have random lengths and positions from the source codes.
In the embodiment of the invention, the target website may be an original website to be protected and may also be a simulation station of the original website, so that part of source codes of the original website can be converted into a format of preset protection codes from the original format in advance and combined with the preset protection codes, the preset protection codes can also be downloaded when the original website is subjected to website scraping, and the simulation station built based on the downloaded codes also comprises the preset protection codes, so that the built-in preset protection codes can be directly loaded when the target website is accessed.
And 102, carrying out security verification on the target website by executing the preset protection code.
In the embodiment of the present invention, the preset protection code may be executed to perform security verification on the target website, where the security verification may be to determine whether the target website is the original website according to an execution result of the preset protection code, where the execution result of the preset protection code when the target website is accessed may be compared with whether the execution result of the preset protection code when the original website is accessed is consistent.
And 103, under the condition that the result of the security verification is failure, in the process of loading the target website, performing non-reduction operation on the part of the source codes through the preset protection codes.
In the embodiment of the invention, when the execution results of the preset protection codes are inconsistent, it can be determined that the target website has a security risk compared with the original website, for example, the target website may be a dummy website or the target website may be a website with a tampered source code, at this time, in the process of loading resources and files of the target website, a non-reduction operation can be executed on part of the source code through the preset protection codes, wherein the non-reduction operation refers to other operations that do not reduce the format of the part of the source code to the original format, therefore, the target website cannot be completely loaded, a user can be prevented from accessing the dummy website without knowing, and the information security of the original website can also be protected.
In the embodiment of the invention, the format of part of source codes in a target website is converted into the format of preset protection codes in advance from the original format, the preset protection codes are combined with part of the source codes of the target website, when the target website is accessed, the preset protection codes can be loaded to carry out safety verification on the target website, when the result of the safety verification is failure, the target website can be determined not to be the safety website, at the moment, non-reduction operation can be carried out on part of the source codes through the preset protection codes in the process of loading the target website, and the target website cannot be loaded normally because part of the source codes are not reduced, so that the target website is loaded incompletely, the effect of protecting the safety website is achieved, the information safety is ensured, and because the domain name and the IP of the safety website are not bound, the files of the safety website are not required to be modified during each time of domain name and IP replacement, the operation is simple and convenient, and the cost is low.
Fig. 2 is a flowchart of steps of another website access verification method according to an embodiment of the present invention, and as shown in fig. 2, the method may include:
step 201, converting the format of a part of source codes of an original website from an original format so that the format of the part of source codes is the same as that of the preset protection codes.
In the embodiment of the present invention, the original website may be any website, such as a video website, a shopping website, a news website, a blog website, etc., which has determined security and is to be protected, a part of source codes of the original website may be converted from an original format to a format that is the same as that of a preset protection code, optionally, a format of the part of source codes may be a static language format used for defining document content, style, layout, etc. of the target website, such as HTML, CSS, etc., the preset protection code may be a dynamic execution format used for defining interaction of the target website, such as JS, etc., and a format for converting the part of source codes into the preset protection code may refer to the related description of the foregoing step 101, and is not repeated here to describe any more.
Step 202, merging the preset protection code with the partial source code.
In the embodiment of the invention, the preset protection code and the part of the source code with the same format can be merged, so that the preset protection code executes corresponding operation on the part of the source code according to the result of the safety verification after the safety verification, thereby achieving the effects of limiting the access to the target website and protecting the information safety.
Optionally, the original format is HTML, the format of the preset protection code is JS, and steps 201 to 202 specifically include:
and step S11, carrying out syntax analysis on the HTML codes so as to insert the preset protection codes into the HTML codes, and outputting the part of the source codes in the HTML codes by adopting JS.
And step S12, merging the part of the source codes output by adopting JS and the preset protection codes.
In the embodiment of the present invention, the original format of the source code of the original website may be HTML, the format of the preset protection code may be JS, at this time, syntax analysis may be performed on the HTML code, and the execution logic of the HTML code may be determined according to the syntax analysis, so that the preset protection code may be inserted into the HTML code without destroying the integrity of the HTML code, a part of the source code in the HTML code may be a part of the source code specified by a user, or a part of the source code selected randomly, and the part of the source code is output by JS to be converted into the format of the preset protection code, and is combined with the preset protection code in the same format, so as to complete deployment of the preset protection code by the original website.
And 203, mixing the combined preset protection code with the preset protection code.
In the embodiment of the present invention, after the part of the source code after format conversion is merged with the preset protection code in the same format, the mixed preset protection code and the part of the source code may be further obfuscated to lose readability, so that security risks caused by logic, functions, and the like corresponding to the preset protection code and the part of the source code are prevented from being determined through static analysis of the preset protection code and the part of the source code, and security of the target website code is enhanced.
And 204, creating a verification file in the file directory of the original website, wherein the verification file is used for acquiring from the file directory by executing the preset protection code in the dynamic execution format.
In the embodiment of the present invention, the preset protection code may be in a dynamic execution format, and since the hacking station may obtain a static resource defined in the static language format but cannot obtain an interactive content defined in the dynamic execution format, a verification file may be created in a file directory of an original website, and the verification file is obtained from the file directory by executing the preset protection code, the hacking station may download the preset protection code but cannot download a verification file that needs to be dynamically obtained by executing the preset protection code, the verification file exists in the file directory of the original website, and the verification file does not exist in the file directory of the dummy station.
In the embodiment of the present invention, the file content of the verification file may be empty, or may be filled with any data, so as to distinguish different verification files.
In the embodiment of the present invention, the steps from step 201 to step 204 may also be implemented by a code tool, and fig. 3 is a logic diagram of a website code processing tool provided in the embodiment of the present invention, and as shown in fig. 3, the execution logic from step 201 to step 204 may be written into a corresponding website code processing tool, at this time, the website code processing tool may receive an input HTML code of an original website, and then the website code processing tool may automatically execute "parse the HTML code of the original website", "insert a preset protection code in the HTML code of the original website", "format convert part of the source code in the HTML code of the original website", "merge part of the source code with the preset protection code", "generate a verification file in the root directory of the original website", and the like based on the pre-written logic, therefore, after the source code of the original website is input into the website code processing tool in the application, the code which can realize the access verification and is subjected to the protection processing of the original website is directly output, and the efficiency of the protection processing of the source code of the original website can be further improved.
Step 205, when the target website is accessed, loading a preset protection code, wherein the preset protection code is merged with a part of source codes of the target website, and the format of the part of source codes is converted into the format of the preset protection code from the original format in advance.
In the embodiment of the present invention, step 205 may correspond to the related description of step 101, and is not repeated herein to avoid repetition.
Step 206, obtaining a verification file from the file directory of the target website by executing the preset protection code in the dynamic execution format, and performing the security verification.
In the embodiment of the invention, after the preset protection code is loaded, the verification file can be obtained from the file directory of the target website by executing the preset protection code in the dynamic execution format, and according to the processing process, the execution result of the preset protection code can be determined to be consistent with the execution result of the original website under the condition that the verification file is successfully obtained; under the condition that the verification file is failed to be obtained, the execution result of the preset protection code is determined to be inconsistent with the execution result of the original website, and at the moment, potential safety hazards exist in the target website.
For example, when the target website is accessed, the XMLHttpRequest request is initiated by automatically executing the preset protection code to request to access the root directory of the target website to obtain the preset verification file.
And step 207, under the condition that the result of the security verification is failure, in the process of loading the target website, performing non-reduction operation on the part of the source codes through the preset protection codes.
In the embodiment of the present invention, step 207 may correspond to the related description referring to step 103, and is not described herein again to avoid repetition.
Optionally, the performing, in the step 207, a non-restoration operation on the part of the source code through the preset protection code includes:
and step S21, outputting the messy code through the preset protection code.
Or, in step S22, the partial source code is not output through the preset protection code.
In the embodiment of the present invention, the non-reduction operation on the part of the source code may be performed by outputting a random code different from the part of the source code through the preset protection code, so that the HTML code of the target website cannot be completely executed, or the preset protection code may not output the part of the source code, for example, the preset protection code does not call document.
And 208, under the condition that the result of the security verification is successful, in the process of loading the target website, restoring the partial source code into the original format through the preset protection code and outputting the original format.
In the embodiment of the invention, because the verification file dynamically requested by the preset protection code in the hacking station cannot be automatically downloaded, when the verification file exists in the file directory of the target website, the target website can be considered not to be a dummy website, the safety verification result of the target website access is safe, at the moment, the target website can be loaded according to the access request of the target website, and part of the source code is restored from the dynamic execution format to the original format through the preset protection code, so that part of the source code and other codes of the target website can be completely executed, and the target website is ensured to be safe and completely open.
For example, it may be that in the case where there is a "-" file "in the root directory of the target web site, the preset protection code calls document.
In the embodiment of the invention, the format of part of source codes in a target website is converted into the format of preset protection codes in advance from the original format, the preset protection codes are combined with part of the source codes of the target website, when the target website is accessed, the preset protection codes can be loaded to carry out safety verification on the target website, when the result of the safety verification is failure, the target website can be determined not to be the safety website, at the moment, non-reduction operation can be carried out on part of the source codes through the preset protection codes in the process of loading the target website, and the target website cannot be loaded normally because part of the source codes are not reduced, so that the target website is loaded incompletely, the effect of protecting the safety website is achieved, the information safety is ensured, and because the domain name and the IP of the safety website are not bound, the files of the safety website are not required to be modified during each time of domain name and IP replacement, the operation is simple and convenient, and the cost is low.
Fig. 4 is a block diagram illustrating a website access authentication apparatus 30 according to an embodiment of the present invention, and as shown in fig. 4, the apparatus may include:
the website access module 301 is configured to load a preset protection code when a target website is accessed, where the preset protection code is merged with a part of source codes of the target website, and a format of the part of source codes is converted from an original format to a format of the preset protection code in advance;
a website verification module 302, configured to perform security verification on the target website by executing the preset protection code;
a website loading module 303, configured to, when the result of the security verification is a failure, perform a non-reduction operation on the part of the source code through the preset protection code in a process of loading the target website.
Optionally, the website loading module 303 is specifically configured to output a messy code through the preset protection code; or the like, or, alternatively,
the website loading module 303 is specifically configured to not output the partial source code through the preset protection code.
Optionally, the format of the preset protection code is a dynamic execution format, and the website verification module 302 is specifically configured to obtain a verification file from a file directory of the target website by executing the preset protection code in the dynamic execution format, and perform the security verification.
Optionally, the website loading module 303 is further configured to, in a process of loading the target website, restore the part of the source code to the original format through the preset protection code and output the restored part of the source code when the result of the security verification is successful.
Optionally, the apparatus further comprises:
the code conversion module is used for converting the format of part of source codes of the original website from the original format so as to enable the format of the part of source codes to be the same as that of the preset protection codes;
and the code merging module is used for merging the preset protection code and the part of the source code.
Optionally, the apparatus further comprises:
and the verification file module is used for creating a verification file in a file directory of the original website, and the verification file is used for acquiring the verification file from the file directory by executing the preset protection code in the dynamic execution format.
Optionally, the apparatus further comprises:
and the code obfuscating module is used for obfuscating the combined preset protection code and the preset protection code.
In the embodiment of the invention, the format of part of source codes in a target website is converted into the format of preset protection codes in advance from the original format, the preset protection codes are combined with part of source codes of the target website, when the target website is accessed, the preset protection codes can be loaded to carry out safety verification on the target website, when the result of the safety verification is failure, the target website can be determined not to be the safety website, at the moment, non-reduction operation can be carried out on part of the source codes through the preset protection codes in the process of loading the target website, the target website cannot be loaded normally because part of the source codes are not reduced, so that the target website is loaded incompletely, the effect of protecting the safety website is achieved, the information safety is ensured, and because the domain name and the IP of the safety website are not required to be bound, the files of the safety website are not required to be modified during each time of domain name and IP replacement, the operation is simple and convenient, and the cost is low.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 5, the electronic device includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
loading a preset protection code when a target website is accessed, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of the source codes is converted into the format of the preset protection code from the original format in advance;
performing security verification on the target website by executing the preset protection code;
and under the condition that the result of the security verification is failure, in the process of loading the target website, performing non-reduction operation on the part of the source code through the preset protection code.
Optionally, the performing, by the preset protection code, a non-restoration operation on the part of the source code includes:
outputting a messy code through the preset protection code; or the like, or, alternatively,
and not outputting the part of the source code through the preset protection code.
Optionally, the format of the preset protection code is a dynamic execution format, and the performing security verification on the target website by executing the preset protection code includes:
and acquiring a verification file from a file directory of the target website by executing the preset protection code in the dynamic execution format, and performing the security verification.
Optionally, after the performing security verification on the target website by executing the preset protection code, the method further includes:
and under the condition that the result of the security verification is successful, in the process of loading the target website, restoring the partial source code into the original format through the preset protection code and then outputting the original format.
Optionally, before loading the preset protection code when the target website is accessed, the method further includes:
converting the format of part of source codes of the original website from the original format so as to enable the format of the part of source codes to be the same as that of the preset protection codes;
and merging the preset protection code with the partial source code.
Optionally, after merging the preset protection code with the partial source code, the method further includes:
and creating a verification file in a file directory of the original website, wherein the verification file is used for acquiring from the file directory by executing the preset protection code in the dynamic execution format.
Optionally, after merging the preset protection code with the partial source code, the method further includes:
and mixing the merged preset protection code with the preset protection code.
In the embodiment of the invention, the format of part of source codes in a target website is converted into the format of preset protection codes in advance from the original format, the preset protection codes are combined with part of source codes of the target website, when the target website is accessed, the preset protection codes can be loaded to carry out safety verification on the target website, when the result of the safety verification is failure, the target website can be determined not to be the safety website, at the moment, non-reduction operation can be carried out on part of the source codes through the preset protection codes in the process of loading the target website, the target website cannot be loaded normally because part of the source codes are not reduced, so that the target website is loaded incompletely, the effect of protecting the safety website is achieved, the information safety is ensured, and because the domain name and the IP of the safety website are not required to be bound, the files of the safety website are not required to be modified during each time of domain name and IP replacement, the operation is simple and convenient, and the cost is low.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, a readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the website access verification method described in any one of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the website access verification method of any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The readable storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A website access verification method, the method comprising:
loading a preset protection code when a target website is accessed, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of the source codes is converted into the format of the preset protection code from the original format in advance;
performing security verification on the target website by executing the preset protection code;
and under the condition that the result of the security verification is failure, in the process of loading the target website, performing non-reduction operation on the part of the source code through the preset protection code.
2. The method of claim 1, wherein performing the non-restore operation on the portion of the source code by the pre-set protection code comprises:
outputting a messy code through the preset protection code; or the like, or, alternatively,
and not outputting the part of the source code through the preset protection code.
3. The method of claim 1, wherein the preset protection code is in a dynamic execution format, and the performing security verification on the target website by executing the preset protection code comprises:
and acquiring a verification file from a file directory of the target website by executing the preset protection code in the dynamic execution format, and performing the security verification.
4. The method of claim 1, wherein after the performing the security verification on the target website by executing the preset protection code, the method further comprises:
and under the condition that the result of the security verification is successful, in the process of loading the target website, restoring the partial source code into the original format through the preset protection code and then outputting the original format.
5. The method of claim 1, wherein before loading the preset protection code when the target website is accessed, the method further comprises:
converting the format of part of source codes of the original website from the original format so as to enable the format of the part of source codes to be the same as that of the preset protection codes;
and merging the preset protection code with the partial source code.
6. The method of claim 5, wherein after merging the pre-set protection code with the partial source code, further comprising:
and creating a verification file in a file directory of the original website, wherein the verification file is used for acquiring from the file directory by executing the preset protection code in the dynamic execution format.
7. The method of claim 5, wherein after merging the pre-set protection code with the partial source code, further comprising:
and mixing the merged preset protection code with the preset protection code.
8. A website access authentication apparatus, the apparatus comprising:
the website access module is used for loading a preset protection code when a target website is accessed, wherein the preset protection code is combined with a part of source codes of the target website, and the format of the part of source codes is converted into the format of the preset protection code from the original format in advance;
the website verification module is used for performing security verification on the target website by executing the preset protection code;
and the website loading module is used for executing non-reduction operation on the part of the source codes through the preset protection codes in the process of loading the target website under the condition that the result of the security verification is failure.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the website access authentication method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A readable storage medium having stored thereon a computer program for implementing the steps of the website access authentication method according to any one of claims 1 to 7 when executed by a processor.
CN202110984559.2A 2021-08-25 2021-08-25 Website access verification method, device, electronic equipment and readable storage medium Active CN113722639B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110984559.2A CN113722639B (en) 2021-08-25 2021-08-25 Website access verification method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110984559.2A CN113722639B (en) 2021-08-25 2021-08-25 Website access verification method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113722639A true CN113722639A (en) 2021-11-30
CN113722639B CN113722639B (en) 2023-08-25

Family

ID=78678036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110984559.2A Active CN113722639B (en) 2021-08-25 2021-08-25 Website access verification method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113722639B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7921353B1 (en) * 2007-04-09 2011-04-05 Oracle America, Inc. Method and system for providing client-server injection framework using asynchronous JavaScript and XML
US20140082479A1 (en) * 2012-09-17 2014-03-20 Gavin Guinane Method and system for site migration
WO2017023203A1 (en) * 2015-08-03 2017-02-09 Mastercard Asia/Pacific Pte Ltd Method and system for website verification
CN107104924A (en) * 2016-02-22 2017-08-29 阿里巴巴集团控股有限公司 The verification method and device of website backdoor file
CN107577944A (en) * 2017-09-08 2018-01-12 杭州安恒信息技术有限公司 Website malicious code detecting method and device based on code syntax analyzer
WO2018099219A1 (en) * 2016-11-29 2018-06-07 中国银联股份有限公司 Method and device for detecting phishing website
CN110413930A (en) * 2019-07-31 2019-11-05 杭州安恒信息技术股份有限公司 A kind of data analysing method, device, equipment and readable storage medium storing program for executing
CN110704298A (en) * 2019-08-23 2020-01-17 北京奇艺世纪科技有限公司 Code verification method and device, terminal equipment and storage medium
CN112307404A (en) * 2020-11-12 2021-02-02 山东云海国创云计算装备产业创新中心有限公司 Document website setting method, device, equipment and medium based on source file

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7921353B1 (en) * 2007-04-09 2011-04-05 Oracle America, Inc. Method and system for providing client-server injection framework using asynchronous JavaScript and XML
US20140082479A1 (en) * 2012-09-17 2014-03-20 Gavin Guinane Method and system for site migration
WO2017023203A1 (en) * 2015-08-03 2017-02-09 Mastercard Asia/Pacific Pte Ltd Method and system for website verification
CN107104924A (en) * 2016-02-22 2017-08-29 阿里巴巴集团控股有限公司 The verification method and device of website backdoor file
WO2018099219A1 (en) * 2016-11-29 2018-06-07 中国银联股份有限公司 Method and device for detecting phishing website
CN107577944A (en) * 2017-09-08 2018-01-12 杭州安恒信息技术有限公司 Website malicious code detecting method and device based on code syntax analyzer
CN110413930A (en) * 2019-07-31 2019-11-05 杭州安恒信息技术股份有限公司 A kind of data analysing method, device, equipment and readable storage medium storing program for executing
CN110704298A (en) * 2019-08-23 2020-01-17 北京奇艺世纪科技有限公司 Code verification method and device, terminal equipment and storage medium
CN112307404A (en) * 2020-11-12 2021-02-02 山东云海国创云计算装备产业创新中心有限公司 Document website setting method, device, equipment and medium based on source file

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
苏鹏;: "跨站点脚本攻击XSS的攻击原理与防护", 电子科学技术, no. 01 *

Also Published As

Publication number Publication date
CN113722639B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN106302337B (en) Vulnerability detection method and device
US8621613B1 (en) Detecting malware in content items
CN103744652A (en) Hybrid APP development method and device across mobile terminals
CN110046310B (en) Method and device for analyzing jump link in page
CN109902247B (en) Page rendering method and device and electronic equipment
US10129278B2 (en) Detecting malware in content items
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN110928571A (en) Business program development method and device
CN111539775A (en) Application program management method and device
CN110321504A (en) A kind of page processing method and device
CN113595997A (en) File uploading safety detection method and device and electronic equipment
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
JP5753302B1 (en) Program, method and system for warning access to web page
CN113312577A (en) Webpage resource processing method and device, electronic equipment and storage medium
CN112256696A (en) Form data processing method, device, equipment and storage medium
CN109934016B (en) Application signature verification method and device and electronic equipment
CN112379965A (en) Sandbox file mapping system, client device, mapping end device, sandbox file mapping method and electronic equipment
CN107239475B (en) File calling method and device
CN108965108B (en) Message pushing method and related equipment
CN113722639B (en) Website access verification method, device, electronic equipment and readable storage medium
CN115576536A (en) Method and system for automatically generating interface document by analyzing byte codes
CN110298146B (en) Application processing and running method and device
CN115185551A (en) Application program installation method, device, system and storage medium
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113220314A (en) APP resource loading and APK generation method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant