Credited crawler identification and defense method

By building front-end static resources and gateway analysis, combined with encrypted fields and static resource interference traps, we can identify and defend against credit crawlers, solve the problems of credit crawler identification accuracy and resource cost in the existing technology, and achieve efficient and accurate crawler identification and Defense effect.

CN118573449AActive Publication Date: 2024-08-30ZHOUPU DATA TECH NANJING CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410740310.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-30
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

It is difficult to accurately identify and defend against credit-granting crawlers that obtain usernames and passwords through legal means with existing technology. Commonly used methods may cause normal users to be mistakenly blocked, and the resource cost is high.

Method used

By building front-end static resources, dyeing user interfaces, gateway analysis and marking requests, using encrypted fields and static resources to interfere with trap identification and defense against credit crawlers, dynamically adjust interface requests, reduce the difficulty of cracking and improve identification accuracy.

Benefits of technology

It realizes the rapid and accurate identification of credit crawlers, reduces resource costs, improves the recognition rate and defense effect, avoids mistaken blocking of normal users, and increases the difficulty of cracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573449A
    Figure CN118573449A
Patent Text Reader

Abstract

The invention provides a credit crawler identification and defense method. The credit crawler identification and defense method is characterized by comprising the following steps: 1) constructing front-end static resources; 2) dyeing the user interface; 3) the gateway analyzes, judges and carries out dyeing marking on the interface request of the user, and determines to release or reject the interface request of the user according to a dyeing result; 4) constructing a static resource interference trap; through the agreed encryption range, the change encryption field and the change trap script are constructed each time, the interface request of the credit crawler can be quickly and accurately identified and defended, the identification rate is improved, and the cracking difficulty of a crawler party is also increased; according to the method and the system, as long as the static resources are released once, contents such as encrypted fields and encrypted files which are originally cracked by the crawler can be invalid, and meanwhile, the defense party only needs to release the static resources once, other configuration items are dynamically stored, and a server does not need to be restarted, so that the resource cost is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crawler identification and defense technology, and in particular to a trusted crawler identification and defense method. Background Art

[0002] A trusted crawler refers to a program or script that has obtained a username, password or login ID through normal channels, uses a crawler to obtain data and performs secondary processing or analysis. As the crawled party, regardless of whether the crawler is trusted or not, it is particularly important for the service provider to protect the security of its own sensitive data.

[0003] Crawler identification is usually performed by checking HTTP request header information, user agent strings, and access patterns. Common techniques include using CAPTCHA (Completely Automated Turing Test to Tell Computers and Humans Apart) or implementing IP address restrictions. These methods can help website administrators determine which visits are initiated by legitimate users and which are initiated by crawlers, so that they can take appropriate measures to protect the security of the website and the integrity of the data.

[0004] Correspondingly, there are many ways to prohibit crawlers, such as: IP address restriction: Websites can block crawlers by restricting access to specific IP addresses. This approach may not be flexible enough because it may affect access by normal users.

[0005] User agent detection: Websites can check the user agent string of HTTP requests to identify the agent used by crawlers. By identifying common crawler user agent strings, websites can deny them access.

[0006] CAPTCHA: Websites can require users to enter a CAPTCHA when accessing sensitive pages or frequent visits. This method can effectively prevent automated crawling because crawlers usually cannot handle CAPTCHAs.

[0007] Frequency Limitation: Websites can limit the frequency of requests from the same IP address or user within a certain period of time. This prevents crawlers from accessing the website too frequently, thereby reducing the load on the server.

[0008] JavaScript detection: Websites can verify whether they are real users by asking users to execute JavaScript code. Because most crawlers do not execute JavaScript, this method can effectively distinguish between crawlers and real users.

[0009] Dynamically generated content: Websites can use JavaScript or server-side technologies to dynamically generate content, making it difficult for crawlers to capture valid information on the page.

[0010] Since the crawler is a trusted crawler (the user name and password were obtained through legal means), and after analysis, the technical means it uses are mostly a combination of web page crawling trusted tokens and interface crawling sensitive data, the above-listed technical means for identifying and prohibiting crawlers cannot be used directly.

[0011] The identification of trusted crawlers is different from that of ordinary crawlers. It is necessary to combine the subsequent operations for identification and defense. Otherwise, it is likely that the identification will fail or be wrong, which will affect the normal use of customers. For example, with IP address access identification and restriction, it is possible that the trusted crawler crawls the machine and the normal use customer uses the same IP access exit. If a single blocked IP is blocked, it will be blocked by mistake, affecting normal use customers.

[0012] Based on this, it is necessary to provide a trusted crawler identification and defense method that can not only correctly identify the trusted crawler, but also carry out targeted and precise defense against the crawler. Summary of the invention

[0013] In order to solve the defects and shortcomings in the prior art, the present invention provides a method for identifying and defending against trusted crawlers.

[0014] The specific scheme provided by the present invention is: A method for identifying and defending against a trusted crawler, characterized in that it comprises the following steps: 1) Build front-end static resources; 2) Coloring the user interface; 3) The gateway analyzes, judges and marks the user's interface request, and decides whether to release or reject the user's interface request based on the marking result; 4) Build a static resource interference trap.

[0015] As a further preferred embodiment of the present invention, the step 1) comprises the following steps: 1.1) Initialize the set of encryptable fields; 1.2) Agree on the file names and variable names of the encrypted files and the encrypted fields defined in the encrypted files; 1.3) Randomly select several fields from the field set in step 1.1); 1.4) Record the randomly selected fields in the storage medium; 1.5) Replace the value of the variable name agreed in step 1.2) with the value of the field variable name obtained in step 1.4); 1.6) Complete the subsequent project construction.

[0016] As a further preferred embodiment of the present invention, the step 1.1) comprises the following steps: 1.11) Analyze all request interfaces or sensitive interfaces of the system; 1.12) Extract the common fields in the analyzed interface; 1.13) The interfaces meeting the preset conditions are stored in a storage medium in the form of a list.

[0017] As a further preferred embodiment of the present invention, the storage medium is a database or a file.

[0018] As a further preferred embodiment of the present invention, the step 2) comprises the following steps: 2.1) Get the field to be encrypted from the encrypted script; 2.2) Pre-read the value of the encrypted field in the request and compose it into a string; 2.3) Encrypt the composed string; 2.4) Add the key value to the request header and assign it the encrypted value obtained in step 2.3); 2.5) Send an interface request to the gateway.

[0019] As a further preferred embodiment of the present invention, the step 3) comprises the following steps: 3.1) The gateway intercepts the interface request and reads the encrypted value of the interface request; 3.2) Compose the encrypted value into a string; 3.3) Encrypt the string; 3.4) Read the key value agreed in the Header value in the request interface; 3.5) Determine whether the encrypted values ​​obtained in step 3.3) and step 3.4) are equal, and perform corresponding coloring marks; 3.6) Determine whether to release the interface request based on the staining result obtained in (5); 3.7) Release or reject the interface request accordingly.

[0020] As a further preferred embodiment of the present invention, in step 3.5), When the judgment results are equal, the request interface is marked with a color; When the judgment results are not equal, the request interface is not marked.

[0021] As a further preferred embodiment of the present invention, in step 3.6), When a dye mark exists on the request interface, the request interface is allowed to be released; When the request interface does not have a dye mark, the request interface is denied.

[0022] As a further preferred embodiment of the present invention, the step 4) comprises the following steps: 4.1) Repeat the steps in step 1) to build the front-end static resources; 4.2) Generate several sets of random strings; 4.3) Change the file names of the puppet script and the encrypted script to the file names of the random strings generated in step 4.2); 4.4) Update the mapping relationship between script files and file names.

[0023] As a further preferred embodiment of the present invention, in step 4.2), the random string is generated using openssl or shell script.

[0024] Compared with the prior art, the present invention can achieve the following technical effects: 1) The present invention provides a method for identifying and defending against trusted crawlers. By establishing an agreed encryption range, changing the encrypted field each time, and changing the trap script, the interface request of the trusted crawler can be quickly and accurately identified and defended against, thereby improving the recognition rate and increasing the difficulty of cracking by the crawler.

[0025] 2) The present invention provides a trusted crawler identification and defense method. As long as the static resources are released once, the encrypted fields, encrypted files and other contents originally cracked by the crawler will become invalid. At the same time, the defender only needs to release the static resources once, and the remaining configuration items are all dynamically stored. There is no need to restart the server, and the resource cost is low.

[0026] 3) The present invention provides a method for identifying and defending against trusted crawlers. The technical solution proposed in the present invention can more accurately identify crawlers and normal users, and use smaller resources to deal with the processing solution after the crawler is cracked, which has advantages in accurate identification and resource investment ratio. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A flowchart of the steps of the method provided by the present invention.

[0028] Figure 2 This is a flow chart of step 1) in the method provided by the present invention.

[0029] Figure 3 This is a flow chart of step 2) in the method provided by the present invention.

[0030] Figure 4 This is a flow chart of step 3) in the method provided by the present invention.

[0031] Figure 5 This is a flow chart of step 4) in the method provided by the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front end", "rear end", "two ends", "one end", "the other end" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0034] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "provided with", "connected", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0035] [First embodiment] like Figure 1 The first embodiment of the present invention is shown, which provides a method for identifying and defending against trusted crawlers, including the following steps: 1) Build front-end static resources; such as Figure 2 As shown, the specific steps include: 1.1) Initialize the set of encryptable fields; need to: analyze all HTTP request interfaces of the system or information-sensitive interfaces that need special attention; then extract the common fields in the analyzed interfaces; then store the interfaces that meet the preset conditions in the form of a list in a storage medium, which can be a database, a file or other form.

[0036] 1.2) Agree on the file names and variable names of the encrypted files and the encrypted fields defined in the encrypted files; 1.3) At this point, the construction begins. The field set obtained in step 1.1) is obtained through a shell script, and several fields are randomly selected from the field set (two fields are selected in this embodiment); 1.4) Record the randomly selected fields in the storage medium; 1.5) Replace the value of the variable name agreed in step 1.2) with the value of the field variable name obtained in step 1.4); 1.6) Complete the subsequent project construction.

[0037] After the front-end static resources are published, the request interface during normal user use needs to be colored, namely: 2) Coloring the user interface, such as Figure 3 As shown, the specific steps include: 2.1) Get the field to be encrypted from the encrypted script; 2.2) Pre-read the value of the encrypted field in the request and compose it into a string. For example, the string can be composed in the form of [field 1=xxx&field 2=xxx]; 2.3) Encrypt the composed string. In this embodiment, the MD5 encryption algorithm is selected, which has good compressibility, is easy to calculate, has strong resistance to modification and collision, and has a powerful algorithm and high cracking difficulty; 2.4) Add the key value to the request header and assign it the encrypted value obtained in step 2.3); 2.5) Send an interface request to the gateway.

[0038] 3) After the request is sent, the interface is transmitted through the network to the gateway, and the gateway analyzes, judges and marks the user's interface request, and decides whether to release or reject the user's interface request based on the marking result; the specific steps include: Figure 4 As shown: 3.1) The gateway intercepts the interface request and reads the encrypted value of the interface request; 3.2) Compose the encrypted value into a string. Similarly, the string can be composed in the form of [field 1=xxx&field 2=xxx]; 3.3) Encrypt the string. Correspondingly, the MD5 encryption algorithm is also used in this embodiment; 3.4) Read the key value agreed in the Header value in the request interface; 3.5) Determine whether the encrypted values ​​obtained in step 3.3) and step 3.4) are equal, and perform corresponding color marking; When the judgment results are equal, the request interface is marked with a color; When the judgment results are not equal, the request interface is not marked.

[0039] 3.6) Determine whether to release the interface request based on the staining result obtained in (5), that is: When a dye mark exists on the request interface, the request interface is allowed to be released; When the request interface does not have a dye mark, the request interface is denied.

[0040] 3.7) Release or reject the interface request accordingly.

[0041] In order to further improve the encryption and reduce the possibility of being cracked, a series of irregular strings can be generated as the script file name using a random sequence each time the script is built. The content in the script file includes an obfuscated script and an encrypted script of the same size. After the construction is completed, the corresponding encrypted scripts will be hidden in different script files. That is, the embodiment of the present invention also includes the steps of: 4) Construct static resource interference traps, such as Figure 5 As shown, the specific steps include: 4.1) Repeat the steps in step 1) to build the front-end static resources; 4.2) Generate several sets of random strings using openssl or shell scripts; 4.3) Change the file names of the puppet script and the encrypted script to the file names of the random strings generated in step 4.2); 4.4) Update the mapping relationship between script files and file names.

[0042] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A method for identifying and defending against trusted crawlers, Features: The following steps are involved: 1) Build front-end static resources; 2) Coloring the user interface; 3) The gateway analyzes, judges and marks the user's interface request, and decides whether to release or reject the user's interface request based on the marking result; 4) Build a static resource interference trap.

2. A trusted crawler identification and defense method according to claim 1, Features: The step 1) includes the following steps: 1.1) Initialize the set of encryptable fields; 1.2) Agree on the file names and variable names of the encrypted files and the encrypted fields defined in the encrypted files; 1.3) Randomly select several fields from the field set in step 1.1); 1.4) Record the randomly selected fields in the storage medium; 1.5) Replace the value of the variable name agreed in step 1.2) with the value of the field variable name obtained in step 1.4); 1.6) Complete the subsequent project construction.

3. A trusted crawler identification and defense method according to claim 2, Features: The step 1.1) includes the following steps: 1.11) Analyze all request interfaces or sensitive interfaces of the system; 1.12) Extract the common fields in the analyzed interface; 1.13) The interfaces meeting the preset conditions are stored in a storage medium in the form of a list.

4. A trusted crawler identification and defense method according to claim 3, Features: The storage medium is a database or a file.

5. A trusted crawler identification and defense method according to claim 1, Features: The step 2) includes the following steps: 2.1) Get the field to be encrypted from the encrypted script; 2.2) Pre-read the value of the encrypted field in the request and compose it into a string; 2.3) Encrypt the composed string; 2.4) Add the key value to the request header and assign it the encrypted value obtained in step 2.3); 2.5) Send an interface request to the gateway.

6. A trusted crawler identification and defense method according to claim 1, Features: The step 3) includes the following steps: 3.1) The gateway intercepts the interface request and reads the encrypted value of the interface request; 3.2) Compose the encrypted value into a string; 3.3) Encrypt the string; 3.4) Read the key value agreed in the Header value in the request interface; 3.5) Determine whether the encrypted values ​​obtained in step 3.3) and step 3.4) are equal, and perform corresponding color marking; 3.6) Determine whether to release the interface request based on the staining result obtained in (5); 3.7) Release or reject the interface request accordingly.

7. A trusted crawler identification and defense method according to claim 6, Features: In step 3.5), When the judgment results are equal, the request interface is marked with a color; When the judgment results are not equal, the request interface is not marked.

8. A trusted crawler identification and defense method according to claim 6, Features: In step 3.6), When a dye mark exists on the request interface, the request interface is allowed to be released; When the request interface does not have a dye mark, the request interface is denied.

9. A trusted crawler identification and defense method according to claim 1, Features: The step 4) includes the following steps: 4.1) Repeat the steps in step 1) to build the front-end static resources; 4.2) Generate several sets of random strings; 4.3) Change the file names of the puppet script and the encrypted script to the file names of the random strings generated in step 4.2); 4.4) Update the mapping relationship between script files and file names.

10. A trusted crawler identification and defense method according to claim 9, Features: In step 4.2), a random string is generated using openssl or a shell script.

Citation Information

Patent Citations

  • Anti-crawling methods, server, client and system

    CN105577684A

  • Page display method and device based on combined web crawler defense technology and electronic equipment

    CN111212033A

  • WEB reverse osmosis method, system and device based on crawler honeypot trap and computer readable storage medium

    CN112104600A

  • Anti-crawler method and system, computer equipment and storage medium

    CN115329291A

  • Data processing method and device, electronic equipment and storage medium

    CN116451216A