An online website defense method based on adversarial patches

By adopting adversarial patch technology in Web site fingerprint defense, we determine key traffic areas and generate targeted adversarial patches, real-time injection of adversarial patches is achieved, solving the problem that existing technology cannot be effectively deployed in a real environment, and improving the defense Practicality and adaptability.

CN115225383BActive Publication Date: 2024-11-29SOUTHEAST UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210852629.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2024-11-29
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

The existing defense technology for deep learning Web site fingerprint attacks is mainly offline scenarios and cannot be effectively deployed in a real environment, resulting in poor practicality of Web site fingerprint defense methods.

Method used

Adopting an online Web site defense method based on adversarial patches, we use the determined traffic key areas, generate non-targeted targeted adversarial patches for critical areas, and design an adversarial patch injection scheme to achieve real-time patch injection.

Benefits of technology

It improves the practicality of Web site fingerprint defense technology, enhances the defense success rate, reduces bandwidth overhead and practical overhead, and adapts to changes in network traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115225383B_ABST
    Figure CN115225383B_ABST
Patent Text Reader

Abstract

The present invention discloses an online Web site defense method based on an adversarial patch. The method first calculates the key area of ​​network traffic data; then generates the adversarial patch: firstly, the difference between online and offline defense scenarios is analyzed, and the adversarial patch generation process is restricted, and then a non-targeted adversarial patch generation algorithm for the key area is proposed, and an adversarial patch corresponding to each site is generated; finally, the adversarial patch is injected: the injection process designs a Tor plug-in based on the WFPadTools framework, firstly the plug-in is deployed on the user end and the bridge end of Tor, and then a control message is designed for the communication between the user end and the bridge end, and finally the adversarial patch is injected online according to a predetermined strategy. The present invention improves the practicality of Web site fingerprint defense by utilizing the adversarial patch technology and designing a patch injection scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a website fingerprint defense technology, belongs to the technical field of traffic analysis and anonymity network, and specifically relates to an online website defense method based on an anti-patch. Background Art

[0002] The continuous development of the Internet has led to the continuous innovation of Web technology. The Web carries an increasingly diverse range of services, including a large amount of user privacy data. Web site fingerprint attack is a technology that uses channel analysis to extract target site features and identify sites. First, an anonymous communication system is used to simulate users accessing target regulatory sites to obtain traffic, extract pattern features from the acquired traffic to form fingerprints and establish a model; then the same features are extracted from the anonymous traffic generated by the actual user visit to identify the actual site visited by the user. Therefore, studying its defense technology is of great significance to protecting user privacy. However, the existing defense technologies for deep learning Web site fingerprint attacks are all offline scenarios. The defender needs to obtain a complete traffic data set before theoretically optimizing the defense strategy for a single traffic generation. This makes it impossible to effectively deploy the defense method in a real environment, greatly reducing the practicality of the Web site fingerprint defense method. Summary of the invention

[0003] Purpose of the invention: To address the problem that Web site fingerprint defense technology has poor practicality in real scenarios, the present invention proposes an online Web site defense method based on adversarial patches. The method utilizes adversarial patch technology to construct a universal adversarial patch for each site, and designs an adversarial patch injection scheme to achieve real-time injection of patches.

[0004] The present invention adopts the following technical solution:

[0005] An online website defense method based on an adversarial patch comprises the following steps:

[0006] (1) Determine the key area: Divide the network traffic sequence of the site into multiple areas, calculate the contribution of each area to the classification result, and the area with a higher contribution is called the key area. Determining the key area can help defenders find a good injection location.

[0007] (2) Adversarial patch generation: Analyze the differences between online and offline defense scenarios, restrict the adversarial patch generation process, and generate non-targeted adversarial patches for key areas.

[0008] (3) Anti-patch injection: A Tor plug-in is designed based on the WFPadTools framework and deployed on the Tor user side and bridge side to inject the anti-patch online according to the injection location l.

[0009] Furthermore, the step (1) specifically includes:

[0010] (11) Input the network traffic sequence into the convolutional neural network and obtain the output A of the last convolutional layer and the target label score y c (i.e., the value that has not been processed by softmax). A contains a total of Z feature maps, and the size of each feature map is Z = 1*I. The value of the i-th column in the k-th feature map is

[0011] (12) Use back propagation to calculate the gradient of each value in the feature map As shown in formula (1), the gradient of the feature map Find the average value to get the weight of the feature map As shown in formula (2):

[0012]

[0013]

[0014] (13) After obtaining the weight of the feature map, the value A of each feature map is k With weight After multiplication, add them together to get the contribution f of each point c , the calculation process is shown in formula (3):

[0015]

[0016] (14) Contribution f c Perform ReLU operation to get L c , L c Divide them into multiple groups of length 50, and add up the contribution of each element in the group to get the group contribution.

[0017] Furthermore, the step (2) specifically includes:

[0018] (21) Restrict the patch element value to +1 or -1, and split the patch into multiple small patches, setting the first element of each small patch to -1 and the last element to +1;

[0019] (22) The number of small patches N is calculated by the length L of the network traffic sequence, the bandwidth load percentage B, and the length plen of the small patch, as shown in formula (4):

[0020]

[0021] (23) The critical flow area is obtained through (1), and the key area with the largest contribution of the front group Q is selected to obtain the injection position l;

[0022] (24) Generate the adversarial patch as shown in formula (5):

[0023]

[0024] Where X is the source site traffic dataset, s represents the injection location, ψ represents the patch injection method of the network traffic, and y t Represents the site label, F represents the Web site fingerprint classifier, and the loss function uses the CrossEntropyLoss class cross entropy to update the patch by maximizing the classification loss of the fingerprint classifier.

[0025] Furthermore, the step (3) specifically includes:

[0026] (31) When a user initiates a site access request, the client records the directions of all data packets and generates a real-time data packet sequence;

[0027] (32) When the traffic sequence reaches the injection position, the client first loads the small patch at that position, caches the received uplink data packets into the buffer, and sends the PADDING_START control message and the number of padding messages G to the bridge end;

[0028] (33) After receiving the PADDING_START message, the bridge first sends G-1 PADDING data messages, and finally sends a PADDING_STARTED control message to inform the client that padding has started;

[0029] (34) According to the small patch strategy, both ends send PADDING data packets alternately;

[0030] (35) When the small patch injection is completed, the client sends a PADDING_END message and sends the data packet cached in the Buffer;

[0031] (36) After receiving the PADDING_END message, the bridge sends the data packet cached in the Buffer;

[0032] (37) Repeat the process from (31) to (36) and inject each adversarial patch according to the adversarial patch strategy.

[0033] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:

[0034] 1. Identify the key traffic areas and find the most suitable locations for patch insertion, which improves the success rate of defense while reducing the bandwidth and practical costs caused by defense.

[0035] 2. Most Web site fingerprint defense solutions generate theoretical optimization defense strategies for a single traffic flow. The present invention utilizes anti-patch technology to generate anti-patch common to each site, which can adapt to changes in network traffic caused by network delays and other issues, thereby improving the practicality of Web site fingerprint defense technology.

[0036] 3. Analyze the differences between online and offline defense scenarios, and restrict the generation process of anti-patch, so that the generated defense strategy is more in line with the needs of online scenarios, and also improve the practicality of Web site defense technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the defense scenario of the present invention.

[0038] Figure 2 It is a schematic diagram for determining the key area of ​​the present invention.

[0039] Figure 3 It is a schematic diagram of the anti-patch injection process of the present invention. DETAILED DESCRIPTION

[0040] The present invention designs and implements an online website fingerprint defense technology based on adversarial patches. The technology is divided into three parts, namely, key area determination, adversarial patch generation and adversarial patch injection. Specifically, it includes:

[0041] Identification of key areas

[0042] The network traffic sequence of the site is divided into multiple areas, and the contribution of each area to the classification result is calculated. The area with higher contribution is called the key area. Determining the key area can help defenders find a good injection location and disrupt the traffic sequence inside the area. The key area determination process Figure 2 As shown:

[0043] Input the network traffic sequence into the convolutional neural network and obtain the output A of the last convolutional layer and the target label score y c (i.e., the value that has not been processed by softmax). A contains a total of Z feature maps, and the size of each feature map is Z = 1*I. The value of the i-th column in the k-th feature map is Use back propagation to calculate the gradient of each value in the feature map As shown in formula (1), the gradient of the feature map Find the average value to get the weight of the feature map As shown in formula (2). After obtaining the weight of the feature map, the value A of each feature map is k With weight After multiplication, add them together to get the contribution f of each point c , the calculation process is shown in formula (3).

[0044]

[0045]

[0046]

[0047] Contribution to c Perform ReLU operation to get L c , L c Divide into multiple groups of length 50, and add up the contribution of each element in the group to get the group contribution. The specific algorithm flow is as follows:

[0048]

[0049] Adversarial patch generation

[0050] Adversarial patch technology originates from the field of computer vision and is a method of injecting adversarial perturbations. However, unlike traditional adversarial perturbation methods, the defender is not limited to injecting tiny perturbations that are specific to the original sample and difficult to detect. Instead, the goal is to generate a universal adversarial patch. For the generated patch, no matter where it is placed in any sample, it can make the classifier output the wrong target category. This solution analyzes the differences between online and offline defense scenarios, restricts the adversarial patch generation process, and generates non-targeted adversarial patches for key areas.

[0051] The present invention restricts the traditional adversarial patch generation process so that it can better adapt to the online website fingerprint defense scenario. The specific algorithm flow is as follows:

[0052]

[0053] First, the source site group contribution score Socre is calculated by (1), and then the minimum length L of the site traffic sequence in the source site traffic dataset is calculated, and the original site traffic dataset X w , the length of each small patch p_len, bandwidth load percentage B, number of iterations T, classification model M, and loss function Loss are input into the algorithm as parameters.

[0054] The algorithm first calculates L*B to obtain the maximum number of fill packets that can be injected, and then divides the result by plen to obtain the number of small patches N, that is, small patches need to be injected into N groups, and the size of N does not exceed the total number of groups. The algorithm then initializes N small patches to form a complete adversarial patch, and at the same time selects the group with the largest contribution from the group contribution score to obtain the injection position S. Next, the adversarial patch is injected into each original network traffic sequence according to the injection position S. Specifically, for each key area, the algorithm randomly selects an injection position in the area to inject the small patch. This is because during the online traffic injection process, it cannot be guaranteed that the patch is accurately injected into the specified position. Therefore, the random selection of positions can ensure that the patch is robust to changes in the injection position within the area.

[0055] After that, the algorithm calculates the loss value after the patch is injected, and uses Stochastic Gradient Descent (SGD) to perform back propagation to update the values ​​of the patch elements. In order to apply SGD, this paper relaxes the restrictions on the elements in the patch during the patch optimization process, allowing its value to be a continuous value between [-1, 1]. When the optimization is completed, for elements less than 0 in the patch, this paper changes it to -1, and for elements greater than 0 in the patch, this paper changes it to +1. This approach is widely used to solve discrete optimization problems and ensures that back propagation can proceed smoothly. Finally, iterate T times to generate a common adversarial patch for the site.

[0056] Fighting against patch injection

[0057] The injection of adversarial patches requires the cooperation between the Tor client and the Tor bridge to inject the generated adversarial patch sequence into the traffic sequence in real time according to the patch position. Therefore, this paper uses the WFPadTools open source framework to write a Tor plug-in to achieve network packet delay and virtual packet injection.

[0058] The present invention enables Tor to use custom plug-ins and bridges to transmit network traffic by modifying the torrc file. The core configuration is as follows:

[0059] Client Configuration

[0060]

[0061] Bridge side configuration

[0062] AssumeReachable 1

[0063] PublishServerDescriptor 0

[0064] Exit policy reject*:*

[0065] ORPort 4053

[0066] BridgeRelay 1

[0067] ServerTransportListenAddrMLPatch 0.0.0.0:40535

[0068] ServerTransportPluginMLPatch exec / wfpadtools / bin / obfsproxy\

[0069] --log-min-severity=debug\

[0070] --log-file= / root / mlpatch_server / mlpatch-server.log\

[0071] managed

[0072] The process of anti-patch injection is as follows Figure 3As shown in the figure, there are two states on the client and the bridge, namely the normal state and the filling state. In the normal state, both ends do not delay or fill messages, but only forward the received messages. In the filling state, both ends store the received messages in the buffer and send filling messages to each other. When the user initiates a site access request, the client records the direction of each data packet and generates a real-time data packet sequence. Once the traffic sequence reaches the filling point, the client first loads the anti-patch and switches the client state to the filling state. It caches the received uplink data packets in the buffer and finally sends the PADDING_START control message and the number of filling messages G to the bridge. After receiving the PADDING_START message, the bridge first changes its state to the filling state, and then sends G-1 PADDING data messages. The last message sends PADDING_STARTED to inform the client that the filling has started and the first segment of the message has been sent. After receiving the PADDING_STARTED message, the client continues to send PADDING messages according to the anti-patch strategy. Finally, when the patch filling is completed, the client sends a PADDING_END message, switches the client state to the normal state, and sends the data packets cached in the buffer. After receiving the PADDING_END message, the bridge also switches the state to the normal state and sends the data packets cached in the buffer. The injection of a small patch is completed. For each small patch in the patch, the above operation is repeated to finally complete the anti-patch injection.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than to limit its protection scope. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present application, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the protection scope of the claims to be approved.

Claims

1. An online website defense method based on adversarial patches, characterized in that: The method comprises the following steps: (1) Calculating the key areas of network traffic data: The key area calculation process divides the network traffic sequence of the site into multiple areas, and calculates the group contribution of each area to the classification result, where the area with a higher group contribution is called a key area; the specific process of step (1) is as follows: (11) Input the network traffic sequence into the convolutional neural network and obtain the output A of the last convolutional layer and the target label score y c ; A contains a total of Z feature maps, the size of each feature map is Z = 1*I, and the value of the oth column in the kth feature map is (12) Use back propagation to calculate the gradient of each value in the feature map As shown in formula (1), the gradient of the feature map Find the average value to get the weight of the feature map As shown in formula (2): (13) After obtaining the weight of the feature map, the value A of each feature map is k With weight After multiplication, add them together to get the contribution f of each point c , the calculation process is shown in formula (3): (14) Contribution f c Perform ReLU operation to get L c , L c Divide into multiple groups of length 50, and add up the contribution of each element in the group to get the group contribution; (2) Generate adversarial patches: First, analyze the differences between online and offline defense scenarios, restrict the adversarial patch generation process, and then propose a non-targeted adversarial patch generation algorithm for key areas, and generate a corresponding adversarial patch for each site. The step (2) specifically comprises: (21) Restrict the patch element value to +1 or -1, and split the patch into multiple small patches, setting the first element of each small patch to -1 and the last element to +1; (22) The number of small patches N is calculated by the length L of the network traffic sequence, the bandwidth load percentage B, and the length plen of the small patch, as shown in formula (4): (23) The critical flow area is obtained through (1), and the key area with the largest contribution of the front group Q is selected to obtain the injection position l; (24) Generate the adversarial patch as shown in formula (5): Where X is the source site traffic dataset, s represents the injection location, ψ represents the patch injection method of the network traffic, and y t represents the site label, F represents the Web site fingerprint classifier, and the loss function uses the CrossEntropyLoss class cross entropy to update the patch by maximizing the classification loss of the fingerprint classifier; (3) Injecting the anti-patch: The injection process is based on the design of the Tor plug-in based on the WFPadTools framework. First, the plug-in is deployed on the Tor user side and the bridge side. Then, the control message is designed for the communication between the user side and the bridge side. Finally, the anti-patch is injected online according to the established strategy. The step (3) specifically comprises: (31) When a user initiates a site access request, the client records the directions of all data packets and generates a real-time data packet sequence; (32) When the traffic sequence reaches the injection position, the client first loads the small patch at that position, caches the received uplink data packets into the buffer, and sends the PADDING_START control message and the number of padding messages G to the bridge end; (33) After receiving the PADDING_START message, the bridge first sends G-1 PADDING data messages, and finally sends a PADDING_STARTED control message to inform the client that padding has started; (34) According to the small patch strategy, both ends send PADDING data packets alternately; (35) When the small patch injection is completed, the client sends a PADDING_END message and sends the data packet cached in the Buffer; (36) After receiving the PADDING_END message, the bridge sends the data packet cached in the Buffer; (37) Repeat the process from (31) to (36) and inject each adversarial patch according to the adversarial patch strategy.

Citation Information

Patent Citations

  • Small adversarial patch generation method and device

    CN112241790A

  • Encrypted traffic analysis defense method and system based on adversarial attack algorithm

    CN113938291A

  • Network attack defense system and method

    US20180026994A1