Method, system, equipment and medium for replacing external domain name link of website with credible intermediate domain name link
By using regular string matching and transit domain name link replacement technology in the website, the problems of difficulty in managing external domain name links and low security are solved, and the separation of external domain name links and the original website domain name is achieved, improving the security and management of the website efficiency.
Patent Information
- Application Number
- CN202411229015.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The existing technology cannot effectively separate and manage external domain name links of websites, resulting in illegal websites being exploited, affecting website security, and there are a lot of troubles for administrators during the cleaning and maintenance process.
Search the website folder and database through the program, use regular string matching to extract external domain name links, and replace them with transit domain name links to achieve trusted intermediate links, reduce administrator workload and improve website security.
The separation of external domain name links and original website domain names is achieved, and temporary closure and security inspections are avoided after illegal links are detected, which improves the security and management efficiency of the website.
Smart Images

Figure CN119202418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of website link security technology, and in particular to a method, system, device and medium for replacing a website external domain name link with a trusted intermediate domain name link. Background Art
[0002] The terminals that users use the Internet are mainly divided into mobile application terminals and web terminals. Mobile Internet applications are booming. The number of active APPs monitored in the domestic market has reached 2.6 million, further covering the daily study, work, and life of netizens, and the foundation of the Internet of Everything is constantly being consolidated. On the web side, there are currently about 3.87 million websites in my country. Although it shows a downward trend year by year, there are still many network services provided by websites. The phenomenon of the annual decline in the number of websites reflects the decline in the management and operation personnel behind them. Some websites have even been abandoned but not cancelled. This has led to a large number of unmaintained websites being used by the black industry behind the scenes and tampered with into gambling platforms, online fraud platforms, or obscene pornographic websites. At the same time, there are a large number of illegal overseas websites, such as the illegal gambling and fraud websites that have emerged in recent years. Because the servers are located overseas, it is further difficult to deal with them and the harm they cause to society.
[0003] During the daily maintenance of campus websites, the following phenomenon was discovered: the original legitimate domain name links have been widely published on the campus network during use. When these legitimate domain names, such as the international conference domain name www.****.org, are no longer renewed after completing their missions or website services, they will be illegally re-registered by some people and used for illegal websites such as pornography, gambling, and drugs. The black industry behind the scenes intends to use university websites to promote illegal websites, which damages the positive image of educational institutions and has a very bad impact. Once a domain name is used by an illegal website, the telecommunications security department will require it to be cleaned up immediately after detection, otherwise the school's telecommunications outlet will be cut off, which has caused great trouble to the administrator's work. At present, the administrator can only manually clean up one illegal domain name after the telecommunications department finds it, which is very passive and cannot be completely eradicated.
[0004] In order to proactively clean up and purify the external links on existing websites more deeply and comprehensively, a method is proposed to separate the external links of campus websites from the original websites to ensure the security of the links of the original campus websites.
[0005] The patent application with publication number CN112560399A discloses a method and device for replacing page links. First, the page domain name link replacement rules are obtained and saved. Then, when the domain name link button in the page is detected to be clicked, the domain name link string to be replaced in the domain name link corresponding to the link button is obtained. According to the link replacement rules, the domain name link string to be replaced is replaced with the target domain name link string; jump to the replaced domain name link. Each domain name link replacement rule needs to be saved separately. In fact, the external domain name link and the original website domain name are not separated. It is only the replacement of the domain name link string.
[0006] There is also a replacement of external domain name links implemented on Zhihu website. The external domain name link is replaced as a parameter with link.zhihu.com / ? target = "external domain name link". When the domain name link is detected to be clicked, it will first jump to the prompt page to remind the user that he is about to leave Zhihu. After the user clicks to continue visiting, it will jump to the external domain name link. However, it needs to process the external domain name link when publishing again, and cannot replace the existing external domain name links on the website. Summary of the invention
[0007] In order to overcome the problems existing in the above-mentioned prior art, the present invention proposes a method, system, device and medium for replacing the external domain name link of a website with a trusted intermediate domain name link. The method searches the website folder and database through a program, extracts all external links, and replaces the external links with intermediate trusted links by means of a transit domain name, thereby reducing the workload of website administrators in modifying website links and publishing website content, avoiding users from directly jumping to external links, and thus improving the security of the website itself; the method has the characteristics of high efficiency and security.
[0008] In order to achieve the above object, the technical solution adopted by the present invention is:
[0009] A method for replacing a website external domain name link with a trusted intermediate domain name link, specifically comprising the following steps:
[0010] Step 1: Get the website's external domain name link;
[0011] Step 2: Generation of intermediate domain name links;
[0012] Step 3: Replacement of the intermediate domain name link: Replace the website external domain name link obtained in step 1 with the intermediate domain name link generated in step 2 in the form of a transit domain name to become an intermediate trusted domain name link.
[0013] The specific method of step 1 is:
[0014] All links of the website content are obtained by searching the exported files of the website database; external domain name link data is collected through regular string matching and all external domain name links contained in the website are saved.
[0015] The method for searching the external domain name link data in step 1 is: The herf attribute in the tag extracts the domain name link content in the page, and then compares it with the main domain name of the website, using string matching to match all domain name links. Links that do not start with the main domain name are external domain name links of the website, and then all external domain name links contained in the website are saved.
[0016] The specific method of step 2 is:
[0017] First, a web server is used in a computer room or cloud server to build the domain name of the transit website, and a function interface is set up at the back end of the transit website as the transit website access interface. Then, according to the website external domain name link obtained in step 1, all external domain name links are numbered starting from 1, and then the transit website access interface is spliced, and the external domain name link number as the Get request parameter forms the intermediate domain name link; then, the external domain name link and the intermediate domain name link are stored in a file or database one by one.
[0018] The specific method of step 3 is: Replacement of the transit link:
[0019] For the external domain name links stored in the file, search by traversing the folder where the transit website is located; first read the external domain name link that needs to be replaced from the transit website database, then traverse the folder corresponding to the website that needs to replace the external domain name link, and replace the external domain name link string with the intermediate domain name link string;
[0020] For external domain name links stored in the database, the external domain name links that need to be replaced are first read from the database of the transit website, and then the content containing the external domain name links is searched in the database in a loop. Then, through string matching operations, the external domain name link string is replaced with the intermediate domain name link string.
[0021] A system for replacing a website's external domain name link with a trusted intermediate domain name link, comprising:
[0022] External domain name link acquisition module: used in step 1 to achieve the acquisition and preservation of external domain name links in the website, by searching the website folder and database export files, using string regular matching technology to obtain all links of the website content; extracting external domain name link data and saving all external domain name links contained in the website;
[0023] Intermediate domain name link generation module: used for generating the intermediate domain name link in step 2; by building a transit website domain name interface and matching and splicing the external domain name link number, a one-to-one correspondence between the external domain name link and the intermediate domain name link is achieved;
[0024] Link replacement module: used in step 3, to replace the website external domain name link obtained in step 1 with the transit domain name link generated in step 2 in the form of a transit domain name, to become an intermediate trusted domain name link, thereby realizing the replacement of the external domain name link in the website.
[0025] A device for replacing an external domain name link of a website with a trusted intermediate domain name link, comprising:
[0026] Memory for storing computer programs;
[0027] A processor is used to implement the method of replacing an external domain name link of a website with a trusted intermediate domain name link as described in steps 1 to 3 when executing the computer program.
[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, can replace a website's external domain name link with a trusted intermediate domain name link based on the method described in steps 1 to 3.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention adopts a regular matching method to extract all external domain name links from a website database, and processes the external domain name links into credible intermediate domain name links, thereby reducing the workload of website administrators when modifying website domain name links and publishing website content.
[0031] The present invention directly replaces the external domain name link with the intermediate website domain name link after numbering the external domain name link, separates the external domain name link from the original website domain name link, avoids the problem of parameter loss in the intermediate domain name link jump process caused by the external domain name link being too long, and ensures the security of the website domain name link when scanning.
[0032] The present invention extracts the external website link that needs to be published, and replaces the external website domain name link with a trusted intermediate domain name link by a transit domain name method, thereby avoiding users from directly jumping to the external domain name link, thereby improving the security of the website itself.
[0033] The present invention achieves separation of the external website domain name link from the original website domain name connection by replacing the external website domain name link with a trusted intermediate domain name link, thereby avoiding temporary closure or other security checks required after the original website is detected by relevant departments because the external domain name link may contain illegal domain name links.
[0034] In summary, the present invention aims to solve the problems of difficult management and insecurity of website external domain name links. By adopting a trusted intermediate domain name link to replace the original external domain name link, the external domain name link and the original website can be separated. This improves the security of the website and avoids the temporary closure or other security checks required after the original website is detected by relevant departments because the external domain name link may contain illegal domain name links. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of the system of the present invention.
[0036] Figure 2 A corresponding diagram of some external domain name links and intermediate domain name links obtained for the website.
[0037] Figure 3 Displays the effect image for the original external domain name link.
[0038] Figure 4 It is the jump address of the original external domain name link.
[0039] Figure 5 This is an image showing the effect of replacing the middle domain name link. DETAILED DESCRIPTION
[0040] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0041] A method for replacing a website external domain name link with a trusted intermediate domain name link, specifically comprising the following steps: Figure 1
[0042] Step 1: Get the website's external domain name link;
[0043] All links of the website content are obtained by searching the exported files of the website database; external domain name link data is collected and all external domain name links contained in the website are saved through regular string matching.
[0044] The method for collecting external domain name link data in step 1 is to The herf attribute in the tag extracts the link content in the page, and then compares it with the main domain name of the website. For example, if the main domain name of the website is www.ABC.org, all domain name links are matched by string matching. Domain name links that do not start with www.ABC.org are external domain name links of the website. Then all external domain name links contained in the website are saved.
[0045] Step 2: Generation of intermediate domain name links;
[0046] First, use Nginx, Apache and other Web servers in the computer room or cloud server to build the domain name of the transit website, and set a function interface as the transit website access interface at the back end of the transit website. Then, according to the obtained website external domain name link, all external domain name links are numbered from 1, and then the transit website access interface is spliced with the external domain name link number as the Get request parameter to form an intermediate domain name link; then the external domain name link and the intermediate domain name link are stored one by one in a file or database.
[0047] Step 3: Replacement of the intermediate domain name link: Replace the website external domain name link obtained in step 1 with the intermediate domain name link generated in step 2 in the form of a transit domain name to become an intermediate trusted domain name link;
[0048] Since different websites store domain name links in different ways, external domain name links may be stored in files such as HTML and PHP, or may exist in the website's own database, so they should be replaced separately during the process of replacing the website's domain name links;
[0049] For the external domain name links stored in the file, search by traversing the folder where the website is located; first read the external domain name link that needs to be replaced from the transit website database, then traverse the folder corresponding to the website that needs to replace the external domain name link, and replace the external domain name link string with the intermediate domain name link string;
[0050] For external domain name links stored in the database, first read the external domain name links that need to be replaced from the transit website database, and then use a loop to search for content containing external domain name links in the database. Then, through string matching operations, replace the external domain name link string with the intermediate domain name link string.
[0051] The technical effects of the present invention are further illustrated by examples below.
[0052] All links of the website content are obtained through regular string matching; first, the folder where the website is located and the corresponding database are exported, and then a Java program is used to traverse all the exported files, and string matching technology is used to collect the HTML source code of the web page to obtain the HTML source code of the content actually displayed on the web page; external domain name link data is collected and all external domain name links contained in the website are saved.
[0053] Take the website see.xidian.edu.cn as an example. First, the program traverses the website folder and the exported database file, uses string regular matching technology to obtain the website's external domain name link and uses https: / / www.xidian.cc / api_url.php as the transit domain name interface. The generated intermediate domain name link corresponds to the external domain name link. The tsv file is as follows: Figure 2 As shown; the page with id 2 in the website is as follows Figure 3 As shown; access the link to display the page as Figure 4 As shown;
[0054] After that, replace the external domain name link of the website. After replacement, the display effect of the intermediate domain name link is as follows Figure 5 After clicking the intermediate domain name link, the browser will first jump to the intermediate domain name link and then automatically jump to the original address.
[0055] In summary, the present invention realizes the replacement of the external domain name link of the website to the trusted intermediate domain name link, realizes the separation operation of the external domain name link and the original website, and verifies the effectiveness of the present invention.
Claims
1. A method for replacing a website external domain name link with a trusted intermediate domain name link, characterized in that: The specific steps include: Step 1: Get the website's external domain name link; Step 2: Generation of intermediate domain name links; Step 3: Replacement of the intermediate domain name link: Replace the website external domain name link obtained in step 1 with the intermediate domain name link generated in step 2 in the form of a transit domain name to become an intermediate trusted domain name link.
2. A method for replacing a website external domain name link with a trusted intermediate domain name link according to claim 1, characterized in that: The specific method of step 1 is: All links of the website content are obtained by searching the exported files of the website database; external domain name link data is collected and all external domain name links contained in the website are saved through regular string matching.
3. A method for replacing a website external domain name link with a trusted intermediate domain name link according to claim 2, characterized in that: The method for collecting external domain name link data in step 1 is: The herf attribute in the tag extracts the domain name link content in the page, and then compares it with the main domain name of the website, using string matching to match all domain name links. Links that do not start with the main domain name are external domain name links of the website, and then all external domain name links contained in the website are saved.
4. A method for replacing a website external domain name link with a trusted intermediate domain name link according to claim 1, characterized in that: The specific method of step 2 is: First, a web server is used in a computer room or cloud server to build the domain name of the transit website, and a function interface is set up at the back end of the transit website as the transit website access interface. Then, according to the website external domain name link obtained in step 1, all external domain name links are numbered starting from 1, and then the transit website access interface is spliced, and the external domain name link number as the Get request parameter forms the intermediate domain name link; then, the external domain name link and the intermediate domain name link are stored in a file or database one by one.
5. A method for replacing a website external domain name link with a trusted intermediate domain name link according to claim 1, characterized in that: The specific method of step 3 is: Replacement of the transit link: For the external domain name links stored in the file, search by traversing the folder where the transit website is located; first read the external domain name link that needs to be replaced from the transit website database, then traverse the folder corresponding to the website that needs to replace the external domain name link, and replace the external domain name link string with the intermediate domain name link string; For external domain name links stored in the database, the external domain name links that need to be replaced are first read from the database of the transit website, and then the content containing the external domain name links is searched in the database in a loop. Then, through string matching operations, the external domain name link string is replaced with the intermediate domain name link string.
6. A system for replacing website external domain name links with trusted intermediate domain name links, characterized in that: include: External domain name link acquisition module: used in step 1 to achieve the acquisition and preservation of external domain name links in the website, and obtain all links of the website content through string matching technology; the program searches the website folder and database to obtain the HTML source code, and obtains the HTML source code of the content actually displayed on the web page; Collect external domain link data and save all external domain links contained in the website; Intermediate domain name link generation module: used for generating the intermediate domain name link in step 2; by building a transit website domain name interface and matching and splicing the external domain name link number, a one-to-one correspondence between the external domain name link and the intermediate domain name link is achieved; Link replacement module: used in step 3, to replace the website external domain name link obtained in step 1 with the transit domain name link generated in step 2 in the form of a transit domain name, to become an intermediate trusted domain name link, thereby realizing the replacement of the external domain name link in the website.
7. A device for replacing a website's external domain name link with a trusted intermediate domain name link, characterized in that: include: Memory for storing computer programs; A processor is used to implement the method of replacing an external domain name link of a website with a trusted intermediate domain name link as described in steps 1 to 3 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the external domain name link of the website can be replaced with a trusted intermediate domain name link based on the method described in steps 1 to 3.
Citation Information
Patent Citations
Method for assessing security of short domain names
CN103905424A
Short domain name link generation method, system and device and storage medium
CN116684384A
Domain name management method and communication terminal equipment
JP2008071266A
