Harmful website detection method, device and system based on improved simhash

Through the improved simhash algorithm and segmented index technology, the problem of difficulty in quickly detecting familial and homologous harmful URLs in the existing technology is solved, and the rapid identification and efficiency improvement of attacker-generated content are achieved.

CN115098853BActive Publication Date: 2024-10-01Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210581241.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2024-10-01
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

Existing technology is difficult to quickly and proactively detect familial and homologous harmful URLs generated in batches by attackers. Traditional methods require a large amount of annotated data and long-term training, and passive analysis and detection cannot cope with dynamically changing domain names and IP-flux technology.

Method used

The improved simhash algorithm is used to quickly identify familial and homologous harmful URLs by calculating the signatures of web page titles and web page text and establishing a high-speed segmented index. It uses word frequency and MD5 hash values ​​to generate feature vectors, and generates signatures after dimensionality reduction. And quickly filter similar web pages through segmented indexing.

Benefits of technology

It realizes the rapid detection and identification of family and homologous harmful URLs generated by attackers, reduces the amount of calculation and noise, improves detection efficiency and time efficiency, and simplifies the similarity comparison process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098853B_ABST
    Figure CN115098853B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and system for detecting harmful web addresses based on improved simhash. The method comprises: obtaining an HTML file of a suspected harmful web page, extracting a web page title and a web page body from the HTML file and performing word segmentation; calculating the word weight and hash value of each word; using the simhash algorithm to calculate the signature of the web page title and the signature of the web page body according to the word weight and the hash value, splicing the two signatures to obtain a web page signature of the suspected harmful web page, recorded as signature A; dividing signature A into a plurality of sub-signature segments of the same length, using a pre-constructed segmentation index to retrieve each sub-signature segment so as to extract a candidate web page signature set having at least one identical sub-signature segment with signature A; calculating the similarity between signature A and each signature B in the candidate web page signature set, and if there is at least one signature B with a similarity value greater than a set threshold, the URL of the suspected harmful web page corresponding to signature A is considered to be a harmful web address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet and cyberspace security technology, in particular to the detection and discovery of familial and homologous harmful URLs on the Internet, and more particularly to a harmful URL detection method, device and system based on improved simhash. Background Art

[0002] Harmful URLs refer to all websites on the Internet that threaten people's identity privacy, property safety, mental health, etc., including not only malicious websites such as Trojan horse websites and phishing websites, but also a large number of black and gray industry websites and websites involving illegal content. Among harmful URLs, in order to avoid being blocked, there are a large number of attackers who use domain name generation algorithms to automatically generate domain names. A large number of harmful URLs are generated by attackers registering a batch of domain names at one time, so they are repeatedly blocked.

[0003] At present, the detection of harmful websites mainly includes: (1) detection of URLs and domain names, and establishment of URL / domain name blacklist and whitelist libraries; in order to evade detection, attackers who generate harmful websites usually use domain name generation algorithms (DGA) to frequently create and register new domain names or dynamically change domain names, and use technologies such as IP-flux to change the resolution relationship between domain names and IP addresses, in order to counter domain name blacklists and heuristic rules and other detection algorithms. (2) Classification model detection based on traditional machine learning or deep learning. (3) DNS detection; among the methods for web page content analysis, most of them use deep learning algorithms to train text classification and image classification models to detect harmful websites. This type of method requires a large amount of labeled data, and the deep model has many parameters and the model training time is long. In the case of the increasingly shortened life cycle of harmful websites, it is difficult to quickly and actively detect and discover family-like and homologous harmful websites with similar content generated by attackers in batches. Among them, the first two detection methods are passive analysis detection, and the third detection method is an active analysis detection method. Summary of the invention

[0004] In order to actively detect and discover family and homologous harmful websites, the present invention provides a harmful website detection method, device and system based on improved simhash, which obtains a web page HTML file and extracts its web page title and web page body from it, uses the web page title and web page body to characterize the web page content, and then establishes a high-speed segmented index by calculating the improved simhash signature of the web page title and web page body, so as to realize rapid detection and identification of family and homologous web pages generated in batches by attackers.

[0005] In a first aspect, the present invention provides a method for detecting harmful websites based on improved simhash, comprising:

[0006] Step 1: Obtain an HTML file of a suspected harmful web page, extract a web page title and a web page body from the HTML file, and perform word segmentation on the web page title and the web page body;

[0007] Step 2: Calculate the vocabulary weight and hash value of each vocabulary;

[0008] Step 3: Calculate the signature of the webpage title and the signature of the webpage body using the simhash algorithm according to the vocabulary weight and the hash value, and concatenate the two signatures to obtain the webpage signature of the suspected harmful webpage, which is recorded as signature A;

[0009] Step 4: Split signature A into several sub-signature segments of the same length, and use the pre-built segment index to search each sub-signature segment to extract a candidate webpage signature set that has at least one sub-signature segment in common with signature A; the candidate webpage signature set includes at least one webpage signature of a known harmful website, recorded as signature B;

[0010] Step 5: Calculate the similarity between signature A and each signature B in the candidate webpage signature set. If there is at least one signature B with a similarity value greater than a set threshold, the URL of the suspected harmful webpage corresponding to signature A is considered to be a harmful URL.

[0011] Furthermore, before step 2, the method further includes: cleaning the word segmentation results to remove text information that cannot reflect the content of the web page.

[0012] Furthermore, the calculation of the vocabulary weight of each vocabulary in step 2 specifically includes:

[0013] For the word segmentation results of web page titles, the word frequency is used as the word weight of each word;

[0014] For the word segmentation results of the webpage body, the word weight of each word is calculated according to formula (1);

[0015]

[0016] Among them, n c and Representing vocabulary c and c respectively i The number of times it appears in the body of the web page, len(c) and len(c i ) are vocabulary c and c i The length of len(d j ) and len(d f ) are the main text of the web page j and d f The total number of characters; ∑len(d j ) and ∑len(d f) are the total number of characters in the text of all web pages and the total number of characters in the text of all web pages containing word c, i represents the word number, and j represents the web page text number.

[0017] Furthermore, calculating the hash value of each word in step 2 specifically includes: using the MD5 hash algorithm to calculate the hash value of each word.

[0018] Furthermore, the calculation process of the signature of the webpage title and the signature of the webpage body in step 3 specifically includes:

[0019] Step A1: Represent the n-bit hash value of each word as an n-dimensional feature vector;

[0020] Step A2: weighting the feature vector of a word using its lexical weight, and fusing the weighted feature vectors of all words to obtain an n-dimensional feature vector of the web page title or web page body;

[0021] Step A3: performing numerical dimension reduction on the element values ​​in the n-dimensional feature vector of the web page title or the web page body;

[0022] Step A4: Represent the n-dimensional feature vector after numerical dimension reduction as an n-bit character string as the signature of the web page title or web page body.

[0023] Furthermore, step A3 specifically includes: if the element value is greater than 0, the value is 1 after dimensionality reduction; if the element value is less than 0, the value is 0 after dimensionality reduction.

[0024] Furthermore, the construction process of the segment index in step 4 specifically includes:

[0025] Split the webpage signatures of all known harmful URLs into several sub-signature segments of the same length;

[0026] Each sub-signature segment is used as a key value, and a list of all webpage signatures containing the key value is used as a value to construct a segment index.

[0027] Furthermore, in step 5, the Hamming distance between the two signatures is used as the similarity between the two signatures.

[0028] In a second aspect, the present invention provides a harmful website detection device based on improved simhash, comprising:

[0029] A web page text processing unit is used to obtain an HTML file of a target web page, extract a web page title and a web page body from the HTML file, and perform word segmentation on the web page title and the web page body; the target web page refers to a web page corresponding to a known harmful URL or a suspected harmful web page;

[0030] The signature generation unit is used to calculate the word weight and hash value of each word; the signature of the webpage title and the signature of the webpage body are calculated by using the simhash algorithm according to the word weight and the hash value, and the two signatures are concatenated to obtain the webpage signature of the target webpage; wherein the webpage signature of the suspected harmful webpage is recorded as signature A, and the webpage signature of the webpage corresponding to the known harmful URL is recorded as signature B;

[0031] An indexing unit, used to divide the signature of the target web page into a plurality of sub-signature segments of the same length; use a pre-built segmented index to search each sub-signature segment of the suspected harmful web page so as to extract a candidate web page signature set having at least one sub-signature segment in common with signature A; the candidate web page signature set includes at least one signature B;

[0032] A similarity calculation unit, used to calculate the similarity between signature A and each signature B in the candidate webpage signature set;

[0033] The output unit is used to mark the URL of the suspected harmful web page corresponding to the signature A as a harmful URL when there is at least one signature B whose similarity value is greater than a set threshold.

[0034] In a third aspect, the present invention provides a harmful website detection system based on improved simhash, comprising: a harmful website data offline storage device, a website data real-time collection device, a data reporting device and the above-mentioned harmful website detection device;

[0035] The harmful website detection device reads known harmful website data from the harmful website data offline storage device to construct a segment index; and receives suspected harmful web page data from the website data real-time collection device to perform harmful website detection, and then outputs the detected harmful website to the data reporting device for it to block the harmful website.

[0036] Beneficial effects of the present invention:

[0037] (1) The present invention utilizes HTML files of known harmful websites and extracts their web page titles and web page texts therefrom. The web page content is characterized by the web page titles and web page texts. Then, a high-speed segmented index is established by calculating the improved simhash signatures of the web page titles and web page texts. The segmented index is then used to realize rapid and active detection and identification of family-like and homologous web pages generated in batches by attackers.

[0038] (2) The hash weight of the simhash algorithm for generating signatures is improved. Compared with the traditional simhash algorithm that simply uses word frequency as the weight of the hash value, the present invention uses the improved TF-IDF to calculate the vocabulary weight, reducing the noise of non-important words. In addition, the keywords of the web page body are selected by the vocabulary weight, and the signature of the web page body is generated according to the keywords, and then combined with the web page title to jointly represent the web page content, which greatly reduces the amount of calculation in the signature generation process and further reduces the noise of non-important words.

[0039] (3) The keywords extracted from the web page title and the web page body are respectively generated into two signature values ​​using the improved simhash algorithm and merged into a new signature, which converts the similarity of the text into the similarity between binary strings composed of 0 and 1, simplifying the comparison process.

[0040] (4) By segmenting the signature and creating an index, we can quickly filter out candidate web pages that may be similar, thereby improving time efficiency and reducing computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of a harmful website detection method based on improved simhash provided by an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a process for obtaining a candidate webpage signature set by using segmented index retrieval provided by an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of the structure of a harmful website detection device based on improved simhash provided by an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of the structure of a harmful website detection system based on improved simhash provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all 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.

[0046] Example 1

[0047] like Figure 1 As shown, the embodiment of the present invention provides a harmful website detection method based on improved simhash, comprising the following steps:

[0048] S101: Obtaining an HTML file of a suspected harmful web page, extracting a web page title and a web page body from the HTML file, and performing word segmentation on the web page title and the web page body;

[0049] Specifically, the tags in the HTML file of the web page are removed, only the text content information is retained, and the text content information is divided into two parts: the web page title and the web page body.

[0050] In order to reduce the amount of calculation and avoid the introduction of noise, after word segmentation, the word segmentation results are also cleaned to remove text information that cannot reflect the content of the web page. For example, punctuation marks, special characters and stop words are removed, and the text at the bottom of the web page is removed in consideration of the fact that the bottom of the web page usually contains information such as website registration and does not reflect the content of the web page.

[0051] S102: Calculate the vocabulary weight and hash value of each vocabulary;

[0052] As an implementation method, calculating the vocabulary weight of each word specifically includes: for the word segmentation result of the web page title, using the word frequency as the vocabulary weight of each word; for the word segmentation result of the web page body, calculating the vocabulary weight of each word according to formula (1);

[0053]

[0054] Among them, n c and Representing vocabulary c and c respectively i The number of times it appears in the body of the web page, len(c) and len(c i ) are vocabulary c and c i The length of len(d j ) and len(d f ) are the main text of the web page j and d f The total number of characters; ∑len(d j ) and ∑len(d f ) are the total number of characters in the text of all web pages and the total number of characters in the text of all web pages containing word c, i represents the word number, and j represents the web page text number.

[0055] The above formula (1) is an improvement of the traditional TF-IDF algorithm in the embodiment of the present invention. The traditional inverse text frequency IDF believes that the importance of words appearing in multiple texts is not as good as those appearing in a few texts. The traditional algorithm is statistically based on documents and does not consider the length of the text. Therefore, the embodiment of the present invention introduces the text length so that the weight can more accurately reflect the importance of the word. In addition, the embodiment of the present invention also takes into account that the length of the word also has a certain influence on its importance. The longer the length of a single word obtained after word segmentation, the more information it usually contains. Therefore, the word length is also introduced in the improved algorithm. By introducing the word length and text length, the noise of non-important words is reduced.

[0056] As an implementable method, the MD5 hash algorithm is used to calculate the hash value of each word.

[0057] S103: Calculate the signature of the webpage title and the signature of the webpage body using the simhash algorithm according to the vocabulary weight and the hash value, and concatenate the two signatures to obtain the webpage signature of the suspected harmful webpage, which is recorded as signature A;

[0058] This step calculates signature values ​​for the keywords extracted from the web page title and the web page body respectively, and then combines the two to generate a new signature value, which more comprehensively represents the web page content information.

[0059] As an implementable method, the calculation process of the signature of the webpage title is similar to the calculation process of the signature of the webpage body. Taking the calculation process of the signature of the webpage title as an example, it specifically includes:

[0060] Step A1: Represent the n-bit hash value of each word as an n-dimensional feature vector;

[0061] Step A2: weighting the feature vector of a word using its lexical weight, and fusing the weighted feature vectors of all words to obtain an n-dimensional feature vector of the webpage title;

[0062] In the embodiment of the present invention, the weighted feature vectors of all words are added and fused, wherein the word frequency of a word is directly used as the word weight of the word.

[0063] Step A3: performing numerical dimension reduction on the element values ​​in the n-dimensional feature vector of the webpage title;

[0064] In the embodiment of the present invention, the process of numerical dimension reduction specifically includes: if the value of an element is greater than 0, the numerical value is 1 after dimension reduction; if the value of an element is less than 0, the numerical value is 0 after dimension reduction.

[0065] Step A4: Represent the n-dimensional feature vector after numerical dimension reduction as an n-bit string as the signature of the web page title.

[0066] Similarly, when calculating the signature of the web page body, in order to reduce the amount of calculation and avoid the introduction of noise, the keywords of the web page body are selected as the vocabulary for the subsequent signature calculation, and the weight value calculated by the above formula (1) is used as the vocabulary weight of the keyword; the rest of the process refers to the signature calculation process of the web page title and will not be repeated here.

[0067] When selecting keywords for the body of a web page, as an implementable method, keywords for the body of the web page are selected based on word weights; for example, after calculating the word weight of each word, the words are sorted in descending order according to the word weights, and then a certain number of words (e.g., Top 100) are selected as keywords.

[0068] S104: Split signature A into a number of sub-signature segments of the same length, and use a pre-built segment index to search each sub-signature segment to extract a candidate webpage signature set that has at least one sub-signature segment in common with signature A; the candidate webpage signature set includes at least one webpage signature of a known harmful website, recorded as signature B;

[0069] As an implementation method, the process of constructing the segmented index specifically includes: dividing the webpage signatures of all known harmful URLs into several sub-signature segments of the same length; taking each sub-signature segment as a key value and a list of all webpage signatures containing the key value as a value, constructing a segmented index. The process of generating the webpage signature of the known harmful URL is consistent with the process of generating the webpage signature of the suspected harmful webpage, which will not be repeated here.

[0070] The process of obtaining the candidate webpage signature set using segmented index retrieval is as follows: Figure 2 As shown. Set the webpage signature of the suspected harmful webpage to "12345678aaaabbbb", and divide the webpage signature into four sub-signature segments, namely: "1234", "5678", "aaaa" and "bbbb"; then search the above four sub-signature segments in the segment index respectively, and you can retrieve a candidate webpage signature set containing the webpage signatures of four known harmful URLs, namely "123456780scxxddd", "dddd123456780saa", "1as456780scxxddd" and "dddd1as456780saa".

[0071] S105: Calculate the similarity between signature A and each signature B in the candidate web page signature set. If there is at least one signature B whose similarity value is greater than a set threshold, the URL of the suspected harmful web page corresponding to signature A is considered to be a harmful URL. At this time, the URL corresponding to signature B that meets the threshold and the URL corresponding to signature A are homologous / family URLs.

[0072] As an implementation method, the Hamming distance between two signatures is used as the similarity between the two signatures. The calculation process of the Hamming distance is specifically: the two signature values ​​are bitwise XORed, and the number of bits with the XOR result of 1 is recorded as the Hamming distance. In this embodiment, the setting threshold of the Hamming distance is set to 3.

[0073] For example, based on the above example, the Hamming distances between the webpage signature "12345678aaaabbbb" and the four signatures "123456780scxxddd", "dddd123456780saa", "1as456780scxxddd" and "dddd1as456780saa" are calculated respectively.

[0074] The embodiment of the present invention first uses the web page title and web page text extracted from the HTML file of the web page, and then uses the simhash algorithm with an improved hash weight calculation method to reduce the dimension of the similarity calculation problem of the web page text to a low-dimensional space, which is converted into a Hamming distance calculation of the string. At the same time, the segmented index is used to quickly screen out candidate web pages and then perform similarity calculation, which greatly improves the calculation efficiency and realizes the rapid detection and discovery of web pages with highly similar and homologous content based on known harmful URLs.

[0075] Example 2

[0076] like Figure 3 As shown, an embodiment of the present invention provides a harmful website detection device based on improved simhash, including a webpage text processing unit, a signature generation unit, an index unit, a similarity calculation unit and an output unit;

[0077] The web page text processing unit is used to obtain the HTML file of the target web page, extract the web page title and the web page body from the HTML file, and perform word segmentation on the web page title and the web page body; the target web page refers to the web page corresponding to the known harmful website or the suspected harmful web page. The signature generation unit is used to calculate the vocabulary weight and hash value of each word; the signature of the web page title and the signature of the web page body are calculated using the simhash algorithm according to the vocabulary weight and the hash value, and the two signatures are spliced ​​to obtain the web page signature of the target web page; wherein the web page signature of the suspected harmful web page is recorded as signature A, and the web page signature of the web page corresponding to the known harmful website is recorded as signature B. The index unit is used to divide the signature of the target web page into several sub-signature segments of the same length; each sub-signature segment of the suspected harmful web page is retrieved using the pre-constructed segmented index to extract a candidate web page signature set that has at least one identical sub-signature segment with signature A; the candidate web page signature set includes at least one signature B. The similarity calculation unit is used to calculate the similarity between signature A and each signature B in the candidate web page signature set. The output unit is used to mark the URL of the suspected harmful web page corresponding to the signature A as a harmful URL when there is at least one signature B whose similarity value is greater than a set threshold.

[0078] As an implementation method, the index unit is also used to construct a segmented index, specifically including: dividing the webpage signatures of all known harmful URLs into a number of sub-signature segments of the same length; taking each sub-signature segment as a key value and a list of all webpage signatures containing the key value as a value, to construct a segmented index. The signature generation unit is also used to save the correspondence between the webpage signature and the URL.

[0079] It should be noted that the harmful website detection device based on improved simhash provided in the embodiment of the present invention is to realize the above method embodiment. Its specific functions can be referred to the above method embodiment and will not be described in detail here.

[0080] Example 3

[0081] like Figure 4 As shown, the embodiment of the present invention also provides a harmful website detection system based on improved simhash, including a harmful website data offline storage device, a website data real-time collection device, a data reporting device and a harmful website detection device;

[0082] The harmful website detection device reads known harmful website data from the harmful website data offline storage device to construct a segment index; and receives suspected harmful web page data from the website data real-time collection device to perform harmful website detection, and then outputs the detected harmful website to the data reporting device for it to block the harmful website.

[0083] As an implementable method, the harmful website detection system further includes an index storage device. Thus, the segment index constructed by the harmful website detection device can be stored in the local terminal of the harmful website detection device or in an external index storage device.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A harmful website detection method based on improved simhash, characterized in that: include: Step 1: Obtain an HTML file of a suspected harmful web page, extract a web page title and a web page body from the HTML file, and perform word segmentation on the web page title and the web page body; Step 2: Calculate the vocabulary weight and hash value of each vocabulary; Step 3: Calculate the signature of the webpage title and the signature of the webpage body using the simhash algorithm according to the vocabulary weight and the hash value, and concatenate the two signatures to obtain the webpage signature of the suspected harmful webpage, which is recorded as signature A; Step 4: Split signature A into several sub-signature segments of the same length, and use the pre-built segment index to search each sub-signature segment to extract a candidate webpage signature set that has at least one sub-signature segment in common with signature A; the candidate webpage signature set includes at least one webpage signature of a known harmful website, recorded as signature B; Step 5: Calculate the similarity between signature A and each signature B in the candidate webpage signature set. If there is at least one signature B with a similarity value greater than a set threshold, the URL of the suspected harmful webpage corresponding to signature A is considered to be a harmful URL.

2. The harmful website detection method based on improved simhash according to claim 1 is characterized in that: Before step 2, the method further includes: cleaning the word segmentation results to remove text information that cannot reflect the content of the web page.

3. The harmful website detection method based on improved simhash according to claim 1 is characterized in that: The calculation of the vocabulary weight of each vocabulary in step 2 specifically includes: For the word segmentation results of web page titles, the word frequency is used as the word weight of each word; For the word segmentation results of the webpage body, the word weight of each word is calculated according to formula (1); Among them, n c and Representing vocabulary c and c respectively i The number of times it appears in the body of the web page, len(c) and len(c i ) are vocabulary c and c i The length of len(d j ) and len(d f ) are the main text of the web page j and d f The total number of characters; ∑len(d j ) and ∑len(d f ) are the total number of characters in the text of all web pages and the total number of characters in the text of all web pages containing word c, i represents the word number, and j represents the web page text number.

4. The harmful website detection method based on improved simhash according to claim 1 is characterized in that: Calculating the hash value of each word in step 2 specifically includes: using the MD5 hash algorithm to calculate the hash value of each word.

5. The harmful website detection method based on improved simhash according to claim 1 is characterized in that: The calculation process of the signature of the web page title and the signature of the web page body in step 3 specifically includes: Step A1: Represent the n-bit hash value of each word as an n-dimensional feature vector; Step A2: weighting the feature vector of a word using its lexical weight, and fusing the weighted feature vectors of all words to obtain an n-dimensional feature vector of the web page title or web page body; Step A3: performing numerical dimension reduction on the element values ​​in the n-dimensional feature vector of the web page title or the web page body; Step A4: Represent the n-dimensional feature vector after numerical dimension reduction as an n-bit character string as the signature of the web page title or web page body.

6. The harmful website detection method based on improved simhash according to claim 5 is characterized in that: Step A3 specifically includes: if the element value is greater than 0, the value is 1 after dimensionality reduction; if the element value is less than 0, the value is 0 after dimensionality reduction.

7. The harmful website detection method based on improved simhash according to claim 1 is characterized in that: The process of constructing the segment index in step 4 specifically includes: Split the webpage signatures of all known harmful URLs into several sub-signature segments of the same length; A segment index is constructed using each sub-signature segment as a key value and a list of all web page signatures containing the key value as a value.

8. The harmful website detection method based on improved simhash according to claim 1, characterized in that: In step 5, the Hamming distance between the two signatures is used as the similarity between the two signatures.

9. A harmful website detection device based on improved simhash, characterized in that: include: A web page text processing unit is used to obtain an HTML file of a target web page, extract a web page title and a web page body from the HTML file, and perform word segmentation on the web page title and the web page body; the target web page refers to a web page corresponding to a known harmful URL or a suspected harmful web page; The signature generation unit is used to calculate the word weight and hash value of each word; the signature of the webpage title and the signature of the webpage body are calculated by using the simhash algorithm according to the word weight and the hash value, and the two signatures are concatenated to obtain the webpage signature of the target webpage; wherein the webpage signature of the suspected harmful webpage is recorded as signature A, and the webpage signature of the webpage corresponding to the known harmful URL is recorded as signature B; An indexing unit, used to divide the signature of the target web page into a plurality of sub-signature segments of the same length; use a pre-built segmented index to search each sub-signature segment of the suspected harmful web page so as to extract a candidate web page signature set having at least one sub-signature segment in common with signature A; the candidate web page signature set includes at least one signature B; A similarity calculation unit, used to calculate the similarity between signature A and each signature B in the candidate webpage signature set; The output unit is used to mark the URL of the suspected harmful web page corresponding to the signature A as a harmful URL when there is at least one signature B whose similarity value is greater than a set threshold.

10. The harmful website detection system based on improved simhash is characterized by: include: Offline storage device for harmful website data, real-time collection device for website data, data reporting device and harmful website detection device as claimed in claim 9; The harmful website detection device reads the known harmful website data from the harmful website data offline storage device to construct a segment index; The device receives suspected harmful web page data from the real-time URL data collection device to detect harmful URLs, and then outputs the detected harmful URLs to the data reporting device for blocking the harmful URLs.