This application claims priority to Chinese Patent Application No. 202310559925.9, filed May 18, 2023, the entire disclosure of which is incorporated by reference herein.
The disclosure relates to a field of cyberspace security technologies, and more particularly to a backdoor attack method and apparatus for a malicious uniform resource locator (URL) detection system.
As one of the most common methods of accessing network resources, a URL, such as a QR code, a social media label, and so on, is a basis of accessing a network that people use frequently in their daily lives today. With the development and popularization of the Internet, more and more information is stored on the Internet. Therefore, people access the Internet more frequently. Especially, with the spread of the corona virus disease 2019 (COVID-19), people around the world have to shift their daily activities, such as office work, socializing, utility recharging, and even meta-universe, to the Internet. Compared to the time before the COVID-19, online activities of people increase sharply, and the URL is used more frequently. Consequently, more and more novel malicious URLs are generated by a malicious attacker to jeopardize a network security. The malicious URL herein includes, but not limited to, a URL corresponding to a website implanted with Trojan, and a URL corresponding to a phishing website.
The importance of the URL on people accessing the network resources is obvious, so malicious URL detection has been a key research content in the field of cyberspace security technologies. In a conventional way, a blacklist is configured to store known malicious URLs for detection. The blacklist way may merely detect the known malicious URLs. Therefore, a heuristic blacklist is designed by a scholar later to improve an ability of the blacklist way for detecting unknown malicious URLs. With the popularity of a machine learning model, especially a powerful representation ability demonstrated by a way, such as deep learning, on large-scale data, an intelligent algorithm such as machine learning and deep learning is also rapidly configured to construct a malicious URL detection system. Compared to the blacklist way, the malicious URL detection system based on the intelligent algorithm such as the machine learning and a neural network greatly improves the ability for detecting the unknown malicious URLs.
However, it is exposed by multiple scholars that the model such as the machine learning model or a neural network model is vulnerable against attacks (e.g., a backdoor attack, and a poisoning attack) in multiple fields (e.g., image recognition, and natural language processing). A subtle interference is added by the malicious attacker intentionally to form a malicious adversarial sample. The model may be disturbed by adding the malicious adversarial sample to a dataset during a model training stage, causing the model to output a false output with a high confidence. Studies on the malicious adversarial sample are extensively unfolded in various application fields. However, the URL may not be accessed due to an arbitrary change. This disclosure proposes a backdoor attack method that can attract the attention of relevant security practitioners and design defense mechanisms to better improve cyberspace security.
The disclosure aims to solve at least one of technical problems in the related art to some extents.
For this, by utilizing a feature that a server may accept multiple variants of a URL format, on a basis that an accessibility of a URL is not affected by adding an arbitrary number of slashes to a specific position in the URL, the disclosure provides a backdoor attack method for a malicious URL detection system. The disclosure proposes a higher requirement on a security of an existing malicious URL detection system constructed based on an intelligent algorithm such as machine learning and neural network, solves a general problem in the related art that there has not yet been a tried-and-tested backdoor attack method for the malicious URL detection system, and promotes a researcher and an Internet vendor to carry out an in-depth research on a security of the malicious URL detection system.
Another objective of the disclosure is to provide a backdoor attack apparatus for a malicious URL detection system.
To achieve the above objectives, a first aspect of embodiments of the disclosure provides a backdoor attack method for a malicious URL detection system, including:
In addition, the backdoor attack method for the malicious URL detection system according to the above embodiments of the disclosure may have following additional technical features.
Further, in an embodiment of the disclosure, obtaining the original URL sample of the backdoor URL sample to be generated includes:
Further, in an embodiment of the disclosure, determining the backdoor attack mode of the malicious URL detection system based on the position number result, and generating the backdoor URL samples corresponding to the original URL samples by using the backdoor attack mode include:
Further, in an embodiment of the disclosure, constructing the training set based on the preset ratio of backdoor URL samples, training the neural network model by using the training set, and testing the attack strength of the malicious URL detection system in the backdoor attack mode by using the trained neural network model to obtain the real-time attack success rate include:
Further, in an embodiment of the disclosure, after obtaining the real-time attack success rate, the method also includes:
To achieve the above objectives, another aspect of embodiments of the disclosure provides a backdoor attack apparatus for a malicious URL detection system including an original sample obtaining module, a position information numbering module, a backdoor sample generating module, and an attack mode testing module.
The original sample obtaining module is configured to obtain original URL samples of backdoor URL samples to be generated.
The position information numbering module is configured to determine position information of separator slashes in each URL of the original URL sample, and to obtain a position number result by numbering the position information.
The backdoor sample generating module is configured to determine a backdoor attack mode of the malicious URL detection system based on the position number result, and to generate the backdoor URL samples corresponding to the original URL samples by using the backdoor attack mode.
The attack mode testing module is configured to establish a training set based on a preset ratio of the backdoor URL samples, to train a neural network model by using the training set, and to test an attack strength of the malicious URL detection system in the backdoor attack mode by using the trained neural network model to obtain a real-time attack success rate.
With the backdoor attack method and apparatus for the malicious URL detection system according to embodiments of the disclosure, there is proposed a higher requirement for the security of the existing malicious URL detection system utilizing the intelligent method such as the deep learning and the machine learning, and a vulnerability of such malicious URL detection system is evaluated forwardly. The disclosure solves the problem that there is no proper attack method based on an adversarial sample for the malicious URL detection model in the related art, and promotes the researcher to raise an attention on a defect that the security and the robustness of the malicious URL detection system are susceptible to adversarial attacks.
Additional aspects and advantages of embodiments of disclosure will be given in part in the following descriptions, become apparent in part from the following descriptions, or be learned from the practice of the disclosure.
These and/or other aspects and advantages of embodiments of the disclosure will become apparent and more readily appreciated from the following descriptions made with reference to the accompanying drawings, in which:
It is noted that embodiments of the disclosure and features in the embodiments can be combined with each other without conflict. Description will be made in detail below to the disclosure with reference to the accompanying drawings in combination with the embodiments.
In order to enable those skilled in the art to understand the technical solutions of the disclosure, the technical solutions in embodiments of the disclosure will be described clearly and completely below in combination with the accompanying drawings. Obviously, embodiments described here are only part of embodiments of the disclosure and are not all embodiments of the disclosure. Based on embodiments of the disclosure, other embodiments obtained by those skilled in the art without inventive work are within the protection scope of the disclosure.
Description will be made below to a method and an apparatus for a backdoor attack for a malicious URL detection system proposed by embodiments of the disclosure with reference to the accompany drawings.
As illustrated in
At block S1, original URL samples of backdoor URL samples to be generated are obtained.
It may be understood that, the original URL sample is obtained. The original URL sample (represented as Ui) that generates the backdoor URL sample (represented as U′i) is obtained by an attacker.
As an implementation,
At block S11, initial URL samples are obtained by re-collecting URL samples and corresponding labels.
At block S12, the original URL samples of the backdoor URL samples to be generated are obtained by filtering the initial URL samples.
In detail, the initial URL samples are obtained by stealing existing data from a model owner or re-collecting the URL samples and the labels corresponding to the URL samples, and the total number of the initial URL samples is represented by K.
In detail, the initial URL samples are filtered. In order to enable a generated backdoor URL sample (also called malicious URL samples) to have a more effective attack effect on a target model, the attacker needs to filter the initial URL samples stolen or collected, such that the filtered initial URL samples have the most similar distribution of data types as the URL samples (also called benign URL samples) of the model owner as much as possible.
At block S2, position information of separator slashes in each URL of the original URL samples is determined, and a position number result is obtained by numbering the position information.
It is understood that, in this action, there is a need to analyze each URL separately to obtain a position of the separator “/” (slash) in the URL, and to number the positions of the separators “/” in each URL sequentially. This action may include the following.
In detail, all the original URL samples are analyzed by the attacker, to obtain positions and the number of the separators “/” in each URL, respectively.
In detail, the separator, i.e., the slash, is numbered to determine an attack mode usable by the attacker. A serial number of the Pi-th separator “/” in the URL is represented by Pi, and the value of Pi starts from 1.
At block S3, a backdoor attack mode of the malicious URL detection system is determined based on the position number result, and the backdoor URL samples corresponding to the original URL samples are generated by using the backdoor attack mode.
It may be understood that, in this action, there is a need to select a determined attack mode, For all the original URL samples, by considering the positions and the number of uniform usable separators “/” in all URLs, there is determined a method for generating the backdoor URL sample that is feasible for all original URLs, i.e., the attack mode, such that the attack mode is feasible for all the original URL samples, and then corresponding backdoor URL samples may be generated.
As an implementation,
At block S31, positions of a first number of separator slashes selected from the URLs of the original URL samples are determined, and a position serial number corresponding to each selected separator slash is determined.
At block S32, the backdoor attack mode of the malicious URL detection system is determined based on the position serial numbers and a second number of separator slashes.
At block S33, the backdoor URL samples corresponding to all the original URL samples are generated based on the determined backdoor attack mode.
In detail, an attack mode usable by all the original URL samples is selected.
Positions of m separators selected in all the original URLs are determined. A position serial number corresponding to the i-th separator is represented by Pi, and ni separators are added after Pi to form a specific attack mode, which is represented by:
Further, the backdoor URL samples (U′i, ∀i∈[1, K]) corresponding to all the original URL samples (Ui, ∀i∈[1, K]) are generated based on the selected specific attack mode ƒSBD(·).
At block S4, a training set is constructed based on a preset ratio of the backdoor URL samples, a neural network model is trained by using the training set, and an attack strength of the malicious URL detection system in the backdoor attack mode is tested by using the trained neural network model to obtain a real-time attack success rate.
It is understood that, in this action, the generated backdoor URL samples in a uniform attack mode are added, in a ratio of 1:α (i.e., K·α backdoor URL samples), to the training set used by the malicious URL detection system in a training process of a model, such as the neural network model, to test the attack strength of the backdoor attack method in the specific attack mode.
As an implementation,
At block S41, word features, character features and statistical features of the URL sample in the training set are obtained.
At block S42, the neural network model for processing the character features and the word features is constructed, and the neural network model is trained to obtain a trained neural network model.
At block S43, a multi-feature representation of the word features, the character features and the statistical features of the URL sample is constructed, and a test result of the real-time attack success rate is obtained by inputting the multi-feature representation to the trained neural network model for testing the attack strength of the malicious URL detection system in the backdoor attack mode.
In detail, the word features and the character features of the URL sample are obtained. Each character including special characters in the URL sample, and each string split by the special character may be used as a word extraction feature. Each character feature is encoded as a numeric value, represented by:
In detail, the statistical features of the URL sample are obtained. For the statistical features used by the malicious URL detection system, any statistical feature such as the number of English characters, the number of digits and the number of special characters in the URL, and a ratio of the number of special characters to a total length of the URL, may be added together to constitute the statistical features of one URL sample, which is represented by:
In detail, a network for processing the character features and the word features is constructed. For the character features and the word features of the URL sample, a vector embedding the character and the word is compressed by using a one-dimensional convolutional neural network, which is represented by:
where, ƒconv(·) represents a one-dimensional convolution operation, {right arrow over (k)} represents a convolution kernel of the convolution operation, b represents a bias, {right arrow over (c)} represents an input of the convolution operation, a subscript of {right arrow over (c)} represents an operation range, and vi(c) represents an output of the convolution operation. The convolution operation is performed on the character features and the word features of the URL sample respectively to obtain feature representations, which are represented by:
where, {circumflex over (v)}(c) represents a value obtained by performing one convolution operation and a maximum pooling operation on the character feature, {circumflex over (v)}(w) represents a value obtained by performing one convolution operation and the maximum pooling operation on the word feature, {right arrow over (v)}(c) represents a character feature representation of one URL sample subjected to the convolution operation and the maximum pooling operation, and {right arrow over (v)}(w) represents a word feature representation of one URL sample subjected to the convolution operation and the maximum pooling operation.
In detail, the multi-feature representation of the URL sample is constructed by
integrating the character features, the word features, and the statistical features. The character feature representation, the word feature representation, and the statistical feature representation of the URL sample are spliced together to obtain the multi-feature representation of the URL sample, which is represented by:
where, {right arrow over (v)}(c) represents the obtained word feature representation, {right arrow over (v)}(w) represents the obtained character feature representation, and Us represents the obtained statistical representation of the URL.
In detail, the attack strength of the attack mode selected in the above actions is tested. The obtained multi-feature representation of one URL sample is input into a fully connected network to test the attack success rate, i.e., the real-time attack success rate, of the backdoor attack method for the malicious URL detection system based on a diversity of file paths.
Further, with the method according to embodiments of the disclosure, the backdoor attack mode may be updated in real time based on the obtained real-time attack success rate, to enable the real-time attack success rate to reach a preset attack success rate in the updated backdoor attack mode.
In detail, the attack mode is adjusted based on the attack success rate obtained in the above actions to achieve the attack success rate desired by the attacker.
With the backdoor attack method for the malicious URL detection system according to embodiments of the disclosure, an ingenious backdoor attack method is designed by taking advantage of that a browser is insensitivity to the separator, i.e., the slash, in the URL when parsing the URL by the browser, which may evaluate a vulnerability of the malicious URL detection system forwardly. Moreover, the backdoor attack method is flexible and covert enough to draw the attention of the researcher on a security of the malicious URL detection system.
In order to implement the above embodiments, as illustrated in
The original sample obtaining module 100 is configured to obtain original URL samples of backdoor URL samples to be generated.
The position information numbering module 200 is configured to determine position information of separator slashes in each URL of the original URL sample, and to obtain a position number result by numbering the position information.
The backdoor sample generating module 300 is configured to determine a backdoor attack mode of the malicious URL detection system based on the position number result, and to generate the backdoor URL samples corresponding to the original URL samples by using the backdoor attack mode.
The attack mode testing module 400 is configured to establish a training set based on a preset ratio of the backdoor URL samples, and to train a neural network model by using the training set, and to test an attack strength of the malicious URL detection system in the backdoor attack mode by using the trained neural network model to obtain a real-time attack success rate.
Further, the original sample obtaining module 100 is also configured to:
Further, the backdoor sample generating module 300 is also configured to:
Further, the attack mode testing module 400 is also configured to:
Further, after the attack mode testing module 400, the apparatus also includes: a mode updating module.
The mode updating module is configured to update the backdoor attack mode in real time based on the real-time attack success rate, to enable the real-time attack success rate in the updated backdoor attack mode to reach a preset attack success rate.
With the backdoor attack apparatus for the malicious URL detection system according to embodiments of the disclosure, the backdoor attack mode is designed by taking advantage of the browser's insensitivity to slash characters in the URL when the browser parses the URL, which may evaluate the vulnerability of the malicious URL detection system forwardly. Moreover, the backdoor attack mode is flexible and covert enough to draw the attention of the researcher on the security of the malicious URL detection system.
In the description of this disclosure, reference to the terms “an embodiment”, “some embodiments”, “examples”, “specific examples”, or “some examples” means that the specific feature, structure, material, or characteristic described in combination with the embodiment or example is included in at least one embodiment or example of the disclosure. In this disclosure, schematic representations of the above terms need not be directed to the same embodiments or examples. Moreover, the specific feature, structure, material, or characteristic described may be combined in any one or more of embodiments or examples in a suitable manner. Furthermore, without contradicting each other, those skilled in the art may combine different embodiments or examples described in this disclosure and features of different embodiments or examples.
In addition, the terms “first” and “second” are used to descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with the terms “first” or “second” may explicitly or implicitly include at least one such feature. In the description of the disclosure, “multiple” or “plurality” means at least two, e.g., two and three, unless otherwise limited specifically.
Number | Date | Country | Kind |
---|---|---|---|
202310559925.9 | May 2023 | CN | national |