Malicious website identification method, device and equipment and readable medium

By matching the website to be detected with the website blacklist, search results and rule base, and using the prediction model to identify malicious websites, the problem of low malicious website detection efficiency in the existing technology is solved, and efficient and accurate malicious website identification is achieved.

CN118869232APending Publication Date: 2024-10-29NAT COMPUTER NETWORK & INFORMATION SECURITY MANAGEMENT CENT ZHEJIANG BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410515267.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing technologies are inefficient in detecting unknown malicious websites, are difficult to identify quickly, and cannot effectively respond to the surge in the number of malicious websites, threatening information security and the network environment.

Method used

By matching the website to be detected with the preset website blacklist, the unmatched websites are retrieved by search engines. If they are not matched, their uniform resource locators are segmented and reorganized to determine whether the feature fields meet the rules in the rule base. And input the feature field into the pre-trained target prediction model to output the probability of malicious website, and combine blacklist, search, feature extraction and machine learning model for multi-stage identification.

Benefits of technology

It improves the efficiency and accuracy of identifying malicious websites, reduces misjudgments and false negatives, achieves efficient and accurate identification of malicious websites, and enhances the comprehensiveness and credibility of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869232A_ABST
    Figure CN118869232A_ABST
Patent Text Reader

Abstract

The invention discloses a malicious website identification method, device and equipment and a readable medium, and is applied to the technical field of information security. After the to-be-detected website is determined, the to-be-detected website is matched and compared with a preset website blacklist, if the same website is not matched in the website blacklist, a search engine is called to search the to-be-detected website, the to-be-detected website is matched and compared with a search result, and if the same website is not matched in the search result, the to-be-detected website is searched for the to-be-detected website. If yes, segmenting and recombining the uniform resource locator of the website to be detected to obtain a plurality of feature fields, determining whether each feature field meets rules in a preset rule base or not, if the number of the rules met by all the feature fields does not reach a preset number, inputting all the feature fields into a target prediction model, and outputting the malicious website probability, and if the probability condition is met, determining that the to-be-detected website is a malicious website. Therefore, according to the scheme, the technical difficulty of website recognition is increased, the malicious website ending process is recognized, and the recognition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a method, device, equipment and readable medium for identifying malicious websites. Background Art

[0002] In today's era of rapid Internet development, websites, as a basic component of the Internet, carry multiple functions such as information release, social interaction, and e-commerce, which have a profound impact on the lifestyle of netizens and the country's social and economic development. However, with the surge in the number of Internet users and the rapid development of network technology, the number of malicious websites is also increasing sharply. These websites not only infringe on the information security and property security of users, but also seriously damage the network environment and threaten social public order.

[0003] Malicious websites are an important means of network attack. With the continuous development of Internet technology, the cost of generating malicious websites is getting lower and lower, and the scale is constantly expanding, making it increasingly difficult to detect malicious websites. The demand for detecting malicious websites is also increasing.

[0004] However, the existing solutions for detecting unknown malicious websites take a long time and are inefficient, and there is an urgent need for an efficient and accurate method for identifying malicious websites. Summary of the invention

[0005] In view of this, the purpose of the present application is to propose a malicious website identification method, device, equipment and readable medium to improve the efficiency of malicious website identification.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, the present application provides a method for identifying malicious websites, comprising:

[0008] Determine a website to be detected, and compare the website to be detected with a preset website blacklist;

[0009] If the website to be detected does not match the same website in the website blacklist, calling a search engine to search for the website to be detected, and matching and comparing the website to be detected with the search results obtained by the search engine;

[0010] If the website to be detected does not match the same website in the search results, the uniform resource locator of the website to be detected is segmented and reorganized to obtain multiple feature fields, and it is determined whether each feature field satisfies the rules in the preset rule library;

[0011] If the number of rules satisfied by all feature fields does not reach the preset number, all feature fields are input into the pre-trained target prediction model and the probability of malicious website is output;

[0012] If the malicious website probability is greater than or equal to a preset malicious website probability, the website to be detected is determined to be a malicious website.

[0013] Optionally, the method further includes:

[0014] If the website to be detected matches the same website in the search results, it is determined that the website to be detected is a legitimate website; or,

[0015] If the malicious website probability is less than a preset malicious website probability, the website to be detected is determined to be a legitimate website.

[0016] Optionally, the method further includes:

[0017] If the website to be detected matches the same website in the website blacklist, the website to be detected is determined to be a malicious website; or,

[0018] If the number of rules satisfied by all feature fields reaches a preset number, it is determined that the website to be detected is a malicious website.

[0019] Optionally, the segmenting and reorganizing the uniform resource locator of the website to be detected to obtain a plurality of characteristic fields, determining whether each characteristic field satisfies a rule in a preset rule library, and if the number of rules satisfied by each characteristic field reaches a preset number, determining that the website to be detected is a malicious website includes:

[0020] Performing character segmentation on the URL of the website to be detected based on at least two segmentation methods, and reorganizing the segmented characters to obtain at least two groups of feature field groups, wherein the segmentation rules adopted by different segmentation methods are different, each group of feature field groups corresponds to one segmentation method, and each group of feature field groups includes multiple feature fields;

[0021] Determine whether each feature field in each feature field group satisfies the rules in the preset rule base;

[0022] If the number of rules satisfied by all characteristic fields in any set of characteristic field groups reaches a preset number, it is determined that the website to be detected is a malicious website.

[0023] Optionally, the step of inputting the feature field corresponding to the website to be detected into a pre-trained target prediction model and outputting the probability of a malicious website includes:

[0024] Each feature field is input into a pre-trained target prediction model, website features of the website to be detected are extracted, the website features are converted into feature vectors, and the probability of malicious websites is calculated and output based on the feature vectors.

[0025] Optionally, the training process of the target prediction model includes:

[0026] Constructing an initial target prediction model;

[0027] Obtaining original sample website data, and dividing the original sample website data into training sample website data and testing sample website data;

[0028] The initial target prediction model is iteratively trained using the training sample website data, and the initial target prediction model is tested using the test sample website data. If the test result reaches a preset cutoff condition, the iterative training of the initial target prediction model is stopped to obtain the target prediction model.

[0029] Optionally, the method further includes:

[0030] When it is determined that the type of the website to be detected is a malicious website, the attribute data of the website to be detected is obtained, and the website to be detected, the attribute data, and the corresponding relationship between the website to be detected and the attribute data are stored in a preset website blacklist, wherein the attribute data includes at least one of the website title, web page text content, website source code, website domain name, and website domain name system service information.

[0031] In a second aspect, the present application provides a malicious website identification device, comprising:

[0032] A blacklist comparison module is used to determine a website to be detected and to match and compare the website to be detected with a preset website blacklist;

[0033] A search and comparison module is used to call a search engine to search for the website to be detected if the website to be detected does not match the same website in the website blacklist, and to match and compare the website to be detected with the search results obtained by the search engine;

[0034] A rule judgment module, for, if the website to be detected does not match the same website in the search results, segmenting and reorganizing the uniform resource locator of the website to be detected to obtain multiple feature fields, and determining whether each feature field satisfies a rule in a preset rule library;

[0035] A probability calculation module, for inputting all feature fields into a pre-trained target prediction model and outputting a malicious website probability if the number of rules satisfied by all feature fields does not reach a preset number;

[0036] The determination module is used to determine that the website to be detected is a malicious website if the malicious website probability is greater than or equal to a preset malicious website probability.

[0037] Optionally, the determination module is further used to: if the website to be detected matches the same website in the search results, determine that the website to be detected is a legitimate website; or if the probability of the malicious website is less than a preset malicious website probability, determine that the website to be detected is a legitimate website.

[0038] Optionally, the determination module is also used to: if the website to be detected matches the same website in the website blacklist, determine that the website to be detected is a malicious website; or, if the number of rules satisfied by all feature fields reaches a preset number, determine that the website to be detected is a malicious website.

[0039] Optionally, the rule judgment module is specifically used to: perform character segmentation on the uniform resource locator of the website to be detected based on at least two segmentation methods, and reorganize the segmented characters to obtain at least two groups of feature field groups, wherein the segmentation rules adopted by different segmentation methods are different, each group of feature field groups corresponds to a segmentation method, and each group of feature field groups includes multiple feature fields; determine whether each feature field in each group of feature field groups satisfies the rules in the preset rule library;

[0040] Optionally, the determination module is specifically used to: if the number of rules satisfied by all characteristic fields in any set of characteristic field groups reaches a preset number, determine that the website to be detected is a malicious website.

[0041] Optionally, the probability calculation module is specifically used to: input each feature field into a pre-trained target prediction model, extract website features of the website to be detected, convert the website features into feature vectors, and calculate and output the probability of a malicious website based on the feature vectors.

[0042] Optionally, the device further comprises:

[0043] A construction module, used to construct an initial target prediction model;

[0044] An original sample acquisition module is used to acquire original sample website data and divide the original sample website data into training sample website data and test sample website data;

[0045] An iteration module is used to iteratively train the initial target prediction model using the training sample website data, and to test the initial target prediction model using the test sample website data. If the test result reaches a preset cutoff condition, the iterative training of the initial target prediction model is stopped to obtain the target prediction model.

[0046] Optionally, the device further comprises:

[0047] The storage module is used to obtain the attribute data of the website to be detected when it is determined that the type of the website to be detected is a malicious website, and store the website to be detected, the attribute data and the corresponding relationship between the website to be detected and the attribute data in a preset website blacklist, wherein the attribute data includes at least one of the website title, web page text content, website source code, website domain name, and website domain name system service information.

[0048] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first aspects is implemented.

[0049] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to execute any method as described in the first aspect.

[0050] As can be seen from the above, the present application discloses a method, device, equipment and readable medium for identifying malicious websites. After determining the website to be detected, a match is made with a preset website blacklist. If the same website is not matched in the website blacklist, a search engine is called to search for the website to be detected, and the website to be detected is matched and compared with the search results. If the same website is not matched in the search results, the uniform resource locator of the website to be detected is segmented and reorganized to obtain multiple feature fields, and it is determined whether each feature field meets the rules in the preset rule library. If the number of rules satisfied by all feature fields does not reach the preset number, all feature fields are input into the target prediction model, and the probability of malicious websites is output. If the probability condition is met, the website to be detected is determined to be a malicious website. Therefore, this scheme increases the difficulty of website identification technology from low to high, identifies malicious websites and ends the process, and speeds up the identification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 A flowchart of a method for identifying malicious websites provided in an embodiment of the present application;

[0053] Figure 2 A flowchart of another malicious website identification method provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of a process flow of a target prediction model training process provided in an embodiment of the present application;

[0055] Figure 4 A schematic diagram of a malicious website identification device provided in an embodiment of the present application;

[0056] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment. DETAILED DESCRIPTION

[0057] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0058] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0059] As described in the background technology, in today's era of rapid development of the Internet, websites, as a basic component of the Internet, carry multiple functions such as information release, social interaction, and e-commerce, which have a profound impact on the lifestyle of netizens and the country's social and economic development. However, with the surge in the number of Internet users and the rapid development of network technology, the number of malicious websites is also increasing sharply. These websites not only infringe on the information security and property security of users, but also seriously damage the network environment and threaten social public order.

[0060] Malicious websites are an important means of network attack. With the continuous development of Internet technology, the cost of generating malicious websites is getting lower and lower, and the scale is constantly expanding, making it increasingly difficult to detect malicious websites. The demand for detecting malicious websites is also increasing.

[0061] However, the existing solutions for detecting unknown malicious websites take a long time and are inefficient, and there is an urgent need for an efficient and accurate method for identifying malicious websites.

[0062] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0063] Figure 1 A schematic diagram of a malicious website identification method provided in an embodiment of the present application is shown. Figure 1 As shown, the steps are as follows:

[0064] S101: Determine a website to be detected, and compare the website to be detected with a preset website blacklist.

[0065] The website to be detected refers to a website that needs to be detected and analyzed for maliciousness. A malicious website refers to a website. A malicious website blacklist refers to a list collected manually for storing content related to malicious websites. As a possible implementation method, the malicious website blacklist may include data such as the URL, website content, and webpage source code of the malicious website. The website blacklist includes at least one malicious website that is pre-marked.

[0066] As a possible implementation manner, if the website to be detected matches the same website in the website blacklist, it is determined that the website to be detected is a malicious website.

[0067] S102: If the website to be detected does not match the same website in the website blacklist, a search engine is called to search for the website to be detected, and the website to be detected is matched and compared with the search results obtained by the search engine.

[0068] The search engine refers to a software system that can search for content input by a user and display the search results most relevant to the content input by the user according to a sorting algorithm. The content related to the website to be detected that the search engine searches can be one and / or more.

[0069] As a possible implementation manner, if the website to be detected matches the same website in the search results, it is determined that the website to be detected is a legitimate website.

[0070] S103: If the website to be detected does not match the same website in the search results, the uniform resource locator of the website to be detected is segmented and reorganized to obtain multiple feature fields, and it is determined whether each feature field satisfies a rule in a preset rule library.

[0071] Uniform Resource Locator (URL) is an identification method used to fully describe the address of web pages and other resources on the Internet. It usually consists of protocols, domain names or IP addresses, port numbers, paths, etc. Through fine-grained feature extraction and rule verification, the sensitivity and accuracy of malicious websites are enhanced, and malicious behaviors hidden in complex URL structures are effectively identified.

[0072] S104: If the number of rules satisfied by all feature fields does not reach a preset number, all feature fields are input into a pre-trained target prediction model, and the probability of a malicious website is output.

[0073] Through comprehensive analysis of machine learning models, complex or obfuscated malicious websites can be judged more accurately, improving the accuracy and reliability of detection.

[0074] S105: If the malicious website probability is greater than or equal to a preset malicious website probability, determining that the website to be detected is a malicious website.

[0075] The probability of malicious websites output by the machine learning model is compared with the preset malicious threshold. If the probability exceeds or equals the threshold, the website is judged to be a malicious website. By setting the threshold to judge malicious websites, the detection results are more objective and controllable, reducing the possibility of misjudgment and missed reports, and improving the accuracy and credibility of the overall detection.

[0076] It can be seen that this scheme provides a multi-stage malicious website identification method, which combines blacklist matching, search engine retrieval, feature extraction and verification, and machine learning model evaluation to achieve efficient and accurate identification of malicious websites. Compared with traditional methods, this method not only improves the comprehensiveness and accuracy of detection, but also effectively reduces false positives and false negatives, and speeds up identification efficiency.

[0077] Figure 2 A schematic diagram of another malicious website identification method provided in an embodiment of the present application is shown. Figure 2 As shown, the steps are as follows:

[0078] S201: Determine a website to be detected, and compare the website to be detected with a preset website blacklist.

[0079] S202: If the website to be detected matches the same website in the website blacklist, it is determined that the website to be detected is a malicious website.

[0080] S203: If the website to be detected does not match the same website in the website blacklist, a search engine is called to search for the website to be detected, and the website to be detected is matched and compared with the search results obtained by the search engine.

[0081] S204: If the website to be detected matches the same website in the search results, it is determined that the website to be detected is a legitimate website.

[0082] S205: If the website to be detected does not match the same website in the search results, character segmentation is performed on the uniform resource locator of the website to be detected based on at least two segmentation methods, and the segmented characters are reorganized to obtain at least two groups of feature field groups, and it is determined whether each feature field in each group of feature field groups satisfies the rules in a preset rule library.

[0083] Among them, the segmentation rules adopted by different segmentation methods are all different, each feature field group corresponds to a segmentation method, and each feature field group includes multiple feature fields.

[0084] Uniform Resource Locator (URL) is an identification method used to completely describe the address of web pages and other resources on the Internet. It is usually composed of a protocol, a domain name or an IP address, a port number, a path, etc. Here, examples of segmentation methods are given. It should be noted that these examples are not intended to limit the scope of protection of this application.

[0085] Method 1: Split the URL with any non-alphanumeric characters excluding '_' and '-'.

[0086] Method 2: Split the URL with any non-alphanumeric characters including '_' and '-'.

[0087] Method 3: Use ' / ' and '\' as the split points to split the URL.

[0088] Examples of different URL segmentation and reorganization methods are:

[0089] Method 1: Split 'http: / / www.example.com / product / item1' into ['http:',",'www.example.com','product','item1'].

[0090] Method 2: Split 'http: / / www.example.com / product / item1' into ['http:',",'www.example.com','product','item1'].

[0091] Method 3: Split http: / / www.example-data.com / product / item_1' into ['http:',",'www','example','data.com','product','item','1'].

[0092] Here, examples are given for the rules in the preset rule library. It should be noted that the examples herein are not intended to limit the protection scope of the present application.

[0093] Rule 1: After using method 1 to segment the URL of the website to be detected, if malicious keywords are detected in the path part and these keywords are inconsistent with the second-level or third-level domain name in the domain name, it is determined that the current website may be a malicious website.

[0094] Rule 2: After segmenting the URL of the website to be detected using method 1, if two or more different malicious attack keywords are found in the same URL string of the website to be detected, it is determined that the current website may be a malicious website.

[0095] Rule 3: After using method 1 to segment the URL of the website to be detected, even if malicious keywords are not detected initially, if malicious keywords can be detected after removing the numbers in the string, it is determined that the current website may be a malicious website.

[0096] Rule 4: When analyzing the URL of the website to be detected, if no malicious keywords are found after the initial segmentation using method 1, a more in-depth analysis strategy is adopted. This strategy includes two key steps: first, the URL of the website to be detected is divided into multiple parts according to method 2; second, method 3 is applied to each part for further segmentation, while excluding all top-level domain-related words in the process. After performing these operations, the string fragments at consecutive index positions in each part are integrated to construct a new URL vocabulary set. In this newly constructed vocabulary set, if malicious target keywords or their substrings are found, the website is judged to be a malicious website.

[0097] Rule 5: If the domain name is an explicit IP address in dotted decimal, hexadecimal, or octal format, such as "192.0.2.1", "0xC0.0x00.0x02.0x01", or "0300.0000.0002.0001", that is, an IP address in any format is used as the domain name of the URL of the website to be detected, the website is determined to be a possible malicious website.

[0098] Rule 6: If a protocol field string is found in the non-protocol field part (domain name, path, etc.) of the URL of the website to be detected, it is determined that the website may be a malicious website.

[0099] Rule 7: Use methods 2 and 3 to segment the URL of the website to be detected. Due to the special nature of the top-level domain name, if the top-level domain appears at any position other than the end of the entire domain name, it is determined that the website may be a malicious website.

[0100] Rule 8: Use method 2 to segment the URL of the website to be detected and parse out all domain name parts of the URL of the website to be detected. Each character needs to be checked to determine if there is any confusion or replacement. This includes comparing each character with its standard form to detect potential confusion. For example, the number "0" may replace the letter "o", or special symbols such as "$" may replace the letter "s". Use the Levenshtein distance to compare the current parsed domain name with the contents of the legitimate domain name list. When the calculated result exceeds 0.7 and is less than 1.0, it means that the current domain name has imitated a legitimate domain name by changing individual characters, so it is determined that the URL may be a malicious URL.

[0101] S206: If the number of rules satisfied by all the characteristic fields in any set of characteristic field groups reaches a preset number, it is determined that the website to be detected is a malicious website.

[0102] If the reorganized URL of the website to be detected successfully matches any number of rules in the heuristic rules, it is determined that the website to be detected is a malicious website and uses obfuscation technology;

[0103] If the reorganized URL of the website to be detected successfully matches a preset number of rules in the heuristic rules, it is determined that the website to be detected is a malicious website.

[0104] S207: If the number of rules satisfied by all feature fields in any set of feature field groups does not reach a preset number, each feature field is input into a pre-trained target prediction model, the website features of the website to be detected are extracted, the website features are converted into feature vectors, and the probability of a malicious website is calculated and output based on the feature vectors.

[0105] As a possible implementation method, before inputting the feature field corresponding to the website to be detected into the pre-trained target prediction model, it also includes: preprocessing the feature field corresponding to the website to be detected, wherein the preprocessing at least includes removing null values ​​and data standardization.

[0106] Extracting the website features of the website to be detected includes extracting information that can represent the website features, such as the website title, website text content, webpage source code, website domain name, website domain name system service information, etc., and then converting the website features into feature vectors. For example, if the website's feature vector is [feature 1, feature 2], feature 1 is whether it contains a certain keyword, and feature 2 is whether the domain name in the website domain name information has survived for more than 1 year. If so, the corresponding feature flag is set to 1, otherwise it is set to 0. Finally, the probability of a malicious website is calculated and output based on the feature vector.

[0107] S208: If the malicious website probability is greater than or equal to a preset malicious website probability, then determining that the website to be detected is a malicious website.

[0108] S209: If the malicious website probability is less than a preset malicious website probability, determining that the website to be detected is a legitimate website.

[0109] When the malicious website blacklist, search engine and rule confirmation are unable to detect the website to be detected, the logistic regression model is used to further predict the security of the website to be detected, which reduces labor costs and improves the efficiency and accuracy of detection.

[0110] As a possible implementation manner, the method further includes:

[0111] When it is determined that the type of the website to be detected is a malicious website, the attribute data of the website to be detected is obtained, and the website to be detected, the attribute data, and the corresponding relationship between the website to be detected and the attribute data are stored in a preset website blacklist, wherein the attribute data includes at least one of the website title, web page text content, website source code, website domain name, and website domain name system service information.

[0112] When website A is determined to be a malicious website, website A is sent to the website extraction program to crawl website A's website title, webpage text content, website source code, website domain name, website domain name system service information and other data. The crawled data is sent to the malicious website blacklist together with the website to be detected, and the malicious website blacklist is updated. The website extraction program crawls data of the determined malicious website, thereby updating the malicious website blacklist and enriching the data of the malicious website blacklist.

[0113] As a possible implementation manner, the method further includes:

[0114] The identification result that the website to be detected is a malicious website is sent to a preset terminal, so that the terminal displays the identification result of the website to be detected.

[0115] Figure 3 A flow chart of a training process of a target prediction model provided in an embodiment of the present application is shown, Figure 3 As shown, the steps are as follows:

[0116] S301: Construct an initial target prediction model.

[0117] The initial target prediction model refers to a prediction model that has not been trained yet.

[0118] S302: Acquire original sample website data, and divide the original sample website data into training sample website data and testing sample website data.

[0119] The training sample data refers to the sample data used to train the prediction model, and the test sample data refers to the sample data used to test the accuracy of the model output results. The training sample website data and the test sample website data have been manually tested for maliciousness and the test results have been obtained.

[0120] S303: Iteratively train the initial target prediction model using the training sample website data, and test the initial target prediction model using the test sample website data. If the test result reaches a preset cutoff condition, stop iterative training of the initial target prediction model to obtain the target prediction model.

[0121] For each training sample, the current training sample is input into the prediction model to be trained to obtain the actual output result corresponding to the current training sample; based on the expected output result and the actual output result, the loss of the prediction model to be used is determined, and the model parameters of the prediction model to be trained are adjusted based on the loss of the prediction model to be used to obtain the prediction model to be used.

[0122] The preset cutoff condition may be the accuracy of the prediction model to be used, where the accuracy of the prediction model to be used refers to the degree of consistency between the actual output of the prediction model to be used and the manual detection result. The preset accuracy threshold is a preset accuracy.

[0123] For example, an accuracy threshold of 90% is set in advance. If a sample consisting of 100 malicious website data and corresponding labels is used as a test set to detect the target prediction model, and 95 output results are consistent with the manual detection results, it means that the accuracy of the prediction model to be used is 95%, and the prediction model to be used will be used as the target prediction model.

[0124] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0125] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a malicious website identification device.

[0127] refer to Figure 4 , which is a schematic diagram of a malicious website identification device provided in an embodiment of the present application, and the device at least includes: a blacklist comparison module 401, a search comparison module 402, a rule judgment module 403, a probability calculation module 404 and a determination module 405.

[0128] The blacklist comparison module 401 is used to determine a website to be detected, and to match and compare the website to be detected with a preset website blacklist.

[0129] The search and comparison module 402 is used to call a search engine to search for the website to be detected if the website to be detected does not match the same website in the website blacklist, and to match and compare the website to be detected with the search results obtained by the search engine.

[0130] The rule judgment module 403 is used to split and reorganize the uniform resource locator of the website to be detected to obtain multiple feature fields if the website to be detected does not match the same website in the search results, and determine whether each feature field meets the rules in the preset rule library.

[0131] The probability calculation module 404 is used to input all feature fields into a pre-trained target prediction model and output the probability of a malicious website if the number of rules satisfied by all feature fields does not reach a preset number.

[0132] The determination module 405 is configured to determine that the website to be detected is a malicious website if the malicious website probability is greater than or equal to a preset malicious website probability.

[0133] As a possible implementation, the determination module is further used to: determine that the website to be detected is a legitimate website if the website to be detected matches the same website in the search results. Or, determine that the website to be detected is a legitimate website if the malicious website probability is less than a preset malicious website probability.

[0134] As a possible implementation, the determination module is further used to: if the website to be detected matches the same website in the website blacklist, determine that the website to be detected is a malicious website. Or, if the number of rules satisfied by all feature fields reaches a preset number, determine that the website to be detected is a malicious website.

[0135] As a possible implementation method, the rule judgment module is specifically used to: perform character segmentation on the uniform resource locator of the website to be detected based on at least two segmentation methods, and reorganize the segmented characters to obtain at least two groups of feature field groups, wherein the segmentation rules adopted by different segmentation methods are different, each group of feature field groups corresponds to a segmentation method, and each group of feature field groups includes multiple feature fields; determine whether each feature field in each group of feature field groups satisfies the rules in a preset rule library.

[0136] As a possible implementation manner, the determination module is specifically used to: if the number of rules satisfied by all characteristic fields in any set of characteristic field groups reaches a preset number, determine that the website to be detected is a malicious website.

[0137] As a possible implementation method, the probability calculation module is specifically used to: input each feature field into a pre-trained target prediction model, extract the website features of the website to be detected, convert the website features into a feature vector, and calculate and output the probability of a malicious website based on the feature vector.

[0138] As a possible implementation manner, the device further includes:

[0139] The building module is used to build the initial target prediction model.

[0140] The original sample acquisition module is used to acquire original sample website data and divide the original sample website data into training sample website data and testing sample website data.

[0141] An iteration module is used to iteratively train the initial target prediction model using the training sample website data, and to test the initial target prediction model using the test sample website data. If the test result reaches a preset cutoff condition, the iterative training of the initial target prediction model is stopped to obtain the target prediction model.

[0142] As a possible implementation manner, the device further includes:

[0143] The storage module is used to obtain the attribute data of the website to be detected when it is determined that the type of the website to be detected is a malicious website, and store the website to be detected, the attribute data and the corresponding relationship between the website to be detected and the attribute data in a preset website blacklist, wherein the attribute data includes at least one of the website title, web page text content, website source code, website domain name, and website domain name system service information.

[0144] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0145] The device of the above embodiment is used to implement the corresponding malicious website identification method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0146] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the malicious website identification method described in any of the above embodiments is implemented.

[0147] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0148] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0149] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0150] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0151] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0152] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0153] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0154] The electronic device of the above embodiment is used to implement the corresponding malicious website identification method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0155] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the malicious website identification method described in any of the above embodiments.

[0156] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0157] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the malicious website identification method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0158] It should be noted that the embodiments of the present application can be further described in the following manner:

[0159] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0160] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0161] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0162] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0163] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0164] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0165] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0166] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A method for identifying malicious websites, characterized in that: include: Determine a website to be detected, and compare the website to be detected with a preset website blacklist; If the website to be detected does not match the same website in the website blacklist, calling a search engine to search for the website to be detected, and matching and comparing the website to be detected with the search results obtained by the search engine; If the website to be detected does not match the same website in the search results, the uniform resource locator of the website to be detected is segmented and reorganized to obtain multiple feature fields, and it is determined whether each feature field satisfies the rules in the preset rule library; If the number of rules satisfied by all feature fields does not reach the preset number, all feature fields are input into the pre-trained target prediction model and the probability of malicious website is output; If the malicious website probability is greater than or equal to a preset malicious website probability, the website to be detected is determined to be a malicious website.

2. The method according to claim 1, characterized in that The method further comprises: If the website to be detected matches the same website in the search results, it is determined that the website to be detected is a legitimate website; or, If the malicious website probability is less than a preset malicious website probability, the website to be detected is determined to be a legitimate website.

3. The method according to claim 1, characterized in that The method further comprises: If the website to be detected matches the same website in the website blacklist, the website to be detected is determined to be a malicious website; or, If the number of rules satisfied by all feature fields reaches a preset number, it is determined that the website to be detected is a malicious website.

4. The method according to claim 3, characterized in that The step of segmenting and reorganizing the uniform resource locator of the website to be detected to obtain a plurality of characteristic fields, determining whether each characteristic field satisfies a rule in a preset rule library, and determining that the website to be detected is a malicious website if the number of rules satisfied by each characteristic field reaches a preset number, includes: Performing character segmentation on the URL of the website to be detected based on at least two segmentation methods, and reorganizing the segmented characters to obtain at least two groups of feature field groups, wherein the segmentation rules adopted by different segmentation methods are different, each group of feature field groups corresponds to one segmentation method, and each group of feature field groups includes multiple feature fields; Determine whether each feature field in each feature field group satisfies the rules in the preset rule base; If the number of rules satisfied by all feature fields in any set of feature field groups reaches a preset number, it is determined that the website to be detected is a malicious website.

5. The method according to claim 1, characterized in that The step of inputting the feature field corresponding to the website to be detected into a pre-trained target prediction model and outputting the probability of a malicious website includes: Each feature field is input into a pre-trained target prediction model, website features of the website to be detected are extracted, the website features are converted into feature vectors, and the probability of malicious websites is calculated and output based on the feature vectors.

6. The method according to claim 1, characterized in that The training process of the target prediction model includes: Constructing an initial target prediction model; Obtaining original sample website data, and dividing the original sample website data into training sample website data and testing sample website data; The initial target prediction model is iteratively trained using the training sample website data, and the initial target prediction model is tested using the test sample website data. If the test result reaches a preset cutoff condition, the iterative training of the initial target prediction model is stopped to obtain the target prediction model.

7. The method according to claim 1, characterized in that The method further comprises: When it is determined that the type of the website to be detected is a malicious website, the attribute data of the website to be detected is obtained, and the website to be detected, the attribute data, and the corresponding relationship between the website to be detected and the attribute data are stored in a preset website blacklist, wherein the attribute data includes at least one of the website title, web page text content, website source code, website domain name, and website domain name system service information.

8. A malicious website identification device, characterized in that: include: A blacklist comparison module is used to determine a website to be detected and to match and compare the website to be detected with a preset website blacklist; A search and comparison module is used to call a search engine to search for the website to be detected if the website to be detected does not match the same website in the website blacklist, and to match and compare the website to be detected with the search results obtained by the search engine; A rule judgment module, for, if the website to be detected does not match the same website in the search results, segmenting and reorganizing the uniform resource locator of the website to be detected to obtain multiple feature fields, and determining whether each feature field satisfies a rule in a preset rule library; A probability calculation module, for inputting all feature fields into a pre-trained target prediction model and outputting a malicious website probability if the number of rules satisfied by all feature fields does not reach a preset number; The determination module is used to determine that the website to be detected is a malicious website if the malicious website probability is greater than or equal to a preset malicious website probability.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.