Malicious URL processing method, device, equipment and storage medium
By extracting feature information of web page text, tags and screenshots, using multiple classification models to identify malicious URL categories and formulating processing strategies, it solves the problem of low efficiency and accuracy in processing malicious URLs in the existing technology, and achieves more efficient malicious URLs. Identify and intercept.
Patent Information
- Application Number
- CN202211590350.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-12-12
AI Technical Summary
Existing technology cannot effectively handle malicious URLs with low efficiency and accuracy, the firewall's resistance is reduced, and it cannot effectively identify and intercept new malicious URLs.
By obtaining webpage text, webpage tag sequence and webpage screenshots, using the target webpage image classification model, text classification model and tag sequence classification model, extract feature information, identify webpage screenshots and text tags, determine the URL category and formulate processing strategies, and conduct malicious URL deal with.
It improves the processing efficiency and accuracy of malicious URLs, can effectively identify and intercept different types of malicious URLs, and enhances the ability to resist new malicious URLs.
Smart Images

Figure CN116015772B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a method, device, equipment and storage medium for processing malicious websites. Background Art
[0002] While the Internet brings convenience to people, it also brings harm, for example, fraud. The methods of fraud are constantly changing with the Internet technology, causing more and more elderly users who have access to the Internet or teenagers who use the Internet for a long time to suffer property and mental losses due to fraud. One of the ways of fraud is to defraud users through malicious URLs, for example, loans, order brushing, pig killing, and public security, procuratorial and judicial fraud. It is far from enough to just identify malicious URLs. How to deal with malicious URLs is the top priority. At present, the commonly used related technology is the firewall, which specifically intercepts malicious URLs through the firewall and prohibits access to malicious URLs. However, the makers of malicious URLs will create new malicious URLs based on the working principle of the firewall, which rapidly reduces the firewall's resistance ability and results in low efficiency and accuracy in handling malicious URLs.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for processing malicious URLs, aiming to solve the technical problem that the prior art cannot process malicious URLs with low efficiency and accuracy.
[0005] To achieve the above object, the present invention provides a method for processing malicious URLs, the method comprising the following steps:
[0006] Obtain web page text, web page tag sequence, and web page screenshot according to the malicious URL to be processed;
[0007] Extracting feature information of the webpage screenshot, identifying the feature information through a target webpage image classification model, and obtaining a category of the webpage screenshot;
[0008] When the content of the webpage text is less than a preset text content threshold and the content of the webpage tag sequence is less than a preset tag sequence threshold, the webpage text is identified by a target text classification model, and the webpage tag sequence is identified by a target tag sequence classification model;
[0009] Determining the category of the malicious URL to be processed according to the identification result and the category of the webpage screenshot;
[0010] A target URL processing strategy is determined according to the category of the malicious URL to be processed, and the malicious URL to be processed is processed according to the target URL processing strategy.
[0011] Optionally, obtaining web page text, web page tag sequence, and web page screenshot according to the malicious URL to be processed includes:
[0012] Obtain the malicious website to be processed, access the malicious website to be processed through the target HTTP get command on the virtual machine, and obtain the source code and content of the malicious website;
[0013] Parsing the malicious URL source code to obtain web page text and web page tag data;
[0014] Obtaining a corresponding web page tag sequence according to the web page tag data;
[0015] The target operates the browser to take a screenshot of the malicious website content to obtain a webpage screenshot.
[0016] Optionally, extracting feature information of the webpage screenshot and identifying the feature information by a target webpage image classification model to obtain a category of the webpage screenshot includes:
[0017] Detecting the webpage screenshot to obtain a shape of the webpage screenshot;
[0018] Adjusting the shape of the webpage screenshot according to a preset fixed image shape;
[0019] Obtain corresponding screenshot pixel values according to the screenshot of the web page after adjusting the shape;
[0020] When the screenshot pixel value is within a preset pixel interval, performing mean calculation on the screenshot pixel value to obtain the current screenshot pixel mean, and performing variance calculation on the screenshot pixel value to obtain the current screenshot pixel variance;
[0021] When the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, feature information of the webpage screenshot is extracted, and the feature information is identified by a target webpage image classification model to obtain a category of the webpage screenshot.
[0022] Optionally, when the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, extracting feature information of the webpage screenshot, identifying the feature information through a target webpage image classification model, and obtaining the category of the webpage screenshot includes:
[0023] When the pixel mean of the current screenshot is a preset mean threshold and the pixel variance of the current screenshot is a preset variance threshold, feature extraction is performed on the webpage screenshot through a RestNet network to obtain feature information of each scale;
[0024] The feature information of each scale is fused through the MaxPooling network layer to obtain multi-scale feature information;
[0025] The multi-scale feature information is identified through a fully connected layer of a target web page image classification model to obtain probability values of each category to which the web page screenshot belongs;
[0026] The maximum probability value among the probability values of the various categories is extracted, and the category corresponding to the maximum probability value is used as the category of the webpage screenshot.
[0027] Optionally, when the content of the webpage text is less than a preset text content threshold and the content of the webpage tag sequence is less than a preset tag sequence threshold, identifying the webpage text by a target text classification model and identifying the webpage tag sequence by a target tag sequence classification model include:
[0028] Detecting the webpage text, and obtaining corresponding text content according to the webpage text detection result;
[0029] Detecting the web page tag sequence, and obtaining corresponding tag sequence content according to the tag sequence detection result;
[0030] When the content of the webpage text is less than a preset text content threshold, determining whether the content of the webpage tag sequence is less than a preset tag sequence threshold;
[0031] When the content of the web page tag sequence is less than a preset tag sequence threshold, the web page text is identified by a target text classification model, and the web page tag sequence is identified by a target tag sequence classification model.
[0032] Optionally, when the content of the web page tag sequence is less than a preset tag sequence threshold, identifying the web page text by a target text classification model, and identifying the web page tag sequence by a target tag sequence classification model, include:
[0033] When the content of the web page tag sequence is less than a preset tag sequence threshold, performing word meaning analysis on the web page text to obtain various words;
[0034] Counting the frequencies of occurrence of each of the words, and filtering out words whose frequencies are greater than a preset frequency threshold from the words;
[0035] Constructing a corresponding vocabulary according to the frequencies obtained by screening, and constructing a word embedding matrix according to the vocabulary;
[0036] Obtain a word vector list according to the web page tag sequence and the word embedding matrix;
[0037] Querying the word vector corresponding to the webpage text according to the word embedding matrix, and identifying the word vector through the target text classification model;
[0038] The word vector and the word vector list are aggregated through a global pooling layer and a weight connection layer to obtain a target word vector feature;
[0039] The target word vector features are identified through a target label sequence classification model.
[0040] Optionally, determining a target URL processing strategy according to the category of the malicious URL to be processed, and processing the malicious URL to be processed according to the target URL processing strategy includes:
[0041] Selecting a target URL processing strategy from a target malicious URL processing strategy set according to the category of the malicious URL to be processed;
[0042] Intercepting the malicious website to be processed and obtaining the uniform resource locator of the malicious website to be processed;
[0043] Obtaining a corresponding uniform resource locator segment according to the domain name information of the uniform resource locator;
[0044] Inserting a blocking character at a preset position of the uniform resource locator segment according to the target website address processing strategy, and calculating a hash value of the uniform resource locator segment;
[0045] The hash value of the uniform resource locator segment is stored in the malicious website blockchain.
[0046] In addition, to achieve the above-mentioned purpose, the present invention also provides a malicious website processing device, the malicious website processing device comprising:
[0047] An acquisition module is used to obtain web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed;
[0048] An extraction module, used to extract feature information of the webpage screenshot, identify the feature information through a target webpage image classification model, and obtain the category of the webpage screenshot;
[0049] an identification module, configured to identify the web page text by using a target text classification model and to identify the web page tag sequence by using a target tag sequence classification model when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold;
[0050] A determination module, used to determine the category of the malicious website to be processed according to the identification result and the category of the webpage screenshot;
[0051] The processing module is used to determine a target URL processing strategy according to the category of the malicious URL to be processed, and process the malicious URL to be processed according to the target URL processing strategy.
[0052] In addition, to achieve the above-mentioned purpose, the present invention also proposes a malicious URL processing device, which includes: a memory, a processor, and a malicious URL processing program stored in the memory and executable on the processor, and the malicious URL processing program is configured to implement the malicious URL processing method as described above.
[0053] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a malicious URL processing program is stored, and when the malicious URL processing program is executed by a processor, the malicious URL processing method described above is implemented.
[0054] The method for processing malicious URLs proposed in the present invention obtains web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed; extracts feature information of the web page screenshot, identifies the feature information through a target web page image classification model, and obtains the category of the web page screenshot; when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold, identifies the web page text through a target text classification model, and identifies the web page tag sequence through a target tag sequence classification model; determines the category of the malicious URL to be processed according to the recognition result and the category of the web page screenshot; determines the target URL processing strategy according to the category of the malicious URL to be processed, and processes the malicious URL to be processed according to the target URL processing strategy; in the above manner, the malicious URL to be processed is processed according to the target URL processing strategy determined by the category, thereby effectively improving the efficiency and accuracy of processing malicious URLs. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic diagram of the structure of a malicious website processing device in a hardware operating environment involved in an embodiment of the present invention;
[0056] Figure 2It is a flowchart of a first embodiment of a method for processing malicious URLs of the present invention;
[0057] Figure 3 It is a flow chart of a second embodiment of the method for processing malicious websites of the present invention;
[0058] Figure 4 It is a functional module diagram of the first embodiment of the apparatus for processing malicious URLs of the present invention.
[0059] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0060] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0061] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of a device for processing malicious websites in a hardware operating environment according to an embodiment of the present invention.
[0062] like Figure 1 As shown, the processing device of the malicious website may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0063] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the device for processing malicious URLs, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0064] like Figure 1As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a malicious website processing program.
[0065] exist Figure 1 In the malicious URL processing device shown, the network interface 1004 is mainly used for data communication with the network integration platform workstation; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the malicious URL processing device of the present invention can be set in the malicious URL processing device, and the malicious URL processing device calls the malicious URL processing program stored in the memory 1005 through the processor 1001, and executes the malicious URL processing method provided by the embodiment of the present invention.
[0066] Based on the above hardware structure, an embodiment of a method for processing malicious URLs of the present invention is proposed.
[0067] Reference Figure 2 , Figure 2 FIG. 4 is a flow chart of a first embodiment of a method for processing malicious URLs of the present invention.
[0068] In the first embodiment, the method for processing malicious URLs includes the following steps:
[0069] Step S10, obtaining web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed.
[0070] It should be noted that the executor of this embodiment is a device for processing malicious URLs, and may also be other devices that can achieve the same or similar functions, such as a URL processor, etc. This embodiment does not limit this. In this embodiment, the URL processor is used as an example for explanation.
[0071] It should be understood that the web page text refers to the text content of the web page generated by accessing the malicious URL to be processed on the virtual machine, the web page tag sequence refers to the tag sequence of the generated web page, and the web page tag can be a web page HTML tag. The web page screenshot refers to a screenshot of the web page content, which includes but is not limited to web page text and web page images.
[0072] Further, step S10 includes: obtaining a malicious URL to be processed, accessing the malicious URL to be processed through a target HTTP get command on a virtual machine, obtaining a malicious URL source code and malicious URL content; parsing the malicious URL source code to obtain web page text and web page tag data; obtaining a corresponding web page tag sequence based on the web page tag data; and taking a screenshot of the malicious URL content through a target operation browser to obtain a web page screenshot.
[0073] It can be understood that after obtaining the malicious URL to be processed, in order to avoid the attack and intrusion of the malicious URL to the device, this embodiment accesses the malicious URL to be processed through the target HTTP get naming in the virtual machine to obtain the malicious URL source code and malicious URL content. The malicious URL source code refers to the source code of the web page corresponding to the malicious URL to be processed, and the web page tag data refers to the tag data of the web page corresponding to the malicious URL to be processed. The web page tag data is located at both ends of the source code, and then the corresponding web page tag sequence is obtained according to the web page tag data, and then a screenshot of the malicious URL content is taken through the target operation browser to obtain a web page screenshot. The target operation browser can be a Selenium operation browser.
[0074] Step S20, extracting feature information of the webpage screenshot, identifying the feature information through a target webpage image classification model, and obtaining a category of the webpage screenshot.
[0075] It can be understood that feature information refers to information that can uniquely identify a web page screenshot. The feature information can be a web page screenshot identification field. The target web page image classification model refers to a model for classifying web page images. The target web page image classification model is obtained by transfer learning from a model pre-trained on the ImageNet dataset to a web page screenshot dataset for fine-tuning. Compared with general image classification models, the depth of the target web page image classification model is increased and the internal residual blocks are connected in a jumping manner, thereby alleviating the problem of gradient vanishing caused by increasing the depth.
[0076] Further, step S20 includes: detecting the web page screenshot to obtain a shape of the web page screenshot; adjusting the shape of the web page screenshot according to a preset fixed image shape; obtaining a corresponding screenshot pixel value according to the web page screenshot after the shape is adjusted; when the screenshot pixel value is within a preset pixel interval, performing mean calculation on the screenshot pixel value to obtain a current screenshot pixel mean, and performing variance calculation on the screenshot pixel value to obtain a current screenshot pixel variance; when the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, extracting feature information of the web page screenshot, identifying the feature information through a target web page image classification model, and obtaining a category of the web page screenshot.
[0077] It should be understood that after obtaining the shape of the web page screenshot, it is necessary to adjust the shape of the web page screenshot to a preset fixed image shape, and then determine whether the screenshot pixel value of the web page screenshot after the shape is adjusted is within the preset pixel interval. If so, it is necessary to reduce the screenshot pixel value to the preset pixel interval in proportion, and the preset pixel interval is [0,1]. Then, the current screenshot pixel mean and the current screenshot pixel variance of the screenshot pixel value are calculated respectively, and then determine whether the current screenshot pixel mean is the preset mean threshold and the current screenshot pixel variance is the preset variance threshold. If not, it is necessary to normalize the current screenshot pixel mean to the preset mean threshold, and normalize the current screenshot pixel variance to the preset variance threshold, and the preset mean threshold is 0, and the preset variance threshold is 1. Then, continue to identify the category of the web page screenshot through the target web page image classification model.
[0078] Furthermore, when the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, feature information of the web page screenshot is extracted, and the feature information is identified through a target web page image classification model to obtain a category of the web page screenshot, including: when the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, feature extraction is performed on the web page screenshot through a RestNet network to obtain feature information of each scale; the feature information of each scale is fused through a MaxPooling network layer to obtain multi-scale feature information; the multi-scale feature information is identified through a fully connected layer of a target web page image classification model to obtain probability values of each category to which the web page screenshot belongs; the maximum probability value among the probability values of each category is extracted, and the category corresponding to the maximum probability value is used as the category of the web page screenshot.
[0079] It can be understood that after obtaining a screenshot of a web page that meets the conditions, feature extraction is performed through the RestNet network, which includes network layers of different scales. Figure 3, the RestNet network includes but is not limited to (7×7conv,64, / 2), (3×3conv,64), (3×3conv,128, / 2), (3×3conv,128), (3×3conv,256, / 2), (3×3conv,256), (3×3conv,512, / 2), (3×3conv,512). Therefore, the feature information at each scale is extracted, and then the feature information of each scale is fused into multi-scale feature information through the MaxPooling network layer. Then, the multi-scale feature information is identified through the fully connected layer of the target web page image classification model, and the probability values of each category to which the web page screenshot belongs are output. Then, the category corresponding to the maximum probability value in the probability values of each category is used as the category of the web page screenshot. For example, the probability value of category 1 is 60%, the probability value of category 2 is 80%, and the probability value of category 3 is 95%, then category 3 is used as the category of the web page screenshot.
[0080] Step S30, when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold, the web page text is identified by a target text classification model, and the web page tag sequence is identified by a target tag sequence classification model.
[0081] It should be understood that after obtaining the web page text and the web page tag sequence, it is necessary to determine whether the content of the web page text is less than the preset text content threshold and the content of the web page tag sequence is less than the preset tag sequence threshold. If so, it indicates that the content of the web page text and the content of the web page tag sequence are too small. At this time, the web page text is identified by the target text classification model, and the web page tag sequence is identified by the target tag sequence classification model. Both the target text classification model and the target tag sequence classification model are trained by the TextCNN deep learning algorithm. The text categories used in the training of the target text classification model include pornography, gambling, loans, order brushing, ETC fraud, counterfeiting of public security, procuratorial and judicial organs, and normal and legal.
[0082] Step S40, determining the category of the malicious website to be processed according to the recognition result and the category of the webpage screenshot.
[0083] It is understandable that after obtaining the recognition results of the web page text and the web page tag sequence, the category of the malicious URL to be processed is comprehensively considered and determined in combination with the category of the web page screenshot.
[0084] Step S50, determining a target URL processing strategy according to the category of the malicious URL to be processed, and processing the malicious URL to be processed according to the target URL processing strategy.
[0085] It should be understood that the target URL processing strategy refers to the strategy for processing malicious URLs. Since the processing strategies for different categories of malicious URLs are different, after obtaining the category of the malicious URL to be processed, the most suitable URL processing strategy is determined according to the category of the malicious URL to be processed, and then the malicious URL to be processed is processed through the target URL processing strategy.
[0086] Further, step S50 includes: selecting a target URL processing strategy from a target malicious URL processing strategy set according to the category of the malicious URL to be processed; intercepting the malicious URL to be processed and obtaining the uniform resource locator of the malicious URL to be processed; obtaining a corresponding uniform resource locator segment according to the domain name information of the uniform resource locator; inserting a blocking character at a preset position of the uniform resource locator segment according to the target URL processing strategy, and calculating a hash value of the uniform resource locator segment; storing the hash value of the uniform resource locator segment in a malicious URL blockchain.
[0087] It can be understood that after selecting the target URL processing strategy that best matches the category of the malicious URL to be processed, the malicious URL to be processed is then intercepted, that is, the malicious URL to be processed will not be accessed, and then the corresponding uniform resource locator segment is obtained based on the domain name information of the uniform resource locator of the malicious URL to be processed, and then a blocking character is inserted at a preset position of the uniform resource locator segment, so that the entire malicious URL to be processed is invalid, and then the hash value of the uniform resource locator segment is stored in the malicious URL blockchain. When other users encounter the malicious URL to be processed, the malicious tag will automatically pop up to prevent other users' devices from being harmed by the malicious URL to be processed.
[0088] This embodiment obtains web page text, web page tag sequence and web page screenshot according to the malicious web page to be processed; extracts feature information of the web page screenshot, identifies the feature information through a target web page image classification model, and obtains the category of the web page screenshot; when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold, identifies the web page text through a target text classification model, and identifies the web page tag sequence through a target tag sequence classification model; determines the category of the malicious web page to be processed according to the recognition result and the category of the web page screenshot; determines the target web address processing strategy according to the category of the malicious web page to be processed, and processes the malicious web page to be processed according to the target web address processing strategy; in the above manner, the malicious web page to be processed is processed according to the target web address processing strategy determined by the category, thereby effectively improving the efficiency and accuracy of processing malicious web pages.
[0089] In one embodiment, if Figure 3Based on the first embodiment, a second embodiment of the method for processing malicious URLs of the present invention is proposed. Step S30 includes:
[0090] Step S301, detecting the web page text, and obtaining corresponding text content according to the web page text detection result.
[0091] It should be understood that the text content refers to the content of the web page text, which includes but is not limited to web page text and web page images. Specifically, after obtaining the web page text, the web page text is detected to obtain the corresponding text content.
[0092] Step S302: Detect the web page tag sequence and obtain corresponding tag sequence content according to the tag sequence detection result.
[0093] It can be understood that the tag sequence content refers to the content of the web page tag sequence. Specifically, after the web page tag sequence is obtained, the web page tag sequence is detected to obtain the corresponding tag sequence content.
[0094] Step S303, when the content of the webpage text is less than a preset text content threshold, it is determined whether the content of the webpage tag sequence is less than a preset tag sequence threshold.
[0095] It should be understood that after obtaining the content of the webpage text, it is necessary to determine whether the content of the webpage text is less than the preset text content threshold. If so, it is necessary to continue to determine whether the content of the webpage tag sequence is less than the preset tag sequence threshold.
[0096] Step S304, when the content of the web page tag sequence is less than a preset tag sequence threshold, the web page text is identified by a target text classification model, and the web page tag sequence is identified by a target tag sequence classification model.
[0097] It can be understood that when it is determined that the content of the web page tag sequence is less than the preset tag sequence threshold, it indicates that the content of the web page tag sequence and the web page text is too small. At this time, the web page text is identified through the target text classification model, and the web page tag sequence is identified through the target tag sequence classification model.
[0098] Further, step S304 includes: when the content of the web page tag sequence is less than a preset tag sequence threshold, performing word meaning analysis on the web page text to obtain various words; counting the frequency of occurrence of the various words, and filtering the words whose frequency is greater than the preset frequency threshold from the various words; constructing a corresponding vocabulary according to the filtered frequencies, and constructing a word embedding matrix according to the vocabulary; obtaining a word vector list according to the web page tag sequence and the word embedding matrix; querying the word vector corresponding to the web page text according to the word embedding matrix, and identifying the word vector through the target text classification model; aggregating the word vector and the word vector list through the global pooling layer and the weight connection layer to obtain the target word vector feature; identifying the target word vector feature through the target tag sequence classification model.
[0099] It should be understood that when it is determined that the content of the web page tag sequence is less than the preset tag sequence threshold, the web page text is divided into word granularity, and then each word is obtained according to the word granularity, and then the frequency of occurrence of each word is counted, and then it is determined whether the statistical frequency is greater than the preset frequency threshold. If so, the words corresponding to the frequency are constructed into a corresponding vocabulary table, and then a word embedding matrix is constructed based on the vocabulary table. At this time, the word embedding matrix can query the word vector corresponding to any word, and the word vector can represent the characteristics of each dimension of the word, and then the word vector is identified through the target text classification model, and the word vector and the word vector list are aggregated through the global pooling layer and the weight connection layer, and then the aggregated target word vector features are identified through the target tag sequence classification model.
[0100] This embodiment detects the web page text and obtains the corresponding text content according to the web page text detection result; detects the web page tag sequence and obtains the corresponding tag sequence content according to the tag sequence detection result; when the content of the web page text is less than the preset text content threshold, determines whether the content of the web page tag sequence is less than the preset tag sequence threshold; when the content of the web page tag sequence is less than the preset tag sequence threshold, identifies the web page text through the target text classification model, and identifies the web page tag sequence through the target tag sequence classification model; through the above-mentioned method, the web page text and the web page tag sequence are detected respectively, and then it is determined whether the conditions that the content of the web page text is less than the preset text content threshold and the content of the web page tag sequence is less than the preset tag sequence threshold are met, and if so, the web page text is identified through the target text classification model, and the web page tag sequence is identified through the target tag sequence classification model, thereby effectively improving the accuracy of identifying the web page text and the web page tag sequence.
[0101] In addition, an embodiment of the present invention further provides a storage medium, on which a malicious URL processing program is stored. When the malicious URL processing program is executed by a processor, the steps of the malicious URL processing method described above are implemented.
[0102] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.
[0103] In addition, refer to Figure 4 The embodiment of the present invention further provides a malicious website processing device, the malicious website processing device comprising:
[0104] The acquisition module 10 is used to obtain web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed.
[0105] The extraction module 20 is used to extract feature information of the webpage screenshot, identify the feature information through a target webpage image classification model, and obtain the category of the webpage screenshot.
[0106] The identification module 30 is used to identify the web page text through the target text classification model and to identify the web page tag sequence through the target tag sequence classification model when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold.
[0107] The determination module 40 is used to determine the category of the malicious website to be processed according to the identification result and the category of the webpage screenshot.
[0108] The processing module 50 is used to determine a target URL processing strategy according to the category of the malicious URL to be processed, and process the malicious URL to be processed according to the target URL processing strategy.
[0109] This embodiment obtains web page text, web page tag sequence and web page screenshot according to the malicious web page to be processed; extracts feature information of the web page screenshot, identifies the feature information through a target web page image classification model, and obtains the category of the web page screenshot; when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold, identifies the web page text through a target text classification model, and identifies the web page tag sequence through a target tag sequence classification model; determines the category of the malicious web page to be processed according to the recognition result and the category of the web page screenshot; determines the target web address processing strategy according to the category of the malicious web page to be processed, and processes the malicious web page to be processed according to the target web address processing strategy; in the above manner, the malicious web page to be processed is processed according to the target web address processing strategy determined by the category, thereby effectively improving the efficiency and accuracy of processing malicious web pages.
[0110] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0111] In addition, for technical details not fully described in this embodiment, reference can be made to the method for processing malicious URLs provided in any embodiment of the present invention, and will not be repeated here.
[0112] Other embodiments of the device for processing malicious URLs of the present invention or implementation methods thereof may refer to the above-mentioned method embodiments, which will not be repeated here.
[0113] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0114] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, an integrated platform workstation, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0116] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for processing malicious URLs, characterized in that: The method for processing malicious URLs comprises the following steps: Obtain web page text, web page tag sequence, and web page screenshot according to the malicious URL to be processed; Extracting feature information of the webpage screenshot, identifying the feature information through a target webpage image classification model, and obtaining a category of the webpage screenshot; When the content of the webpage text is less than a preset text content threshold and the content of the webpage tag sequence is less than a preset tag sequence threshold, identifying the webpage text by a target text classification model and identifying the webpage tag sequence by a target tag sequence classification model; Determining the category of the malicious URL to be processed according to the identification result and the category of the webpage screenshot; Determine a target URL processing strategy according to the category of the malicious URL to be processed, and process the malicious URL to be processed according to the target URL processing strategy; The step of determining a target URL processing strategy according to the category of the malicious URL to be processed, and processing the malicious URL to be processed according to the target URL processing strategy includes: Selecting a target URL processing strategy from a target malicious URL processing strategy set according to the category of the malicious URL to be processed; Intercepting the malicious website to be processed and obtaining the uniform resource locator of the malicious website to be processed; Obtaining a corresponding uniform resource locator segment according to the domain name information of the uniform resource locator; Inserting a blocking character at a preset position of the uniform resource locator segment according to the target website address processing strategy, and calculating a hash value of the uniform resource locator segment; The hash value of the uniform resource locator segment is stored in the malicious website blockchain.
2. The method for processing malicious URLs according to claim 1, wherein: The method of obtaining web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed includes: Obtain the malicious website to be processed, access the malicious website to be processed through the target HTTP get command on the virtual machine, and obtain the source code and content of the malicious website; Parsing the malicious URL source code to obtain web page text and web page tag data; Obtaining a corresponding web page tag sequence according to the web page tag data; The target operates the browser to take a screenshot of the malicious website content to obtain a webpage screenshot.
3. The method for processing malicious URLs according to claim 1, wherein: The step of extracting feature information of the webpage screenshot and identifying the feature information by using a target webpage image classification model to obtain a category of the webpage screenshot includes: Detecting the webpage screenshot to obtain a shape of the webpage screenshot; Adjusting the shape of the webpage screenshot according to a preset fixed image shape; Obtain corresponding screenshot pixel values according to the screenshot of the web page after adjusting the shape; When the screenshot pixel value is within a preset pixel interval, performing mean calculation on the screenshot pixel value to obtain the current screenshot pixel mean, and performing variance calculation on the screenshot pixel value to obtain the current screenshot pixel variance; When the current screenshot pixel mean is a preset mean threshold and the current screenshot pixel variance is a preset variance threshold, feature information of the webpage screenshot is extracted, and the feature information is identified by a target webpage image classification model to obtain a category of the webpage screenshot.
4. The method for processing malicious URLs according to claim 3, characterized in that: When the pixel mean of the current screenshot is a preset mean threshold and the pixel variance of the current screenshot is a preset variance threshold, feature information of the webpage screenshot is extracted, and the feature information is identified by a target webpage image classification model to obtain the category of the webpage screenshot, including: When the pixel mean of the current screenshot is a preset mean threshold and the pixel variance of the current screenshot is a preset variance threshold, feature extraction is performed on the webpage screenshot through a RestNet network to obtain feature information of each scale; The feature information of each scale is fused through the MaxPooling network layer to obtain multi-scale feature information; The multi-scale feature information is identified through a fully connected layer of a target web page image classification model to obtain probability values of each category to which the web page screenshot belongs; The maximum probability value among the probability values of the various categories is extracted, and the category corresponding to the maximum probability value is used as the category of the webpage screenshot.
5. The method for processing malicious URLs according to claim 1, wherein: When the content of the webpage text is less than a preset text content threshold and the content of the webpage tag sequence is less than a preset tag sequence threshold, the webpage text is identified by a target text classification model, and the webpage tag sequence is identified by a target tag sequence classification model, including: Detecting the webpage text, and obtaining corresponding text content according to the webpage text detection result; Detecting the web page tag sequence, and obtaining corresponding tag sequence content according to the tag sequence detection result; When the content of the webpage text is less than a preset text content threshold, determining whether the content of the webpage tag sequence is less than a preset tag sequence threshold; When the content of the web page tag sequence is less than a preset tag sequence threshold, the web page text is identified by a target text classification model, and the web page tag sequence is identified by a target tag sequence classification model.
6. The method for processing malicious URLs according to claim 5, characterized in that: When the content of the web page tag sequence is less than a preset tag sequence threshold, identifying the web page text by a target text classification model, and identifying the web page tag sequence by a target tag sequence classification model, include: When the content of the web page tag sequence is less than a preset tag sequence threshold, performing word meaning analysis on the web page text to obtain various words; Counting the frequencies of occurrence of each of the words, and filtering out words whose frequencies are greater than a preset frequency threshold from the words; Constructing a corresponding vocabulary according to the frequencies obtained by screening, and constructing a word embedding matrix according to the vocabulary; Obtain a word vector list according to the web page tag sequence and the word embedding matrix; Querying the word vector corresponding to the webpage text according to the word embedding matrix, and identifying the word vector through the target text classification model; The word vector and the word vector list are aggregated through a global pooling layer and a weight connection layer to obtain a target word vector feature; The target word vector features are identified through a target label sequence classification model.
7. A device for processing malicious URLs, characterized in that: The malicious website processing device includes: An acquisition module is used to obtain web page text, web page tag sequence and web page screenshot according to the malicious URL to be processed; An extraction module, used to extract feature information of the webpage screenshot, identify the feature information through a target webpage image classification model, and obtain the category of the webpage screenshot; an identification module, configured to identify the web page text by using a target text classification model and to identify the web page tag sequence by using a target tag sequence classification model when the content of the web page text is less than a preset text content threshold and the content of the web page tag sequence is less than a preset tag sequence threshold; A determination module, used to determine the category of the malicious website to be processed according to the identification result and the category of the webpage screenshot; A processing module, used to determine a target URL processing strategy according to the category of the malicious URL to be processed, and process the malicious URL to be processed according to the target URL processing strategy; The processing module is further used to select a target URL processing strategy from a target malicious URL processing strategy set according to the category of the malicious URL to be processed; intercept the malicious URL to be processed and obtain the uniform resource locator of the malicious URL to be processed; obtain the corresponding uniform resource locator segment according to the domain name information of the uniform resource locator; insert a blocking character at a preset position of the uniform resource locator segment according to the target URL processing strategy, and calculate the hash value of the uniform resource locator segment; store the hash value of the uniform resource locator segment in a malicious URL blockchain.
8. A device for processing malicious URLs, characterized in that: The malicious URL processing device includes: a memory, a processor, and a malicious URL processing program stored in the memory and executable on the processor, wherein the malicious URL processing program is configured to implement the malicious URL processing method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a malicious URL processing program, and when the malicious URL processing program is executed by the processor, the malicious URL processing method according to any one of claims 1 to 6 is implemented.
