Dynamic URL generation and verification method, device and equipment with verification function

By introducing a multi-verification mechanism into the URL and using technologies such as information database and Base64 decryption, the problem of URL being easily tampered with and attacked is solved, network security is significantly improved, and the difficulty of hacker attacks is increased.

CN116015953BActive Publication Date: 2024-09-24HUBEI IVORY TOWER INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310003089.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-03
Publication Date
2024-09-24
Estimated Expiration
2043-01-03

AI Technical Summary

Technical Problem

Existing URLs are easily tampered with and attacked by hackers, resulting in compromised network security and inability to effectively prevent attacks such as URL injection.

Method used

Adopting a dynamic URL generation and verification method with verification function, by setting up the information database, including the category information of the target page, timestamp, publisher information, random number and database ID, Base64 decryption, filtering irregular characters, verification parameter length and The value consistency in the rule base ensures that the core parameter values ​​of the URL comply with regulations and increases the difficulty of attacks.

Benefits of technology

It effectively increases the difficulty of URL attacks and cracks, ensures the security of parameter values ​​through multiple verification mechanisms, improves network security, and implements simple and convenient security measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004034791290000051
    Figure BDA0004034791290000051
  • Figure BDA0004034791290000052
    Figure BDA0004034791290000052
  • Figure BDA0004034791290000062
    Figure BDA0004034791290000062
Patent Text Reader

Abstract

The invention discloses a method for generating and verifying a dynamic URL with a verification function, comprising the following steps: S1: setting parameters with a verification function and establishing an information database; the information database comprises: category information of a target page, a timestamp of the target page information, information of a publisher of the target page information, a random number and a database ID corresponding to the target page; S2: verifying the core parameter value of the dynamic URL with a verification function according to the parameters with a verification function; the method of the invention has strong expansibility, and according to the method, the parameter value can be infinitely set and expanded with rules, and by using the concept of the method of the invention, more verification methods can be derived according to actual needs, thereby increasing the difficulty for hackers to attack and crack the URL, and the implementation is simple, convenient and safe.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer communications, and in particular to a method, device and equipment for generating and verifying a dynamic URL with a verification function. Background Art

[0002] Network security is essentially the information security on the network. In a broad sense, all technologies and theories related to the confidentiality, integrity, availability, authenticity and controllability of information on the network are the research fields of network security.

[0003] All data on the Internet is stored on the host (server). All hosts on the Internet have a unique IP address, and communication between any two hosts on the Internet is achieved through IP addresses.

[0004] URL (Uniform Resource Locator) is used to indicate the server of the Internet host and the specific location of the web page.

[0005] Every web page on the Internet has a unique name, usually called a URL. It is the uniform resource locator of www. Simply put, URL is the web address, commonly known as the "web address".

[0006] URL is a concise representation of the location and access method of resources obtained on the Internet. It is the address of standard resources on the Internet. URL is globally unique. The correct URL should be able to open this web page through a browser.

[0007] The URL can be used to access the specified resources on the server. If the URL is set or verified improperly, hackers can access or obtain more resources on the server by modifying the URL. Hackers can also introduce browsers to other illegal addresses by partially replacing the content of the URL, such as jumping to a Trojan link or an illegal website through the URL. If the parameter value of the URL is guessed or changed, it is very likely that the data in the WEB database can be directly obtained, making the network unsafe, and the URL is very vulnerable to attacks such as URL injection launched by hackers.

[0008] In view of this, it is necessary to provide a new method, device and equipment for generating and verifying dynamic URLs with verification function to overcome the above-mentioned defects. Summary of the invention

[0009] The purpose of the present invention is to provide a dynamic URL generation method, verification method, device, equipment and storage medium with verification function, which can choose whether to encrypt the parameter value according to actual needs. If the composition rules are unknown, it cannot be imitated or tampered with, which increases the difficulty for hackers to attack and crack the URL. The implementation is simple, convenient and safe.

[0010] In order to achieve the above object, the present invention provides a dynamic URL generation and verification method with verification function, comprising the following steps:

[0011] S1: Setting parameters with verification function and establishing an information database; the information database includes: category information of the target page, timestamp of the target page information, publisher information of the target page information, random number and database ID corresponding to the target page;

[0012] S2: verify the core parameter value of the dynamic URL with verification function according to the parameter with verification function;

[0013] The specific verification process includes the following steps:

[0014] S21: Decrypt the core parameter value in the URL with verification function based on Base64.

[0015] S22: Filter the decrypted core parameters and clean up the possible irregular characters in the parameters. This step can be implemented by a filtering function, that is, filtering possible illegal characters such as: @# / *? ,"' and SQL reserved keywords. If they are not contained, the next step of the verification procedure is entered;

[0016] If the URL with verification function is tampered with and some illegal characters are added, the URL with verification function will filter out these illegal characters;

[0017] S23: Verify the overall number of digits of the core parameter value of the URL with verification function to determine whether the length of the core parameter value is the specified length. If the length of the core value is equal to the specified length, enter the next step of verification procedure. If it is not the specified length, terminate the access.

[0018] S24: Verify the first character of the core parameter value of the URL with verification function to see whether the first character i of the core parameter value is a value preset in the rule library when the URL is generated; if the first character is a value preset in the rule library, enter the next step of verification procedure, if not, terminate the access;

[0019] S25: Verify the timestamp of the core parameter value of the URL with verification function, and determine whether the timestamp length of the core parameter value is 10 digits, whether the value of the timestamp of the core parameter is composed entirely of digits, and whether the timestamp of the core parameter is consistent with the timestamp recorded in the database. If the above three conditions are met, enter the next verification procedure; if not, terminate the access;

[0020] S26: Verify the publishing user name xytzg in the core parameter value of the URL with the verification function, and determine whether the information publishing user name xytzg of the core parameter value is consistent with the user name xytzg recorded in the database. If they are consistent, enter the next verification procedure; if not, terminate the access;

[0021] S27: Verify the information ID of the component of the core parameter value of the URL with verification function to determine whether the information ID of the core parameter value is composed of all numbers; whether it is consistent with the ID value recorded in the database. If the above three conditions are met, enter the next verification procedure, if not, terminate the access.

[0022] A dynamic URL verification device with verification function, characterized in that it includes a data creation module, through which parameters with verification function and the position of the parameters are set;

[0023] A data storage module, the data storage module is in communication connection with the data parameter creation module, the data storage module is used to store parameter information with verification function set by the data creation module;

[0024] A verification module is connected to the data storage module for verifying parameter information of the target page, a timestamp of the target page information, publisher information of the target page, a random number, and a database ID of the target page stored in the data storage module.

[0025] Preferably, the category information of the target page includes parameters m, c, and i, wherein m represents that a column is about to be visited, c represents that a category is about to be visited, and i represents that a detail page is about to be visited.

[0026] A device for a method for generating and verifying a dynamic URL with a verification function comprises a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for generating and verifying a dynamic URL with a verification function.

[0027] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, a method for generating and verifying a dynamic URL with a verification function is implemented.

[0028] Compared with the prior art, the beneficial effects are as follows: the dynamic URL verification method with verification function provided by the present invention transforms the URL into one with only one parameter, and can choose whether to encrypt the parameter value according to actual needs. The core parameter value of a URL with verification function can have at least 7 verifications. If its composition rules are not known, it cannot be imitated or tampered with. The method in the present invention has strong scalability. According to this method, the parameter value can be infinitely set and expanded with rules. Using the concept of the method of the present invention, more verification methods can be derived according to actual needs, which increases the difficulty for hackers to attack and crack from the URL. The implementation is simple, convenient and safe. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and beneficial technical effect of the present invention clearer, the present invention is further described in detail below in combination with the specific implementation methods. It should be understood that the specific implementation methods described in this specification are only for explaining the present invention, not for limiting the present invention.

[0030] The present invention provides a method for generating and verifying a dynamic URL with a verification function, comprising the following steps:

[0031] S1: Setting parameters with verification function and establishing an information database; the information database includes: category information of the target page (1 bit), timestamp of the target page information (10 bits), publisher information of the target page information (5 bits), random number (4 bits) and database ID corresponding to the target page (10 bits);

[0032] The rules of the target page information (1 bit) are as follows in Table 1 (this rule Table 1 can be created and agreed upon through a database or XML or other forms):

[0033]

[0034] Assume that the core parameter value for setting the parameter with validation function is as follows:

[0035] m1521565261xytzg00010000000100;

[0036] The corresponding URL example with verification function is as follows:

[0037] http: / / www.xytzg.com / about / index / no / bTE1MjE1NjUyNjF4eXR6ZzAwMDEwMDAwMDAwMTAw.html;

[0038] The above URL is decrypted by base64 as follows:

[0039] http: / / www.xytzg.com / about / index / no / m1521565261xytzg00010000000100.html is to visit a column (because the first letter is m). The timestamp of this column is 1521565261. The publisher of the information (i.e. the creator of the information) is xytzg. The random number is 0001. The column ID in the database is 100.

[0040] Please refer to Table 2 below for details:

[0041]

[0042]

[0043] Similarly, if the URL with verification function is as follows:

[0044] http: / / www.xytzg.com / about / index / no / YzE1MjE1NjUyNjFhZG1pbjAwMDMwMDAwMDAwMTIz.html,

[0045] The parameter value of the URL with verification function is decrypted based on Base64 as follows:

[0046] http: / / www.xytzg.com / about / index / no / c1521565261admin00030000000123.html;

[0047] From Table 1 above, we can know that the parameter value of the URL with verification function after Base64 decryption is http: / / www.xytzg.com / about / index / no / c1521565261admin00030000000123.html, which is to access a category (because the first letter is c), and the timestamp of this category is 1521565261; the publisher of the category (i.e. the creator of the category) is admin; the random number is 0003; the ID of the category in the database is 123, please refer to Table 3 below for details:

[0048]

[0049] Assume that the core parameter value for setting the parameter with validation function is as follows:

[0050] i1521565261xytzg11110000000333;

[0051] The corresponding URL example with verification function is as follows:

[0052] http: / / www.xytzg.com / about / index / no / aTE1MjE1NjUyNjF4eXR6ZzExMTEwMDAwMDAwMzMz.html;

[0053] The above http: / / www.xytzg.com / about / index / no / aTE1MjE1NjUyNjF4eXR6ZzExMTEwMDAwMDAwMzMz.html is to access a detail page (because the first letter is i). The timestamp of this detail page is 1521565261. The publisher of the detail page (that is, the creator of the detail page) is xytzg.

[0054] Assuming that a system uses the technology of the URL generation method with verification function of this embodiment, the name of the table corresponding to its database is: xytzg_info, and the corresponding storage content in the database is shown in Table 4 below:

[0055]

[0056] S2: Verify the dynamic URL parameter value with verification function according to the parameter with verification function;

[0057] Assume that the following is an example of a dynamic URL parameter value with validation:

[0058] http: / / www.xytzg.com / about / index / no / aTE1MjE1NjUyNjF4eXR6ZzExMTEwMDAwMDAwMzMz.html;

[0059] Among them, aTE1MjE1NjUyNjF4eXR6ZzExMTEwMDAwMDAwMzMz, the value after Base64 decryption is as follows: i1521565261xytzg11110000000333;

[0060] The corresponding example of decrypted URL with verification function is as follows:

[0061] http: / / www.xytzg.com / about / index / no / i1521565261xytzg11110000000333.html.

[0062] The specific process includes the following steps:

[0063] S21: The core parameter value of no in the decrypted URL with verification function

[0064] aTE1MjE1NjUyNjF4eXR6ZzExMTEwMDAwMDAwMzMz is decrypted with Base64 to get i1521565261xytzg11110000000333;

[0065] S22: Filter the decrypted parameter value i1521565261xytzg11110000000333 of the core parameter no, clean up irregular characters (all characters except letters and numbers) to prevent URL injection. This step can be achieved by a replacement function, that is, filtering out possible illegal characters such as: @# / *? ,"' and sql reserved keywords. If they are not included, the next step of the verification procedure is entered. If they are included, the access is terminated; the sql reserved keywords are: SELECT, SESSION, SESSION-USER, SET, SIZE, SMALLINT, SOME, SPACE, SQL, SQLCODE, SQLSTATE, SUBSTRING, SUM, DEL;

[0066] The specific filtering process is: use the replacement function preg_replace(mixed$pattern,mixed$replacement,mixed$subject[,int$limit=-1[,int&$count]])

[0067] Search the part matching pattern in subject and replace it with replacement. Replace the possible illegal characters with nothing, such as preg_replace(). You can also determine whether the core parameter value contains the above illegal characters or reserved keywords. If not, proceed to the next step of verification. If yes, terminate the access.

[0068] The preg_replace function performs a regular expression search and replace.

[0069] The syntax is as follows:

[0070] preg_replace(mixed$pattern,mixed$replacement,mixed$subject[,int$limit=-1[,int&$count]]);

[0071] Search subject for parts matching pattern and replace them with replacement.

[0072] Parameter Description:

[0073] $pattern: The pattern to search for, which can be a string or an array of strings.

[0074] $replacement: The string or array of strings to replace.

[0075] $subject: The target string or array of strings to search and replace.

[0076] $limit: Optional, the maximum number of times each pattern can be replaced for each subject string. Default is -1 (unlimited).

[0077] $count: Optional, the number of times the replacement is performed.

[0078] If a hacker tampers with the above verification URL and adds some parameters (such as or), the verification URL will become

[0079] http: / / www.xytzg.com / about / index / no / i1521565261xytzg11110000000or333.html, then this filtering step can filter out the parameters (such as or) added to the URL with verification function;

[0080] S23: Verify the overall number of digits of the core parameter value of the URL with verification function to determine whether the length of the core parameter value is the specified length. If the length of the core value is equal to the specified length, enter the next step of verification procedure. If it is not the specified length, terminate the access.

[0081] S24: Verify the first character of the core parameter value of the URL with verification function to see whether the first character i of the core parameter value is the value of the database record of the set details page; if the first character is in the information database of the target page, enter the next step of verification procedure, if not, terminate the access;

[0082] S25: Verify the timestamp of the core parameter value to determine whether the length of the timestamp part 521565261 of the core parameter value is 10 bits, whether the value of the timestamp of the core parameter value is entirely composed of numbers, and whether the core parameter value is consistent with the timestamp recorded in the database. If the above three conditions are met, enter the next step of the verification procedure. If not, terminate the access.

[0083] S26: Verify the publishing user name xytzg in the core parameter value of the URL with the verification function, and determine whether the information publishing user name xytzg of the parameter value is consistent with the user name xytzg recorded in the database. If they are consistent, enter the next verification procedure; if not, terminate the access;

[0084] S27: Verify the information ID of the component of the parameter value of the URL with verification function, and determine whether the information ID of the core parameter value is composed of all numbers; whether it is consistent with the ID value recorded in the database. If the above three conditions are met, enter the next verification procedure, if not, terminate the access.

[0085] In summary, the improvement of the URL with verification function over the prior art is that no matter how many parameters the original URL carries, the URL can be modified into one with only one parameter according to the method in this invention, and whether the parameter value needs to be encrypted can be selected according to actual needs. The core parameter value of a URL with verification function can have at least 7 layers of verification. If its composition rules are not known, it cannot be imitated or tampered with, which increases the difficulty for hackers to attack and crack the URL; and according to this method, the parameter value can be infinitely set and expanded with rules. Using the concept of the method of the present invention, more verification methods can be derived according to actual needs, and the implementation is simple, convenient and safe.

[0086] The present invention also provides a device for a method for generating and verifying a dynamic URL with a verification function, comprising a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for generating and verifying a dynamic URL with a verification function.

[0087] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a method for generating and verifying a dynamic URL with a verification function is implemented.

[0088] The present invention is not limited to what is described in the specification and implementation modes, and therefore additional advantages and modifications can be easily realized by those skilled in the art. Therefore, without departing from the spirit and scope of the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details, representative devices, and examples shown and described herein.

Claims

1. A method for generating and verifying a dynamic URL with verification function, characterized in that: The steps include: S1: Setting parameters with verification function and establishing an information database; the information database includes: category information of the target page, timestamp of the target page information, publisher information of the target page information, random number and database ID corresponding to the target page; S2: verify the core parameter value of the dynamic URL with verification function according to the parameter with verification function; The specific verification process includes the following steps: S21: Decrypt the core parameter value in the URL with verification function based on Base64. S22: Filter some parameters in the decrypted core parameters to remove irregular characters. This step can be implemented by a filtering function, that is, filtering out possible illegal characters and SQL reserved keywords. If they are not included, the next step of the verification procedure is entered. If they are included, the access is terminated. If the URL with verification function is tampered with and some illegal characters are added, the parameters added to the URL with verification function will be filtered out; S23: Verify the overall number of digits of the core parameter value of the URL with verification function to determine whether the length of the core parameter value is the specified length. If the length of the core value is equal to the specified length, enter the next step of verification procedure. If it is not the specified length, terminate the access. S24: verifying the first character i of the core parameter value of the URL with verification function to see whether the first character i of the core parameter value is a value recorded in the preset rule table when the URL is generated; If the first character is the value recorded in the preset rule table, the next step of the verification procedure will be entered; if not, the access will be terminated; S25: Verify the timestamp of the core parameter value of the URL with verification function, and determine whether the timestamp length of the core parameter value is 10 digits, whether the value of the timestamp of the core parameter is composed entirely of digits, and whether the timestamp of the core parameter is consistent with the timestamp recorded in the database. If the above three conditions are met, enter the next verification procedure; if not, terminate the access; S26: Verify the publishing user name xytzg in the core parameter value of the URL with the verification function, and determine whether the information publishing user name xytzg of the core parameter value is consistent with the user name xytzg recorded in the database. If they are consistent, enter the next verification procedure; if not, terminate the access; S27: Verify the information ID of the component of the core parameter value of the URL with verification function to determine whether the information ID of the core parameter value is composed of all numbers; whether it is consistent with the ID value recorded in the database. If the above three conditions are met, enter the next verification procedure, if not, terminate the access.

2. The method for generating and verifying a dynamic URL with verification function as claimed in claim 1, characterized in that: The category information of the target page includes parameters m, c, and i, wherein m represents that a column is about to be visited, c represents that a category is about to be visited, and i represents that a detail page is about to be visited.

3. A device for generating and verifying a dynamic URL with verification function, characterized in that: A method for generating and verifying a dynamic URL with a verification function as described in any one of claims 1 to 2 is adopted, comprising a data creation module, and parameters with a verification function and the position of the parameters are set through the data creation module; A data storage module, the data storage module is in communication connection with the data creation module, the data storage module is used to store parameter information with a verification function set by the data creation module; A verification module is connected to the data storage module for verifying parameter information of the target page, a timestamp of the target page information, publisher information of the target page, a random number, and a database ID of the target page stored in the data storage module.

4. The device for generating and verifying a dynamic URL with verification function as claimed in claim 3, characterized in that: The category information of the target page includes parameters m, c, and i, wherein m represents that a column is about to be visited, c represents that a category is about to be visited, and i represents that a detail page is about to be visited.

5. A device for generating and verifying a dynamic URL with verification function, characterized in that: It comprises a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for generating and verifying a dynamic URL with a verification function as described in any one of claims 1-2.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating and verifying a dynamic URL with a verification function according to any one of claims 1 to 2 is implemented.