A website security protection method and device
By executing the second verification code data in the browser and regularly updating the authentication validity period data, the problem of unresponsive HTTP requests caused by client cookie expiration is solved, and the security and protection capabilities of the website are improved.
Patent Information
- Application Number
- CN202310280426.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-03-21
AI Technical Summary
In the existing technology, when the client's cookie expires, the resource response obtained by the target website through dynamic API calls cannot be obtained, causing the HTTP request to be intercepted and the response cannot be obtained.
Execute the second verification code data through the browser, regularly send status message data to the protection server based on the authentication validity period data, and request to update the authentication validity period data when the validity period meets the preset verification conditions to avoid response problems caused by cookie expiration.
It ensures that the client can always get a response when requesting resources from the target website, which improves the security of the website and prevents malicious traffic attacks.
Smart Images

Figure CN116743418B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a website security protection method and device. Background Art
[0002] As websites pay more attention to information data protection, various web crawlers and related attack technologies have emerged one after another, and website servers are facing tremendous pressure from malicious traffic.
[0003] In order to intercept malicious traffic requests, the existing technology usually intercepts them by redirecting and setting cookies. However, since cookies can be hijacked, attackers can hijack cookies and reuse them. In addition, if the cookie expires, the client needs to refresh the page regularly to complete the verification to obtain a new cookie, so that the HTTP request can be sent to the origin server to obtain a response. Some or all resources in some origins may be obtained through dynamic API calls. In this case, if the client does not refresh the page, the client's cookie will expire and cannot be verified, resulting in the HTTP request sent to the origin server being intercepted and unable to obtain a response. Summary of the invention
[0004] In view of this, one of the technical problems solved by the embodiments of the present invention is to provide a website security protection method and device, so as to overcome the problem in the prior art that if the client's Cookie is expired, the HTTP request sent cannot obtain a response from the target website, wherein the target website is a website that obtains resources through dynamic API calls.
[0005] A first aspect of an embodiment of the present application discloses a website security protection method, comprising receiving second verification code data and authentication validity period data sent by a protection server;
[0006] Executing the second verification code data through a browser to send status message data to the protection server according to the authentication validity period data and at a preset time interval; wherein both the authentication validity period data and the status message data are used to represent the validity period of a legitimate session with a target website;
[0007] Receiving validity period determination result data returned by the protection server according to the status message data;
[0008] When it is determined according to the validity judgment result data that the validity period of the legal session with the target website meets the preset verification conditions, the second verification code data is executed through the browser, and a validity period update request data is sent to the protection server; wherein, the validity period update request data is used to request the updated authentication validity period data.
[0009] The second aspect of the embodiment of the present application discloses a website security protection device, including: a receiving module for receiving second verification code data and authentication validity period data sent by a protection server; and for receiving validity period judgment result data returned by the protection server according to the status message data;
[0010] An interactive module, configured to execute the second verification code data through a browser, so as to send status message data to the protection server according to the authentication validity period data and at a preset time interval; wherein both the authentication validity period data and the status message data are used to represent the validity period of a legal session with a target website;
[0011] An authentication module is used to execute the second verification code data through a browser and send a validity period update request data to the protection server when it is determined that the validity period of a legal session with the target website meets a preset verification condition based on the validity period judgment result data; wherein the validity period update request data is used to request to obtain the updated authentication validity period data.
[0012] Compared with the prior art, in the embodiment of the present application, when the client requests to obtain the resource of a target page of the target website, the protection server will send the second verification code data and the authentication validity period data to the client; the browser on the client can subsequently execute the second verification code data to send the status message data to the protection server according to the authentication validity period data and the preset time interval value, and receive the validity period judgment result data returned by the protection server according to the status message data. When it is determined according to the validity period judgment result data that the validity period of the legal session with the target website meets the preset verification condition, the browser can use the second verification code data to request the protection server to obtain the updated authentication validity period data, so as to avoid the phenomenon that the browser on the client subsequently requests the resource corresponding to the target page of the target website and cannot be responded to. For malicious traffic, when attacking the target website, in most cases, the attack is not carried out through the browser, so the second verification code data cannot be executed to communicate with the protection server. When the validity period of the legal session with the target website expires, the response can no longer be obtained, thereby protecting the target website to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1It is a flow chart of a website security protection method disclosed in the first embodiment of the present application;
[0015] Figure 2 This is a flow chart of a website security protection method disclosed in Embodiment 2 of the present application;
[0016] Figure 3 It is a schematic block diagram of the structure of a website security protection device disclosed in Example 3 of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] It should be noted that the terms "first", "second", "third" and "fourth" in the specification and claims of the present application are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0019] Embodiment 1
[0020] like Figure 1 As shown, Figure 1 This is a schematic flow chart of a website security protection method disclosed in Embodiment 1 of the present application. The website security protection method includes:
[0021] Step S101, receiving second verification code data and authentication validity period data sent by a protection server.
[0022] In this embodiment, the execution subject is the browser on the client, the protection server is used to protect the access security of the target website, the client can communicate with the protection server, and the specific type, deployment method and communication method of the client and the protection server are not limited, and can be reasonably selected according to actual application requirements. Among them, some or all resources in the target website are obtained through dynamic API calls.
[0023] In this embodiment, after the client receives the second verification code data sent by the protection server, the browser installed on the client can automatically execute the second verification code data and communicate with the protection server regularly, that is, by running the second verification code data, a heartbeat mechanism for regular communication with the protection server can be implemented. Among them, the type of browser and the specific recording method of the second verification code data are not limited, and can be reasonably selected according to actual application requirements, but it is necessary to ensure that in addition to the browser, the second verification code data can be automatically executed by as few other types of programs as possible. For example, the second verification code data can be a JS SDK, or it can be just a piece of code data.
[0024] Optionally, in order to prevent the second verification code data from being maliciously tampered with, it is also preferred that the second verification code data is obfuscated code data.
[0025] Furthermore, considering that most mainstream browsers are compatible with JS syntax, in order to improve the scope of application of the present method, the second verification code data may be preferably obfuscated JS code data.
[0026] In this embodiment, the authentication validity period data is used to represent the validity period of a legal session between the browser on the client and the target website. The specific value of the validity period is not limited and can be reasonably selected according to actual application requirements. For example, the validity period can be one of 1 minute, 5 minutes, and 10 minutes.
[0027] Optionally, based on the analysis results of the user's access habits and comprehensive consideration of the data processing efficiency and pressure of the server, the validity period may be preferably set to 5 minutes.
[0028] In this embodiment, since multiple pages can be opened simultaneously through the browser, each time the browser opens a target page of the target website, the protection server will send the second verification code data corresponding to the target page for the browser to obtain and automatically execute. In addition, when the browser opens a target page of the target website for the first time, the protection server will also send the authentication validity period data corresponding to the target website for the browser to obtain and save.
[0029] In this embodiment, the recording and sending method of the authentication validity period data is not limited and can be reasonably selected according to actual application requirements. For example, the protection server can set a cookie through the Set-Cookie header and assign a validity period to the cookie, so that the validity period of the legal session between the browser on the client and the target website can be represented by the validity period of the cookie.
[0030] For another example, the protection server can also set the JWT string in the header of the network request sent by the client and assign the JWT string a validity period, so that the validity period of the JWT string can be used to represent the validity period of the legal session between the browser on the client and the target website. Among them, JSON Web Token (JWT) is an open standard (RFC7519) that defines a compact and independent way to securely transmit information between parties as a JSON object. Because this information is digitally signed, it can be verified and trusted.
[0031] Step S102: executing the second verification code data through the browser to send status message data to the protection server according to the authentication validity period data and the preset time interval value.
[0032] In this embodiment, the status message data is also used to characterize the validity period of a legal session with a target page of the target website. A target website may include one or more pages, and the client may request resource data corresponding to one or more pages in the target website through a browser during a resource request process for the target website.
[0033] In this embodiment, after the browser executes the second verification code data, it can send status message data to the protection server according to the preset time interval value, that is, communicate with the protection server regularly, so that the protection server can determine whether the validity period of the legal session between the browser on the client and the target website has expired or is about to expire based on the status message data.
[0034] Step S103: receiving validity period determination result data returned by the protection server according to the status message data.
[0035] In this embodiment, the validity period judgment result data is used to indicate whether the validity period of the legal session between the client and the target website meets the preset verification conditions. The protection server can process the status message data according to the preset judgment algorithm and obtain the corresponding validity period judgment result data. Among them, the specific preset algorithm judgment type is not limited and can be reasonably selected according to actual application requirements.
[0036] In addition, the specific conditions of the preset verification conditions are not limited and can be reasonably selected according to actual application requirements. For example, the preset verification condition can be set to whether the validity period of the legal session between the browser on the client and the target website has expired compared to the current time, or it can be set to the remaining validity period of the legal session between the client browser and the target website is within 30 seconds or 10 seconds.
[0037] Optionally, in order to avoid the situation where a small number of HTTP requests sent by the browser on the client to the target website server cannot obtain a response before the authentication validity period data is updated, and in combination with the usual protection server data processing and communication time, the preset verification condition can be preferably: compared with the current time, the remaining validity period of the legal session between the browser on the client and the target website is greater than or equal to 15 seconds.
[0038] Step S104, when it is determined according to the validity period judgment result data that the validity period of the legal session with the target website meets the preset verification condition, the second verification code data is executed by the browser, and a validity period update request data is sent to the protection server. The validity period update request data is used to request updated authentication validity period data.
[0039] In this embodiment, since the web page that obtains resources through dynamic API calls does not refresh the page, in order to avoid the situation where the HTTP request sent by the browser on the client to the target website server cannot obtain a response when it is determined based on the validity period judgment result data that the validity period of the legal session between the browser on the client and the target website has expired or is about to expire, the second verification code data can be used to request the protection server to obtain updated authentication validity period data, and the updated authentication validity period data can be used to replace the authentication validity period data previously stored locally on the client.
[0040] There is no limitation on the specific method of using the second verification code data to send the validity period update request data to the protection server, and a reasonable selection can be made according to actual application requirements.
[0041] For example, in order to further improve the protection effect of the target website, a human-machine verification tag can be popped up on the client's browser, and the user is required to perform image or slider verification interaction in the human-machine verification tag. Only after the verification is passed can the validity period update request data be sent to the protection server; it can also automatically jump to the website page where human-machine verification can be performed, and the user is required to perform image or slider verification interaction in the website page. Only after the verification is passed can the validity period update request data be sent to the protection server; or a preset verification algorithm can be used to generate validity period update request data and send it to the protection server, and the server will verify the legitimacy of the validity period update request data. Only if the verification is passed will the updated authentication validity period data be returned.
[0042] Optionally, in order to reduce the amount of data sent, when the protection server determines based on the status message data that the validity period of the legal session between the browser on the client and the target website meets the preset verification conditions, the returned validity period judgment result data may include the first sub-information and the second sub-information; when the protection server determines based on the status message data that the validity period of the legal session between the browser on the client and the target website does not meet the preset verification conditions, the validity period judgment result data may only include the first sub-information but not the second sub-information.
[0043] The first sub-information is used to indicate whether the validity period of a legal session between the browser on the client and the target website meets a preset verification condition, and the second sub-information is used to indicate a target address for receiving validity period update request data.
[0044] Correspondingly, when the client receives the second sub-information, the second verification code data can also be automatically executed through the browser, and the second verification request data can be sent to the target address according to the second sub-information. Specifically, step S104 can also include:
[0045] Sub-step S104a, when it is determined according to the first sub-information that the validity period of the legal session with the target website meets the preset verification condition, second verification request data is sent to the target address using the second verification code data and the second sub-information.
[0046] Among them, according to the second verification request data, it can be verified whether the executor of the data sending operation is a program used for malicious attacks or access, wherein the target address can be the network address corresponding to the protection server, or the network address corresponding to other servers other than the protection server.
[0047] Furthermore, sub-step S104a may also include: creating a new verification tag using the second verification code data to obtain second verification request data; and sending the second verification request data to a target address according to the second sub-information.
[0048] The type of verification tag is not limited, and it can be an explicit tag or an implicit tag. For example, when the verification tag is an explicit tag, the user is required to perform image or slider verification interaction in the tag, and obtain the second verification request data according to the user's interaction instruction.
[0049] Furthermore, the verification tag may be preferably an implicit tag, which does not require relevant interactive operations for the user, that is, non-perceptual verification, thereby improving the user experience.
[0050] Sub-step S104b: When the protection server determines that the second verification request data is legal, receiving the verification result data sent by the protection server.
[0051] Among them, when the target address is the address corresponding to a server other than the protection server, the server can verify whether the executor of the data sending operation is a program used for malicious attacks or access based on the second verification request data, and send the verification result data to the protection server, or directly forward the second verification request data to the protection server, and the protection server will perform corresponding verification.
[0052] In addition, the verification result data is also used to characterize the validity period of a legal session between the browser on the client and the target website. However, compared with the validity period of a legal session with the target website in the previous step, it is an updated validity period, that is, the validity period of a legal session between the browser on the client and the target website can be extended through the verification result data.
[0053] Sub-step S104c, using the verification result data, updating the authentication validity period data.
[0054] Furthermore, the verification result data may include third sub-information and fourth sub-information, wherein the third sub-information is used to indicate the validity period of the updated legal session, and the fourth sub-information is used to indicate whether the second verification request data is legal.
[0055] In order to reduce the amount of data sent, when the protection server determines that the second verification request data is illegal, it may only send the fourth sub-information to the client.
[0056] Furthermore, when the verification tag is an implicit tag, if the implicit tag always exists, the second verification request data may continue to be sent to the target address; when the verification tag is an explicit tag, if the explicit tag always exists, it will affect the user's use of the browser. Therefore, in order to reduce the amount of data for communication and processing and improve the user's experience, sub-step S104c may also include: using the third sub-information to update the authentication validity period data, and when the second verification request data is determined to be legal according to the fourth sub-information, deleting the verification tag. Among them, what is deleted at this time is a verification tag on a target web page on the target website, that is, the second verification code data deletes its corresponding verification tag.
[0057] Furthermore, when the browser is in session with multiple target pages of the target website, no matter the verification tag is an explicit tag or an implicit tag, the verification tag states corresponding to the multiple target pages can be synchronized to improve the user experience. Specifically, after sub-step S104c, it also includes:
[0058] Sub-step S104d, using the second verification code data corresponding to each target page, delete all verification tags.
[0059] Furthermore, in order to efficiently synchronize the status of verification tags corresponding to multiple target pages, that is, to synchronize the verification results, the validity period of the most recently determined legal session with the target website can be recorded in a designated field in the local Storage by executing the second verification code data, and the second verification code data corresponding to each target page can monitor whether the content of the designated field in the local Storage has changed. If so, all verification tags will be deleted.
[0060] Furthermore, in order to efficiently synchronize the states of the verification tags corresponding to the multiple target pages, the second verification code data may be executed to enable the verification tags in all the target pages to monitor each other's states.
[0061] As can be seen from the above embodiments of the present invention, in the embodiments of the present invention, when the client requests to obtain the resources of a target page of the target website, the protection server will send the second verification code data and the authentication validity period data to the client; the browser on the client can subsequently execute the second verification code data to send the status message data to the protection server according to the authentication validity period data and the preset time interval value, and receive the validity period judgment result data returned by the protection server according to the status message data. When it is determined according to the validity period judgment result data that the validity period of the legal session with the target website meets the preset verification condition, the browser can use the second verification code data to request the protection server to obtain the updated authentication validity period data, so as to avoid the phenomenon that the resource corresponding to the target page of the target website cannot be responded to when the subsequent request is made. For malicious traffic, when attacking the target website, in most cases, the attack is not carried out through the browser, so it is impossible to execute the second verification code data to communicate with the protection server. Therefore, when the validity period of the legal session with the target website expires, the response of the target website server can no longer be obtained, and the protection of the target website can be achieved to a certain extent.
[0062] Embodiment 2
[0063] like Figure 2 As shown, Figure 2 This is a schematic flow chart of a website security protection method disclosed in Embodiment 1 of the present application. The website security protection method includes:
[0064] Step S201: sending first network request data according to address information corresponding to a target page of a target website.
[0065] In this embodiment, the user can send the first network request data through the browser on the client according to the address information corresponding to a target page of the target website to request to obtain the resource data corresponding to the target page.
[0066] Optionally, in order to better protect the security of the target website server, step S201 may include the following sub-steps:
[0067] Sub-step S201a, receiving first verification code data sent by the protection server according to the first network request data.
[0068] Among them, after the client receives the first verification code data sent by the protection server, similar to the second verification code data, the browser installed on the client can automatically execute the first verification code data.
[0069] Furthermore, in order to prevent the first verification code data from being maliciously tampered with, it is also preferred that the first verification code data is obfuscated code data.
[0070] Furthermore, considering that most mainstream browsers are compatible with JS syntax, in order to improve the scope of application of the present method, the first verification code data may be preferably obfuscated JS code data.
[0071] Sub-step S201b, executing the first verification code data through the browser to obtain first verification request data.
[0072] Among them, the first verification request data is used for the protection server to verify whether the first network request data sent by the client is obtained by executing the first verification code data. The specific content represented by the first verification request data is not limited and can be reasonably selected according to actual application requirements.
[0073] Furthermore, in order to improve the reliability and accuracy of the verification performed by the protection server, the protection server may preset a first encryption rule and a first decryption rule corresponding to the first encryption rule. After the browser executes the first verification code data, the first verification code data may encrypt the specified information through the first encryption rule to obtain the first verification request data; when the protection server receives the first verification request data, it may use the first decryption rule to decrypt and verify the first verification request data. The specific types of the first encryption rule and the first decryption rule are not limited and may be reasonably selected according to actual application requirements.
[0074] Furthermore, considering that the timestamp is constantly changing over time and that the client can more easily obtain information used to characterize the timestamp, in order to further improve the reliability of the verification result, sub-step S201b may also include: obtaining timestamp data according to a preset timestamp determination rule; encrypting the timestamp data according to a first encryption rule to obtain first verification request data.
[0075] The specific rules for determining the timestamp are not limited and can be reasonably selected according to actual application requirements. For example, the timestamp data can be obtained according to the timestamp corresponding to the current time, or the timestamp data can be obtained according to the timestamp corresponding to the time when the first network request data is sent.
[0076] Furthermore, it is preferred that the timestamp corresponding to the first network request data is at the millisecond level, because the timestamp at the millisecond level is relatively common and can better meet the uniqueness requirement, that is, the first verification request data generated by the same client or different clients are less likely to be the same, which is beneficial to improving the reliability of the protection server's verification of whether the first verification request data is legal.
[0077] Furthermore, in order to quickly obtain resource data corresponding to the target page, sub-step S201b may include: obtaining second network request data according to the first network request data and the first verification request data; and sending the second network request data to the protection server.
[0078] Among them, since the first network request data is the resource data of a target page of the target website, when the client browser only sends the first network request data, the server of the target website does not actually respond to it, but the protection server responds to it. Therefore, in order to obtain the resource data of a target page of the target website, it is necessary to obtain the second network request data based on the first network request data and the first verification request data, and send the second network request data to the protection server, so that the protection server can determine whether the first verification request data is legal through the second network request data.
[0079] Sub-step S201c, sending the first verification request data to the protection server, so that when the protection server determines that the first verification request data is legal, the protection server returns the second verification code data, the authentication validity period data, and the resource data corresponding to the target page.
[0080] In addition, when the protection server determines that the first verification request data is illegal, it indicates that the first network request data sent on the client is likely not obtained through the browser execution, but generated by the attacker using other programs, so the protection server can start the corresponding protection function, and the specific protection method is not limited, and can be reasonably selected according to actual application needs. For example, the server of the target website will not respond to the resource data of the target page, and the protection server can stop communicating with the client, or send the first verification code data to the client again, or start a specific certification mechanism.
[0081] Furthermore, in order to simplify the complexity of the human-machine verification protection function, it is preferred that when the protection server determines that the first verification request data is illegal, the protection server can send the first verification code data to the client again.
[0082] When the protection server determines that the first verification request data is legal, it can further enable the server of the target website to respond to the resource data of the target page based on the first network request data, and return the second verification code data corresponding to the target page and the authentication validity period data corresponding to the target website.
[0083] Step S202, receiving the second verification code data, the authentication validity period data, and the resource data corresponding to the target page sent by the protection server.
[0084] In this embodiment, step S202 is different from step S101 in the aforementioned embodiment 1 in that the browser on the client also receives resource data corresponding to the target page, and the other contents are basically the same or similar and will not be described in detail here.
[0085] Step S203: execute the second verification code data through the browser to send status message data to the protection server according to the authentication validity period data and the preset time interval value.
[0086] In this embodiment, step S203 is substantially the same as or similar to the aforementioned step S102 and will not be described in detail herein.
[0087] Step S204: receiving validity period determination result data returned by the protection server according to the status message data.
[0088] In this embodiment, step S204 is substantially the same as or similar to the aforementioned step S103 and will not be described in detail herein.
[0089] Step S205, when it is determined according to the validity period judgment result data that the validity period of the legal session with the target website meets the preset verification condition, the second verification code data is executed by the browser, and the validity period update request data is sent to the protection server. The validity period update request data is used to request to obtain the updated authentication validity period data.
[0090] In this embodiment, step S205 is substantially the same as or similar to the aforementioned step S104 and will not be described in detail herein.
[0091] It can be seen from the above embodiments of the present invention that in the embodiments of the present invention, after receiving the first network request data for requesting a target page of a target website, the protection server will return the second verification code data, the authentication validity period data, and the resource data corresponding to the target page. For users of non-malicious traffic, the access experience of the target page will not be significantly affected; the protection server sends the first verification code data executable by the client browser and obtains the first verification request data generated by executing the first verification code data. It can verify whether the execution program of the first network request data sent by the client is a browser. In most cases, it can identify malicious traffic and take corresponding protection measures, which is beneficial to protect the target website server.
[0092] Embodiment 3
[0093] Embodiment 3 of the present application provides a website security protection device, Figure 3 This is a schematic diagram of the structure of a website security protection device disclosed in Example 3 of the present application, the device includes:
[0094] The receiving module 301 is used to receive the second verification code data and the authentication validity period data sent by the protection server; and to receive the validity period judgment result data returned by the protection server according to the status message data.
[0095] The interactive module 302 is used to execute the second verification code data through the browser to send status message data to the protection server according to the preset time interval value based on the authentication validity period data; wherein the authentication validity period data and the status message data are both used to represent the validity period of a legal session with the target website.
[0096] The authentication module 303 is used to execute the second verification code data through the browser and send validity period update request data to the protection server when it is determined based on the validity period judgment result data that the validity period of a legal session with the target website meets the preset verification conditions; wherein the validity period update request data is used to request to obtain the updated authentication validity period data.
[0097] Optionally, the device further comprises a verification module for receiving first verification code data sent by the protection server according to first network request data; wherein the first network request data is used to request resource data corresponding to a target page of a target website.
[0098] The first verification code data is executed by the browser to obtain the first verification request data.
[0099] The first verification request data is sent to the protection server, so that when the protection server determines that the first verification request data is legal, the protection server returns the second verification code data, the authentication validity period data, and the resource data corresponding to the target page.
[0100] Optionally, the verification module is further configured to obtain timestamp data according to a preset timestamp determination rule.
[0101] The timestamp data is encrypted according to a first encryption rule to obtain first verification request data.
[0102] Optionally, the verification module is further used to obtain second network request data according to the first network request data and the first verification request data;
[0103] The second network request data is sent to the protection server.
[0104] Optionally, when the protection server determines, based on the status message data, that the validity period of the legal session with the target website has expired, the validity period judgment result data includes first sub-information and second sub-information, wherein the first sub-information is used to characterize whether the validity period of the legal session with the target website meets a preset verification condition, and the second sub-information is used to characterize a target address for receiving validity period update request data;
[0105] Correspondingly, the authentication module 303 is further configured to send second verification request data to the verification webpage address using the second verification code data and the second sub-information when it is determined according to the first sub-information that the validity period of the legal session with the target website meets the preset verification condition;
[0106] When the second verification request data is legal, the verification result data sent by the protection server is received.
[0107] Using the verification result data, update the certification validity period data.
[0108] Optionally, the authentication module 303 is further configured to create a new verification tag using the second verification code data to obtain second verification request data;
[0109] According to the second sub-information, the second verification request data is sent to the target address.
[0110] Optionally, the verification result data includes third sub-information and fourth sub-information, wherein the third sub-information is used to indicate the validity period of the updated legal session, and the fourth sub-information is used to indicate whether the second verification request data is legal;
[0111] Correspondingly, the authentication module 303 is further configured to update the authentication validity period data using the third sub-information, and to delete the authentication tag when it is determined according to the fourth sub-information that the second authentication request data is legal.
[0112] Optionally, when the browser is in session with multiple target pages of the target website, the device further includes an updating module for deleting all verification tags using the second verification code data corresponding to each target page.
[0113] Optionally, the verification tag is an implicit tag.
[0114] Through the website security protection device of this embodiment, the corresponding website security protection methods in the aforementioned multiple method embodiments can be implemented and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0115] So far, specific embodiments of the present application have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.
[0116] The present application is described with reference to the flowcharts and / or block diagrams of the methods according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0118] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0119] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0120] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A website security protection method, It is characterized in that The method comprises: Receiving first verification code data sent by the protection server according to first network request data; wherein the first network request data is used to request resource data corresponding to a target page of a target website; Execute the first verification code data through the browser to obtain first verification request data; wherein the first verification request data is used by the protection server to verify whether the first network request data sent by the client is obtained by executing the first verification code data; Sending the first verification request data to the protection server, so that when the protection server determines that the first verification request data is legal, the protection server returns second verification code data, authentication validity period data, and resource data corresponding to the target page; Receiving second verification code data and authentication validity period data sent by the protection server; Executing the second verification code data through a browser to send status message data to the protection server according to the authentication validity period data and at a preset time interval; wherein both the authentication validity period data and the status message data are used to represent the validity period of a legitimate session with a target website; Receiving validity period determination result data returned by the protection server according to the status message data; When it is determined according to the validity judgment result data that the validity period of the legal session with the target website meets the preset verification conditions, the second verification code data is executed through the browser, and a validity period update request data is sent to the protection server; wherein, the validity period update request data is used to request the updated authentication validity period data.
2. The method according to claim 1, It is characterized in that The step of executing the first verification code data through a browser to obtain the first verification request data comprises: According to a preset timestamp determination rule, obtaining timestamp data; The timestamp data is encrypted according to a first encryption rule to obtain the first verification request data.
3. The method according to claim 1, It is characterized in that The sending the first verification request data to the protection server comprises: Obtaining second network request data according to the first network request data and the first verification request data; The second network request data is sent to the protection server.
4. The method according to claim 1, It is characterized in that When the validity period of the legal session with the target website satisfies the preset verification condition, the validity period judgment result data includes first sub-information and second sub-information, wherein the first sub-information is used to indicate whether the validity period of the legal session with the target website satisfies the preset verification condition, and the second sub-information is used to indicate the target address for receiving the validity period update request data; Correspondingly, when it is determined according to the validity period judgment result data that the validity period of the legal session with the target website meets the preset verification condition, executing the second verification code data through the browser and sending validity period update request data to the protection server includes: When it is determined according to the first sub-information that the validity period of the legal session with the target website meets the preset verification condition, sending second verification request data to the target address using the second verification code data and the second sub-information; When the second verification request data is legal, receiving the verification result data sent by the protection server; The authentication validity period data is updated using the verification result data.
5. The method according to claim 4, It is characterized in that When it is determined according to the first sub-information that the validity period of the legal session with the target website satisfies the preset verification condition, sending the second verification request data to the target address using the second verification code data and the second sub-information includes: Create a new verification tag using the second verification code data to obtain second verification request data; The second verification request data is sent to the target address according to the second sub-information.
6. The method according to claim 5, It is characterized in that The verification result data includes third sub-information and fourth sub-information, wherein the third sub-information is used to indicate the validity period of the updated legal session, and the fourth sub-information is used to indicate whether the second verification request data is legal; Correspondingly, the updating of the authentication validity period data by using the verification result data includes: The authentication validity period data is updated using the third sub-information, and when the second verification request data is determined to be legal according to the fourth sub-information, the verification tag is deleted.
7. The method according to claim 6, It is characterized in that When the browser is in session with multiple target pages of the target website, after using the verification result data to update the authentication validity period data, the method further includes: All the verification tags are deleted using the second verification code data corresponding to each of the target pages.
8. The method according to claim 5, It is characterized in that The verification tag is an implicit tag.
9. A website security protection device, It is characterized in that The device comprises: A receiving module, configured to receive first verification code data sent by a protection server according to first network request data; wherein the first network request data is used to request resource data corresponding to a target page of a target website; and to receive second verification code data and authentication validity period data sent by the protection server; and to receive validity period judgment result data returned by the protection server according to status message data; An interactive module is used to execute the first verification code data through a browser to obtain first verification request data; wherein the first verification request data is used by the protection server to verify whether the first network request data sent by the client is obtained by executing the first verification code data; the first verification request data is sent to the protection server, so that when the protection server determines that the first verification request data is legal, the protection server returns second verification code data, authentication validity period data, and resource data corresponding to the target page; and the second verification code data is executed through a browser to send status message data to the protection server according to a preset time interval value based on the authentication validity period data; wherein the authentication validity period data and the status message data are both used to characterize the validity period of a legal session with a target website; An authentication module is used to execute the second verification code data through a browser and send a validity period update request data to the protection server when it is determined that the validity period of a legal session with the target website meets a preset verification condition based on the validity period judgment result data; wherein the validity period update request data is used to request to obtain the updated authentication validity period data.
