A multi-domain hidden service website fingerprint attack method based on attention mechanism

Through the dual-channel structure 1D-CNN-LSTM network based on the attention mechanism and the cloud server Tor proxy system, the accuracy problems in the fingerprint attack of multi-domain Tor hidden service websites and the unknown domain name identification in the open world scenario are solved, achieving higher attack accuracy and lower attack costs.

CN116405296BActive Publication Date: 2025-10-03SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310394694.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2025-10-03
Estimated Expiration
2043-04-13

AI Technical Summary

Technical Problem

Existing Tor hidden service website fingerprint attack methods are difficult to accurately identify the websites visited by users in multi-domain scenarios, and attackers find it difficult to identify unknown domain name traffic in open world scenarios.

Method used

A dual-channel 1D-CNN-LSTM network based on the attention mechanism is adopted. 1D-CNN extracts spatial features from traffic patterns, and LSTM extracts temporal features from traffic data. The spatiotemporal features are combined to carry out website fingerprint attacks in multi-domain scenarios. A traffic collection system is built using cloud servers and Tor proxies to realize the collection and classification of domain names for multi-domain hidden services.

Benefits of technology

It improves the accuracy of website fingerprint attacks in multi-domain scenarios and can identify unknown domain name traffic in open world scenarios, reducing attack costs and improving identification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405296B_ABST
    Figure CN116405296B_ABST
Patent Text Reader

Abstract

The present invention relates to a multi-domain hidden service website fingerprint attack method based on a dual-channel structure. By constructing a multi-domain hidden service traffic collection system based on a cloud server, domain name collection and classification, traffic collection, and data preprocessing of Tor version 3 multi-domain hidden services are completed. Based on the differences in hidden service loading behavior, a new input is proposed, and a dual-channel website fingerprint attack method is designed. The spatial feature information and temporal feature information in different channel inputs are extracted through a convolutional neural network and a long short-term memory model respectively. The two features are spliced ​​and fused and sent to the classification network, thereby improving the website fingerprint attack method's feature learning ability for different domain names belonging to the same site. This scheme captures the spatiotemporal features of each different domain name traffic of the hidden service site through a parallel dual-channel structure and combines the features, thereby improving the accuracy of hidden service website fingerprint attacks in a multi-domain complex feature environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a multi-domain hidden service website fingerprint attack method based on an attention mechanism, which belongs to the field of cyberspace security and is specifically applied to perform website fingerprint attacks on multi-domain scenarios of third-version hidden services in a Tor network. Background Art

[0002] In recent years, with the rapid development of the internet, users have become increasingly engaged in online activities, and their demand for privacy protection has grown stronger. Tor, a communication tool that uses onion routing to ensure user anonymity, is used by approximately 3,000,000 users worldwide. It provides access to anonymous sites called hidden services, which are often the site of illegal and criminal activities. Users can use hidden services under Tor's claimed anonymity protection mechanism without worrying about their privacy being compromised.

[0003] However, Tor's anonymity isn't as strong as it promises. Current attacks against Tor hidden services are primarily categorized as active and passive. Compared to active attacks, which disrupt the normal communication process of the Tor network by controlling malicious nodes and continuously attempting to connect to hidden services, passive attacks analyze Tor traffic to identify websites visited by users without disrupting normal data transmission, offering greater stealth. Passive attacks primarily include flow correlation attacks and website fingerprinting attacks (WF). The former requires attackers to capture both ingress (from the client to the ingress node) and egress (from the egress node to the destination) traffic and analyze their correlations to obtain user access information. The latter, on the other hand, only requires capturing encrypted traffic between the client and the ingress node to analyze the websites visited by users, making it more popular with attackers.

[0004] In recent years, numerous studies on deanonymization attacks against Tor have demonstrated the effectiveness of WF attacks. Most previous work primarily used machine learning methods to identify the content users access on the Tor browser by manually extracting features from Tor traffic. The rapid development of deep learning in recent years has led to the rapid application of deep learning methods in the field of WF attacks. WF attacks based on deep learning methods can automatically process raw traffic and automatically extract features from it, eliminating the need for manual feature extraction through expert knowledge. These attacks exhibit excellent adaptability and generalization capabilities. However, most of these studies focus on fingerprinting surface websites (sites accessible without using anonymizing networks), while relatively few studies have specifically targeted hidden service attacks. Attacks targeting hidden service sites are more practical for regulating cybercrime.

[0005] The difficulty in fingerprinting hidden service sites lies in identifying the websites a user is visiting in a multi-domain environment. This refers to the fact that some hidden service sites use multiple domain names to evade regulation and Web Forwarding (WF) attacks, preventing their sites from being shut down. After October 15, 2021, Tor officially fully implemented version 3 of the onion domain system. The phenomenon of multiple domain names for the same website becoming increasingly common in the version 3 domain system has become increasingly prevalent. Our research found that a large number of hidden service sites with multiple domain names exist in the Tor version 3 domain system. Of the 343 unique sites, 97, or 28.3%, have more than one domain name. However, these 28.3% of sites have 14,834 domain names. After removing inaccessible domain names, this represents 98.4% of the total. The existence of multiple domain names poses new challenges to identifying hidden service sites in this scenario. First, because each access link to a hidden service in the Tor network randomly selects an onion route, different domain names may be hosted on different types of servers (e.g., multi-origin servers). This means that even if multiple domains point to the same website, the statistical characteristics implied by their captured traffic will vary (for example, response time, number of packets, etc.). This difference in traffic characteristics requires attack methods in multi-domain scenarios to learn features specific to each specific domain's traffic, thereby attributing traffic from different domains to the same website. Can attack models that perform well in single-domain scenarios maintain high attack accuracy in multi-domain scenarios? Secondly, in more realistic open-world scenarios, when each hidden service site in the monitoring set contains multiple different domains, can website fingerprinting attack methods still accurately classify sites given the diverse characteristics of multi-domain traffic? Finally, during the data collection process, it is difficult for an attacker to exhaustively collect traffic from all domains belonging to a specific HS. More realistically, an attacker may only have access to certain domains of a specific HS site. In this limited scenario, the ability of an attack method to identify traffic from unknown domains becomes a key metric for evaluating the method. Specifically, when trained on only a subset of the domains of a HS site, can the attack method accurately identify untrained, unknown domains?

[0006] To address these issues, we propose a fingerprint attack method for multi-domain Tor hidden service websites based on a dual-channel 1D-CNN-LSTM network. Our method utilizes a 1D-CNN to extract abstract feature information from traffic patterns across different domains and reduce the feature dimensions. It also utilizes an LSTM network to extract temporal information from traffic data. Furthermore, our method uses feature fusion to extract spatiotemporal features from traffic across different domains using the 1D-CNN-LSTM network. This method then concatenates and fuses these two features, enabling the model to better learn more granular features in multi-domain scenarios, improving the accuracy of attacks against these websites. Summary of the Invention

[0007] This paper uses Tor website fingerprinting attacks as a research scenario and examines the multi-domain presence of Tor version 3 hidden services. Based on the traffic collection and analysis of Tor version 3 multi-domain hidden services, a multi-domain hidden service website fingerprinting attack method based on an attention mechanism is proposed. This method effectively identifies unknown domain names of hidden services while ensuring attack accuracy during Tor multi-domain hidden service website fingerprinting attacks. The domain name collection and classification, traffic collection, and data preprocessing processes for multi-domain hidden services primarily include building a cloud server-based domain name collection and classification algorithm for multi-domain hidden services, a traffic collection system, Tor multi-domain hidden service traffic collection, and Tor multi-domain hidden service traffic data preprocessing. The dual-channel multi-domain hidden service website fingerprinting attack method, based on a 1D-CNN and LSTM network, captures the spatiotemporal characteristics of traffic for each different domain name of the hidden service site through a parallel dual-channel structure and combines these features, thereby improving the accuracy of hidden service website fingerprinting attacks in complex multi-domain feature environments.

[0008] To achieve the above objectives, the technical solution of the present invention is as follows: a fingerprint attack method for multi-domain hidden service websites based on an attention mechanism, the method comprising the following three main steps:

[0009] S1: Domain name collection and classification of multiple hidden services;

[0010] S2: Multi-domain hidden service traffic collection and data preprocessing;

[0011] S3: Multi-domain hidden service website fingerprint attack;

[0012] S1: Domain name collection and classification of multiple hidden services. This process is divided into three steps: hidden service domain name acquisition, domain name HTML resource acquisition, and multi-domain attribute classification.

[0013] S11: Obtaining the hidden service domain name. The specific process is divided into two steps: crawling the hidden service search engine storage domain name and filtering the domain name version;

[0014] (1) Crawl the hidden service search engine storage domain name. The specific steps are as follows:

[0015] a) Collect a large number of publicly accessible hidden service search engines in the Tor network;

[0016] b) Install a crawler script to obtain the hidden service domain names stored by the search engine;

[0017] (2) Domain name version filtering, the specific steps are as follows:

[0018] a) Set the hidden service domain name version check rule: filter those with a length of less than 56 characters;

[0019] b) Run the script to check the domain name version according to the rules and filter out non-third version domain names;

[0020] c) Organize and form the third version of the hidden service domain name list;

[0021] S12: Obtaining HTML resources from the domain name. The specific process is divided into three steps: deploying the Tor proxy, accessing the hidden service domain name, and obtaining HTML resources from the domain name.

[0022] (1) Deploy the Tor proxy. The specific steps are as follows:

[0023] a) Select a cloud server as the Tor proxy;

[0024] b) Install the Tor proxy program to create an accessible Tor network for the cloud server;

[0025] (2) Hide service domain name access, the specific steps are as follows:

[0026] a) Install Selenium and pyautoGUI tools and configure the corresponding operating environment;

[0027] b) The installation script accesses the third version of the hidden service domain name list;

[0028] (3) Obtaining domain name HTML resources. The specific steps are as follows:

[0029] a) Access the domain name and store the HTML resource file of the domain name;

[0030] b) Extract the HTML resource file of each domain name <title>attribute value;< / title>

[0031] S13: Multiple domain names are classified by attributes. Algorithm 1 shows the algorithm for constructing a hidden service multi-domain list. The specific process is divided into two steps: <title> Same value classification and Simhash calculation, hidden service multi-domain list construction;< / title>

[0032] (1) <title> The specific steps for same value classification and Simhash calculation are as follows:< / title>

[0033] a) Write a script to check the value of the same attribute <title> Group and classify;< / title>

[0034] b) Perform Simhash calculation on the HTML resource file of each domain name in each group;

[0035] (2) Constructing a list of multiple hidden service domain names. The specific steps are as follows:

[0036] a) Write a script, set the same website classification threshold to 0.3, and compare the Simhash results of each group;

[0037] b) retain all domains with a comparison result of no more than 0.3, and remove all domains with a comparison result of more than 0.3;

[0038] c) Organize and form a third version of the hidden service multi-domain list;

[0039]

[0040] S2: Multi-domain hidden service traffic collection and data preprocessing. The multi-domain hidden service traffic collection system constructed by this method is as follows: Figure 1 The process is divided into three steps: building a multi-domain traffic collection system based on cloud servers and Tor proxies, and preprocessing multi-domain hidden service traffic data.

[0041] S21: Build a multi-domain traffic collection system based on cloud servers and Tor proxies. The specific process is divided into the following four steps:

[0042] (1) Traffic generation end configuration, the specific steps are as follows:

[0043] a) Install a script to control the browser to simulate user access behavior and access the domain names in the hidden service's multi-domain list in sequence;

[0044] b) Feedback the hidden service site access status to the Tor proxy server and record access log information;

[0045] (2) Traffic collection terminal configuration, the specific steps are as follows:

[0046] a) Configure the Tor proxy environment on a cloud server that is different from the client. You can choose cloud servers in multiple geographical locations to configure the Tor proxy environment simultaneously.

[0047] b) Check the accessibility of the Tor network;

[0048] c) Read the access status feedback from the traffic generation end and perform corresponding operations;

[0049] (3) Domain name accessibility check, the specific steps are as follows:

[0050] a) Conduct a few full-list traversal accesses on the third version of the hidden service domain name list obtained in S13;

[0051] b) Check the access status feedback and access logs, and screen out inaccessible domain names;

[0052] c) Rearrange the domain name list and construct a sub-list of accessible third version of the hidden service domain names;

[0053] d) This step needs to be executed during each traffic collection process to ensure that the collected traffic is valid traffic generated by accessible sites;

[0054] (4) Connectivity test: After fully executing the processes of (1) to (3), correctly and orderly constructing the traffic generation end and traffic collection end, and completing the domain name accessibility check, test the connectivity of the multi-domain hidden service traffic collection system. The judgment condition for passing the connectivity test is: The script can correctly and orderly read the domain name list, operate the browser to connect to the Tor proxy, then successfully access the hidden service through the Tor proxy, and prove that the service is accessible by judging the feedback access information, which indicates that the traffic collection system has correct execution logic and effective connectivity.

[0055] S22: Multi-domain hidden service traffic collection. Specifically, it is divided into 3 steps: multi-domain hidden service access traffic generation, multi-domain hidden service traffic collection, and multi-domain hidden service invalid traffic supplement collection;

[0056] (1) Multi-domain hidden service access traffic generation, Algorithm 2 shows the process of the multi-domain hidden service access traffic generation script, and the specific steps are as follows:

[0057] a) The script uses tools to simulate the network behavior of real users accessing hidden services, including operations such as domain name input, mouse clicks, and content searches, to generate the user's network access traffic;

[0058] b) Read the domain name list and start accessing the hidden service site; record the access information (record the group serial number where the traffic is located, domain name label, and specific domain name url), and feedback the website access status information to the traffic collection end.

[0059] c) Record the <title attribute> in the html resource file read during each domain name access

[0060]

[0061]

[0062] (2) Multi-domain hidden service traffic collection,Algorithm 3 shows the process of the multi-domain hidden service traffic collection script. The specific steps are as follows:

[0063] a) Initialize Tor proxy and establish Tor proxy access line;

[0064] b) Receive the status code feedback from the traffic generation end. There are three status codes: RUN indicates that the traffic collection tool has started running and the traffic collection process has started; OVER indicates that the current round of traffic collection has ended and the collection process is aborted, waiting for the next instruction; KILL indicates that the traffic collection end process has terminated, the traffic collection process has completely exited, all states are cleared, and the process returns to the initialization stage;

[0065] c) Store the traffic and name it with the formula "hidden service site number - domain name number of the collected traffic + collection time";

[0066]

[0067]

[0068] (3) Re-collection of invalid traffic from multi-domain hidden services. Due to the unstable accessibility of hidden service sites, some sites or domain names may be inaccessible in each round of traffic collection. Therefore, it is necessary to re-collect the domain name traffic that is missing after filtering. Algorithm 4 shows the invalid traffic re-collection process. The specific steps are as follows:

[0069] a) Invalid traffic records: all domain names with HTTP status codes of 4xx and 5xx, domain names clearly marked as "Timeout" in the log, and domain names that read <title> Domain names with blank attributes are organized into a new domain name queue;< / title>

[0070] b) revisit the invalid traffic and collect the corresponding traffic; meanwhile, record the invalid traffic that still has errors during the revisit;

[0071] c) Repeat a) and b) until the invalid traffic domain name queue is empty; if the invalid traffic domain name queue is still not empty, proceed

[0072] d) operation;

[0073] d) After several rounds of supplementary procurement are completed, if the invalid traffic domain name queue is still not empty, the remaining invalid traffic domain names will be replaced to ensure that all invalid traffic can be supplemented within a limited number of rounds of supplementary procurement.

[0074]

[0075] S23: Preprocessing of multi-domain hidden service traffic data. This is divided into five steps: traffic filtering, stream selection, data representation conversion, labeled data, and input construction.

[0076] (1) Traffic filtering: The original traffic contains a large amount of background traffic, which will seriously interfere with the automatic feature learning ability of the attack method. Therefore, the original traffic needs to be pre-screened and filtered. The specific steps are as follows:

[0077] a) Split the original traffic according to the five-tuple rule (Source IP Address, Source Port Number, Destination IP Address, Destination Port Number and The Layer 4 Protocol), and the fine-grained split is bidirectional flow (that is, Source / Destination IP Address and Source / Destination Port Number in the five-tuple).

[0078] After the numbers are swapped in order, they are considered to be the same stream);

[0079] b) Based on prior knowledge of the client and Tor entry node IP addresses, filter out background traffic that does not belong to any of these IP addresses;

[0080] (2) Flow selection. After traffic filtering, each domain name traffic contains multiple flow data with the same five-tuple. For the attack method, only one data is needed as the representative of the domain name, so we need to select multiple flows with the same five-tuple. To retain more information about the domain name traffic, we select the flow with the largest size as the representative of the domain name and delete all other flow data.

[0081] (3) Data representation conversion. The file format of the streaming data is pcap format. Data in this format cannot be used as input by deep learning attack methods. Therefore, it is necessary to convert the streaming data in pcap format into a data representation. Since our model has a parallel learning mechanism of two different modules, it requires two different forms of input. The specific steps are as follows:

[0082] a) Calculate the number of data packets contained in the entire bidirectional flow;

[0083] b) Divide the total number of packets in the bidirectional flow by 100 to obtain the number of packets per hundredth;

[0084] c) taking out every hundredth of the total number of data packets in sequence for processing;

[0085] d) extracting IP layer and TCP layer header information of the data packet, including data packet direction information, TCP payload size information, etc., and accumulating the TCP payload size of the data packet extracted in c) according to the data packet direction. A positive accumulation is recorded when the destination IP address points to the source IP address, and a negative accumulation is recorded when the source IP address points to the destination IP address. The result of this step is the cumulative sum of the TCP payload size of each hundredth of the data packet;

[0086] e) Count the number of packets in c) that are directed from the source IP address to the destination IP address, and count the number of times the direction of the packets changes;

[0087] f) Concatenate the calculated feature data for each hundredth bit, and use the cumulative sum of the TCP payload size of each hundredth bit of data packet as the input of the CNN branch in the model. The cumulative sum of the TCP payload size of each hundredth bit of data packet, the direction (the number of directions from the source IP address to the destination IP address), and the number of direction changes are sequentially concatenated (a total of 300 bits).

[0088]

[0089]

[0090] (4) Label the data. Associate the labels with the traffic data in the form of "feature data, hidden service station number" obtained in (3) and save them into a CSV file by row. This step will generate two CSV files.

[0091] (5) Input construction, and perform RobustScaler normalization on the numerical data obtained in (4).

[0092] S3: Multi-domain hidden service website fingerprint attack. The structure of the multi-domain hidden service website fingerprint attack method constructed by this method is as follows: Figure 2 The process is divided into two steps: building a 1D-CNN-LSTM network structure based on a dual-channel structure and attacking multiple hidden service websites.

[0093] S31: Construct a 1D-CNN-LSTM network structure based on a dual-channel structure, which is divided into two steps:

[0094] (1) Construction of dual-channel 1D-CNN-LSTM network structure. The specific steps are as follows:

[0095] a) Determine the 1D-CNN structure, including the location and number of convolutional layers, the location and number of pooling layers, the type of pooling operations, and the corresponding operations to avoid overfitting;

[0096] b) Determine the LSTM structure, including the number of LSTM units, the number of LSTM layers, and the return value type;

[0097] c) Connect the 1D-CNN structure and LSTM structure for testing;

[0098] d) Fine-tune the network structure based on the test results (not involving hyperparameter tuning);

[0099] e) Determine the final 1D-CNN-LSTM network structure;

[0100] (2) Hyperparameter tuning. The specific steps are as follows:

[0101] a) Determine the hyperparameters that need to be tuned;

[0102] b) Determine the range of values ​​for each hyperparameter tuning;

[0103] c) Grid search method is used to determine the optimal value of each hyperparameter;

[0104] d) adjusting the attack method based on the values ​​determined by the grid search method;

[0105] S32: Multi-domain hidden service website fingerprint attack. This process selects different task teams to perform fingerprint attacks on multi-domain hidden service websites to verify the effectiveness of the method of the present invention in a multi-domain scenario. It is specifically divided into the following three steps:

[0106] (1) Dataset splitting: Split the preprocessed dataset in step S23 into a training set, a validation set, and a test set in a ratio of 8:1:1;

[0107] (2) Closed-world environment testing: All data in a closed-world environment comes from the attacker's data set, also known as the monitoring set. In the method of the present invention, all domain name traffic data in the data set is used to divide the test set into the training set and the test set. For the attack method, all data is known. The specific steps are as follows:

[0108] a) Testing the impact of changes in the number of website domain names on the performance of the multi-domain hidden service website fingerprinting attack method. We fixed the number of websites to be attacked by the website fingerprinting attack method and varied the number of domain names included in a single hidden service site sample. This allowed us to evaluate the performance impact of changes in the number of domain names included in the sample on the multi-domain hidden service site fingerprinting attack method, assuming the total number of samples for a single hidden service site remained the same.

[0109] b) Testing the impact of changes in the number of attacked websites on the performance of the multi-domain hidden service website fingerprinting attack method. We fixed the number of different domains contained in each hidden service site sample and varied the number of hidden service sites that the attack method needed to identify. This allowed us to evaluate the performance impact of changes in the number of attacked hidden service sites on the multi-domain website fingerprinting attack method, assuming the number of domains in the sample remained the same.

[0110] (3) Open-world environment testing: In an open-world environment, the attacker controls a portion of the data, called the monitoring set. The attacker completes model training and verification on the monitoring set. However, during the testing phase, in addition to the samples extracted from the monitoring set controlled by the attacker, there is also data that the attacker does not control, namely the non-monitoring set. The attack method needs to complete the binary classification task of the monitoring set and the non-monitoring set. The open-world scenario is more realistic and focuses on the effectiveness of the attack method.

[0111] (4) Unknown domain name detection. The attacker’s ability to collect hidden service domain names is limited. As hidden service domain names are continuously updated and expanded, the proportion of domain names controlled by the attacker to all hidden service site domain names in the Tor network will continue to decline. In this case, the ability of the attack method to identify unknown domain names becomes an important criterion for evaluating multi-domain hidden service attacks. The specific steps are as follows:

[0112] a) Dataset isolation: The training set and test set are strictly separated. That is, there is no domain overlap between the training set (including the validation set split from the training set) and the test set. Domain names in the test set will never appear in the training set, ensuring that the attack method is completely unknown to the domain name traffic data in the test set.

[0113] b) Attack method optimization: using the training set and validation set to obtain the optimal attack method on the training set;

[0114] c) Attack method testing: Testing is performed on a test set of domain name data that is completely unknown to the attack method to evaluate the performance of our multi-domain hidden service website fingerprint attack method when facing unknown domain names.

[0115] Compared with the prior art, the advantages of the present invention are as follows:

[0116] This paper proposes a multi-domain hidden service website fingerprint attack method based on the attention mechanism. Compared with other Tor hidden service website fingerprint attack methods, this method has the following advantages:

[0117] (1) This solution builds a multi-domain hidden service traffic collection system based on cloud servers and Tor proxies. 1) The multi-domain identification and attribute classification of hidden services provide a reliable multi-domain list of hidden services for the traffic collection system; 2) The traffic collection system accesses the real and effective Tor network by deploying Tor proxies, and does not make any unnecessary configuration changes to the Tor network, ensuring that the communication traffic between the client and the entry node captured is real and effective; 3) The traffic collection part is deployed on cloud servers in multiple different geographical locations, which simulates the network conditions of users in different geographical locations in a near-real way, ensuring that the captured traffic has a stronger breadth; 4) This system is friendly to any node in the Tor network, does not attack, control, or modify any node, reduces the deployment cost of attackers, and has good feasibility and high practicality;

[0118] (2) This scheme designs an input based on hidden service loading behavior and a website fingerprint attack method based on multi-domain hidden services. The input based on hidden service loading behavior consists of: the cumulative and concatenated TCP payload size of each hundredth packet as the input of the CNN branch in the model, the cumulative sum of the TCP payload size of each hundredth packet, the number of directions from the source IP address to the destination IP address, and the number of direction changes. Step S31 constructs a 1D-CNN-LSTM network structure based on a dual-channel structure. The advantages of this network structure are: 1) 1D-CNN extracts the spatial features of the previous and next packets from the perspective of the spatial information of the traffic packets; 2) LSTM further extracts the temporal features between the traffic packets from the perspective of the temporal logical relationship between the previous and next packets; 3) The fusion of spatiotemporal features provides the attack method with a multi-angle feature learning approach, which improves the feature learning depth of the attack method for the site in the scenario where multiple domain names introduce diverse features;

[0119] (3) This scheme discusses the closed world and open world scenarios of traditional website fingerprint attacks. In the closed world scenario, by controlling the variable method, it is discussed whether the introduction of more domain names into the training set will help the attack method to more accurately classify and identify hidden service sites when the number of attacked hidden service sites remains unchanged. It is also discussed whether the multi-domain scenario can provide the attack method with more stable identification accuracy when the number of attacked hidden service sites increases compared to the single-domain scenario when the number of domain names contained in the site remains unchanged. The open world scenario verifies the effectiveness of the attack method in a more realistic scenario through the binary classification task of the monitored set and the non-monitored set.

[0120] (4) The scheme also further discusses a more realistic scenario: when the attacker's ability to collect domain names is limited, can the attack method identify unknown domain names with high accuracy by only training some domain names of hidden service sites? The S32 step passed the test, which strongly proved that our method can detect unknown domain names with high attack accuracy, further illustrating that our method provides better applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0121] Figure 1 : Structure diagram of multi-domain hidden service traffic collection system based on cloud server and Tor proxy;

[0122] Figure 2 : Flowchart of constructing a hidden service multi-domain name list in the embodiment;

[0123] Figure 3 : Flowchart of the flow generation end of the flow collection system in the embodiment;

[0124] Figure 4 : Flow chart of the flow collection end of the flow collection system in the embodiment;

[0125] Figure 5 : Flowchart of flow preprocessing in the embodiment;

[0126] Figure 6 : Input data processing flow chart in the embodiment;

[0127] Figure 7 : Schematic diagram of the 1D-CNN-LSTM network structure based on dual channels. DETAILED DESCRIPTION

[0128] The technical solutions in the embodiments are described in detail below in conjunction with the accompanying drawings of the present invention. Obviously, the embodiment described below is only one embodiment of the method of the present invention, and not all embodiments. Based on the following embodiment, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0129] Example 1: See Figures 1 to 7 This paper presents a multi-domain hidden service website fingerprint attack method based on an attention mechanism. The implementation process of this invention is divided into three main steps: domain name collection and classification of multi-domain hidden services, multi-domain hidden service traffic collection and data preprocessing, and multi-domain hidden service website fingerprint attack.

[0130] S1: Domain name collection and classification of multiple hidden services. This implementation process is divided into three steps: hidden service domain name acquisition, domain name HTML resource acquisition, and multiple domain name attribute classification.

[0131] S11: Obtaining the hidden service domain name. This implementation process includes two steps: crawling the hidden service search engine storage domain name and filtering the domain name version;

[0132] (1) Crawling the domain names stored by hidden service search engines. As shown in Table 1, we collected three accessible, public, and large hidden service search engines through Tor Browser. We used Selenium and PyautoGUI crawler technologies to crawl the domain names of these three search engines.

[0133] Table 1 List of hidden service search engines

[0134]

[0135] (2) Domain name version filtering. Although Tor has officially abandoned the second version of the hidden service domain name, these websites still have a large amount of second version domain name data (some second version domain names provide a way to jump to the third version, and we did not continue to crawl the jump link here). Based on the difference in domain name length between the second and third versions, we only retain domain names with a length of 56 characters (a feature of the third version). After screening in this embodiment, a total of 34,676 third version hidden service domain names were obtained;

[0136] S12: Obtaining HTML resources from the domain name. This implementation process includes three steps: deploying a Tor proxy, accessing the hidden service domain name, and obtaining HTML resources from the domain name. This section overlaps with the multi-domain traffic collection system, so we will only briefly explain it here. The detailed steps will be introduced in S21.

[0137] (1) Deploy Tor proxy. Select one of the cloud servers we have as the Tor proxy, configure the corresponding environment, install the Tor proxy program, and create an accessible Tor network environment for the cloud server;

[0138] (2) Hidden service domain name access. Install Selenium and pyautoGUI tools and configure the corresponding operating environment; install the crawler script to access the third version of the hidden service domain name list collected in S11;

[0139] (3) HTML resource acquisition.

[0140] a) Install the geckodriver driver and use Selenium to simulate user behavior to access the third version of the hidden service domain name collected above;

[0141] b) Extract the HTML resource file of each domain name <title> attribute value;< / title>

[0142] S13: Multiple domain names are classified by attributes. The script process is as follows Figure 2 The implementation process consists of two steps: <title> Same value classification and Simhash calculation, hidden service multi-domain name list construction.< / title>

[0143] (1) <title> The specific steps for same value classification and Simhash calculation are as follows:< / title>

[0144] a) Write a script to check the value of the same attribute <title> Group and classify;< / title>

[0145] b) Perform Simhash calculation on the HTML resource file of each domain name in each group;

[0146] (2) Constructing a list of multiple hidden service domain names. The specific steps are as follows:

[0147] a) Write a script, set the same website classification threshold to 0.3, and compare the Simhash results of each group;

[0148] b) retain all domains with a comparison result of no more than 0.3, and remove all domains with a comparison result of more than 0.3;

[0149] c) Organize and create the third version of the hidden service multi-domain list murl.txt;

[0150] d) This embodiment obtained a total of 34,676 domain names, of which 33,207 met the multi-domain requirement. There were a total of 1,586 different hidden service sites, of which 586 met the multi-domain requirement.

[0151] e) S21: Build a multi-domain traffic collection system based on cloud servers and Tor proxies. The entire system structure is as follows Figure 1 The implementation process consists of three steps: device selection, traffic generation and collection environment configuration, and Tor network connectivity testing.

[0152] (1) Device selection. To simulate the differences in access environments for users in different geographical locations accessing the Tor network, this example rents four cloud servers from the RackNerd platform. Each cloud server has an independent public IP address, an operating system running Ubuntu 18.04 64-bit, 2.5 GB of memory, and a 50 GB hard drive. The locations are Los Angeles, Chicago, and Seattle, respectively.

[0153] (2) Collection environment configuration. Configure the complete operating environment required for traffic generation and traffic collection scripts on the cloud server. This process includes three steps:

[0154] a) Install the traffic capture tool tcpdump on each cloud server;

[0155] b) Install Firefox browser on each cloud server;

[0156] c) Install the Python 3 runtime environment on each cloud server and configure all required Python modules, including but not limited to:

[0157] selenium, requests, logging, json.

[0158] (3) Tor network connectivity test. The cloud server, which serves as the traffic collection end, needs to test the connectivity of the Tor network and verify the accessibility of hidden services. The specific installation process is divided into three steps:

[0159] a) Use SSH to remotely log in to each cloud server and set the hosts.allow and hosts.deny files to restrict the IP addresses that can access the cloud server (usually the server that generates traffic) to prevent the cloud server from being controlled by malicious attackers;

[0160] b) Download the Tor proxy service source code (torrc) from Tor's official website and complete all necessary installation and environment configuration on the cloud server, including but not limited to: listening IP and port, connection type, and allowed IP range;

[0161] c) Test network connectivity: Set the remote proxy address of the Firefox browser installed and configured on the server that generates traffic to the listening IP and port of the Tor proxy on the traffic collection end. If the traffic generation server can access and effectively load any hidden service domain name, it means that the Tor network is configured correctly.

[0162] S22: Multi-domain hidden service traffic collection. This implementation process includes three steps: generating multi-domain hidden service access traffic, collecting multi-domain hidden service traffic, and supplementing with invalid traffic from multi-domain hidden services.

[0163] (1) Generate traffic for multi-domain hidden services. According to the specific needs of website access, write a traffic generation script for multi-domain hidden services. The specific process is as follows: Figure 3 To simulate the user's network behavior of accessing hidden services, the Selenium tool is used to automatically operate the browser to access all hidden service domain names in murl.txt. The Python module requests is used to send status information and operation codes to the traffic collection end. The specific steps are as follows:

[0164] a) Download and install the geckodriver that matches the Firefox browser version on the traffic generating server.

[0165] Selenium simulates various network behaviors of users visiting websites by calling APIs in geckodriver, including but not limited to: domain name input, mouse clicks, content search, etc.

[0166] b) Write a Python script to complete the following tasks: initialize the Firefox browser, set the IP and port of the remote proxy server to the IP and port of the Tor proxy service, establish a TCP connection with the traffic collection server,

[0167] Connect and verify the connection;

[0168] c) The traffic generation script runs and sends the status code RUN to the traffic collection terminal to start Tcpdump to start collecting traffic; then calls selenium to read the domain name list murl.txt and start accessing multiple domain name hidden service web pages; each web page access time is 60 seconds; after 60 seconds, the page is closed; record the access information (record the group number of the traffic, domain name label, specific domain name URL, corresponding html resource file <title>< / title>

[0169] The data is sent to the traffic collection end (property value and access error information), and the website access status information OVER is fed back to the traffic collection end, which notifies the collection end to capture and save the traffic.

[0170] d) Further analyze the access error information, record the multi-domain URLs and serial numbers of the access errors, queue the corresponding multi-domain URLs and serial numbers, and generate an access error domain name queue; this queue will be used in the subsequent invalid traffic re-collection process.

[0171] (2) Multi-domain hidden service traffic collection. The collection script process is as follows Figure 4 As shown, the process includes the following 4 steps:

[0172] a) Initialize the Tor proxy service, record the IP address and port number of the Tor entry node, and wait for the traffic generator to initiate a TCP connection;

[0173] b) performing operations according to the received operation code from the traffic generating end;

[0174] c) When the opcode is RUN, open tcpdump to start capturing traffic. Here, you need to constrain the IP address and port number of the Tor entry node recorded in step a) to capture traffic.

[0175] d) When the operation code is OVER, tcpdump is closed, and the traffic collection work of the domain name is completed. The output of the completed traffic collection work is the traffic file (.pcap format) generated during the corresponding domain name access process, which is named according to "hidden service site serial number + domain name serial number + collection time".

[0176] (3) Repurchasing invalid traffic from multiple hidden domain services. This process includes the following four steps:

[0177] a) Determine whether the invalid traffic queue recorded in (2) is empty. If not, dequeue the invalid traffic record queue, and the traffic generation end re-executes the traffic generation process for the dequeued domain name;

[0178] b) The traffic collection end receives the status code again and executes the traffic collection process;

[0179] c) Continuously record the URLs and serial numbers that are accessed incorrectly during the supplementary acquisition process, and queue the corresponding URLs and serial numbers;

[0180] d) When the invalid traffic queue is empty, the process stops; if the invalid traffic queue is never empty, the domain names that are invalid within a limited number of cyclic re-collection times are replaced to ensure the sustainable effectiveness of the traffic.

[0181] S23: Preprocessing of multi-domain hidden service traffic data. This step preprocesses the original traffic obtained in S22. The specific process is as follows: Figure 5 As shown, it is divided into the following 6 steps:

[0182] (1) Traffic diversion: Use the SplitCap tool to split the original traffic into fine-grained flows according to the five-tuple rule;

[0183] (2) Traffic filtering: Filter traffic from IP addresses that do not belong to cloud servers or entry nodes; at the same time, filter all domain names with HTTP status codes of 4xx and 5xx, domain names clearly marked as "Timeout" in the log, and read domain names. <title> Traffic filtering with blank attribute values;< / title>

[0184] (3) Data representation conversion. The file format of the streaming data is pcap format. Data in this format cannot be used as input by deep learning attack methods. Therefore, it is necessary to convert the streaming data in pcap format into a data representation. Since our model has a parallel learning mechanism of two different modules, it requires two different forms of input. The specific steps are as follows:

[0185] a) Calculate the number of data packets contained in the entire bidirectional flow;

[0186] b) Divide the total number of packets in the bidirectional flow by 100 to obtain the number of packets per hundredth;

[0187] c) taking out every hundredth of the total number of data packets in sequence for processing;

[0188] d) extracting IP layer and TCP layer header information of the data packet, including data packet direction information, TCP payload size information, etc., and accumulating the TCP payload size of the data packet extracted in c) according to the data packet direction. A positive accumulation is recorded when the destination IP address points to the source IP address, and a negative accumulation is recorded when the source IP address points to the destination IP address. The result of this step is the cumulative sum of the TCP payload size of each hundredth of the data packet;

[0189] e) Count the number of packets in c) that are directed from the source IP address to the destination IP address, and count the number of times the direction of the packets changes;

[0190] f) Concatenate the calculated feature data for each hundredth bit, and use the cumulative sum of the TCP payload size of each hundredth bit of data packet as the input of the CNN branch in the model. The cumulative sum of the TCP payload size of each hundredth bit of data packet, the direction (the number of directions from the source IP address to the destination IP address), and the number of direction changes are sequentially concatenated (a total of 300 bits).

[0191] (4) Label the data. Associate the labels with the traffic data in the form of "feature data, hidden service station number" obtained in (3) and save them into a CSV file by row. This step will generate two CSV files.

[0192] (5) Input construction: RobustScaler normalization is performed on the 104-bit equal-length numerical data obtained in (4).

[0193] (6) This embodiment constructs four sub-datasets, including two closed-world datasets, one open-world dataset, and one unknown domain name dataset. The two closed-world datasets are: one contains 10 hidden service sites, each site contains 1, 10, 20, 40, and 50 domain names, and the number of samples for each domain name is 1000, 100, 50, 25, and 20; the other contains 50 hidden service sites, each site contains 50 different domain names, and each domain name has 20 traffic samples. The open-world dataset contains 2886 hidden service sites, each site has 1 domain name, and each domain name has 1 sample. The unknown domain name dataset contains 10 domain names that are consistent with the 10 closed-world hidden service sites, but each site contains 10 domain names that are different from all the domain names contained in the 10 closed-world sites, and each domain name has 100 samples.

[0194] S31: Construct a 1D-CNN-LSTM network structure based on the attention mechanism. The network structure diagram is as follows Figure 7As shown. It is divided into the following 4 steps:

[0195] (1) Construction of a dual-channel 1D-CNN-LSTM network structure (2ch-CL). The specific steps are as follows:

[0196] a) Determine the 1D-CNN architecture. The 1D-CNN network structure of the present invention is: three convolutional blocks, each consisting of a convolutional layer and a maximum pooling layer. The convolutional kernel sizes of the convolutional layers are 64, 128, and 256, respectively.

[0197] The pooling size of the maximum pooling layer is 2;

[0198] b) 1D-CNN output resizing. In order to match the input of the LSTM structure, the present invention resizes the output of the 1D-CNN network before entering the LSTM network. We use the Flatten operation to

[0199] The 256 channel spatial features output by 1D-CNN are flattened and spliced ​​for processing;

[0200] c) Determine the LSTM structure. The present invention uses a one-layer unidirectional LSTM structure with 128 LSTM units to return the sequence value of the entire input;

[0201] d) Connect the outputs of the 1D-CNN structure and the LSTM structure, use the concatenate() function to concatenate and fuse the temporal and spatial features, and use the preprocessed samples as input to test whether the 1D-CNN-LSTM network can correctly perform the website fingerprint attack;

[0202] e) All hyperparameters in this process call the GridSearchCV() function in the sklearn module, and their hyperparameters are tuned through ten-fold cross validation and network search method.

[0203] (2) Probability output: Using the Softmax layer, we can estimate the probability of the output of feature fusion and splicing to obtain the final attack performance evaluation indicators.

[0204] (3) The network structure implementation of each part of this example is based on the Tensorflow-GPU 1.14 platform and the various deep learning functions provided by the Python keras library.

[0205] S32: Multi-domain hidden service website fingerprint attack. Here we refer to this method as 2ch-CL. It is divided into the following three steps:

[0206] (1) Dataset splitting: the dataset preprocessed in step S23 is split into a training set, a validation set, and a test set in a ratio of 8:1:1 by calling the train_test_split in the sklearn module;

[0207] (2) Closed-world environment testing: All data in a closed-world environment comes from the attacker's data set, also known as the monitoring set. In the method of the present invention, all domain name traffic data in the data set participates in the division of the test set and the training set. For the attack method, all data is known. The evaluation index of the attack method performance in the closed-world experiment is the classification accuracy, i.e., Accuracy. The specific steps are as follows:

[0208] a) Testing the impact of changes in the number of website domain names on the performance of the multi-domain hidden service website fingerprint attack method. We fixed the number of websites to be attacked by the website fingerprint attack method at 10, and increased the number of domain names contained in each website from 10 to 50 in steps of 10. This evaluation evaluated the performance changes brought about by changes in the number of domain names contained in the sample against the multi-domain hidden service website fingerprint attack method in the case of a single hidden service website containing the same total number of samples. The specific results are shown in Table 2.

[0209] Table 2 Results of the impact of changes in the number of website domain names on the performance of the 2ch-CL method

[0210]

[0211] b) Testing the impact of changes in the number of attacked websites on the performance of the multi-domain hidden service website fingerprinting attack method. We fixed the number of different domain names contained in each hidden service site sample to 1 and 50 (1 represents the traditional single-domain website fingerprinting attack scenario, and 50 represents the multi-domain scenario focused on by this invention). By varying the number of hidden service sites that the attack method needs to identify (from 10 to 50), we evaluated the impact of changes in the number of attacked hidden service sites on the performance of the website fingerprinting attack method in the multi-domain scenario, while maintaining the same number of domain names in the sample. The specific results are shown in Table 3.

[0212] Table 3. The impact of the number of attacked websites on the performance of the 2ch-CL method.

[0213]

[0214] (3) Unknown domain name detection: The attacker’s ability to collect hidden service domain names is limited. As hidden service domain names are continuously updated and expanded, the proportion of domain names controlled by the attacker to all hidden service site domain names in the Tor network will continue to decline. In this case, the ability of the attack method to identify unknown domain names becomes an important criterion for evaluating multi-domain hidden service attacks. The specific steps are as follows:

[0215] a) Dataset isolation: The training set and test set are strictly isolated. That is, there is no domain overlap between the training set (including the validation set split from the training set) and the test set. Domain names in the test set will never appear in the training set, ensuring that the attack method is completely unknown to the domain name traffic data in the test set. The training set consists of 10 sites, each with 50 domain names, and the test set consists of the same 10 sites, each with 10 domain names (these 10 domain names do not overlap at all with the 50 domain names in the training set).

[0216] b) Attack method optimization: using the training set and validation set to obtain the optimal attack method on the training set;

[0217] c) Attack method testing: We conducted tests on a test set of domain data that is completely unknown to the attack method to evaluate the performance of our multi-domain hidden service website fingerprint attack method when facing unknown domain names. The specific results are shown in Table 4.

[0218] Table 4 Performance results of 2ch-LC attack in unknown domain name detection scenario

[0219]

[0220] (4) Open world environment testing: The attacker controls a portion of the data, which is called the monitoring set. The attacker completes the training and verification of the model on the monitoring set. However, in the testing phase, in addition to the samples extracted from the monitoring set controlled by the attacker, there is also data that the attacker does not control, namely the non-monitoring set. The attack method needs to complete the binary classification task of the monitoring set and the non-monitoring set. The open world scenario is more realistic and focuses on the effectiveness of the attack method. The specific steps are as follows:

[0221] a) Monitoring and non-monitoring set division: We used a dataset of 10 hidden service sites as the monitoring set. A script was used to collect data from an additional 2,886 sites, with only one domain name collected from each site, as the non-monitoring set. We divided the monitoring set into training and test sets in a ratio of 7,114:2,886 (keeping the number of test set samples from the monitoring set consistent with that of the non-monitoring set).

[0222] b) In the open-world environment, our evaluation metric is represented by a receiver operating characteristic (ROC) curve, with the True Positive Rate (TPR) on the y-axis and the False Positive Rate (FPR) on the x-axis. The specific results are shown in Table 5.

[0223]

[0224] It should be noted that the above embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Equivalent replacements or substitutions made on the basis of the above technical solutions all fall within the scope of protection of the present invention.

Claims

1. A fingerprint attack method for multi-domain hidden service websites based on attention mechanism, characterized in that: The method comprises the following three steps: S1: Domain name collection and classification of multiple hidden services; S2: Multi-domain hidden service traffic collection and data preprocessing; S3: Multi-domain hidden service website fingerprint attack; Among them, step S1 is divided into 3 steps: S11: Obtaining hidden service domain name, S12: Get domain name html resources, S13: multi-domain attribute classification; Step S2 is divided into 3 steps, S21: Build a multi-domain traffic collection system based on cloud servers and Tor proxy. S22: Multi-domain hidden service traffic collection, S23: preprocessing of multi-domain hidden service traffic data; Step S3 is divided into 2 steps: S31: Construct a one-dimensional convolutional neural network based on a dual-channel structure - a long short-term memory network structure 1D-CNN-LSTM; specifically divided into two steps: (1) Construction of dual-channel 1D-CNN-LSTM network structure. The specific steps are as follows: a) Determine the 1D-CNN structure, including the location and number of convolutional layers, the location and number of pooling layers, the type of pooling operations, and the corresponding operations to avoid overfitting; b) Determine the LSTM structure, including the number of LSTM units and the output return value; c) Connect the 1D-CNN structure and LSTM structure for testing; d) Fine-tune the network structure based on the test results; e) Determine the final 1D-CNN-LSTM network structure; (2) Hyperparameter tuning. The specific steps are as follows: a) Determine the hyperparameters that need to be tuned; b) Determine the range of values ​​for each hyperparameter tuning; c) Grid search method is used to determine the optimal value of each hyperparameter; d) adjusting the attack method based on the values ​​determined by the grid search method; S32: Multi-domain hidden service website fingerprint attack. This process selects different task teams to perform fingerprint attacks on multi-domain hidden service websites to verify the effectiveness of the method of the present invention in a multi-domain scenario. It is specifically divided into the following four steps: (1) Dataset splitting: Split the preprocessed dataset in step S23 into a training set, a validation set, and a test set in a ratio of 8:1:1; (2) Closed world environment testing, (3) Open world environment testing. In the open world environment, the attacker has a portion of data, which is called the monitoring set. The attacker completes the training and verification of the model on the monitoring set. However, in the testing phase, in addition to the samples extracted from the monitoring set controlled by the attacker, there is also data that the attacker does not have, namely the non-monitoring set. The attack method needs to complete the binary classification task of the monitoring set and the non-monitoring set. The open world scenario is more realistic and focuses on the effectiveness of the attack method. (4) Unknown domain name detection. The attacker’s ability to collect hidden service domain names is limited. As hidden service domain names are continuously updated and expanded, the proportion of domain names controlled by attackers to all hidden service site domain names in the Tor network will continue to decline. In this case, the ability of the attack method to identify unknown domain names becomes an important criterion for evaluating multi-domain hidden service attacks.

2. The multi-domain hidden service website fingerprint attack method based on the attention mechanism according to claim 1 is characterized in that: S11: Obtaining the hidden service domain name. The specific process is divided into two steps: crawling the hidden service search engine storage domain name and filtering the domain name version; (1) Crawl the hidden service search engine storage domain name. The specific steps are as follows: a) Collect a large number of publicly accessible hidden service search engines in the Tor network; b) Install a crawler script to obtain the hidden service domain names stored by the search engine; (2) Domain name version filtering, the specific steps are as follows: a) Set the hidden service domain name version check rule: filter those with a length of less than 56 characters; b) Run the script to check the domain name version according to the rules and filter out non-third version domain names; c) Organize and form the third version of the hidden service domain name list.

3. The multi-domain hidden service website fingerprint attack method based on the attention mechanism according to claim 1 is characterized in that: S12: Obtaining domain name HTML resources. The specific process is divided into three steps: deploying the Tor proxy, accessing the hidden service domain name, and obtaining domain name HTML resources. (1) Deploy the Tor proxy. The specific steps are as follows: a) Select a cloud server as the Tor proxy; b) Install the Tor proxy program to create an accessible Tor network environment for the cloud server; (2) Hide service domain name access, the specific steps are as follows: a) Install the automated testing tool Selenium and the Firefox browser driver tool geckodriver, and configure the corresponding operating environment; b) Write and run a script to access the third version of the hidden service domain name list; (3) Obtaining domain name HTML resources. The specific steps are as follows: a) Access the domain name and store the HTML resource file of the domain name; b) Extract the HTML resource file of each domain name <title> Property value.< / title> 4. The multi-domain hidden service website fingerprint attack method based on the attention mechanism according to claim 1 is characterized in that: S13: Multiple domain names are classified by attributes. The specific process is divided into two steps: <title> Identical value classification and locality sensitive hashing algorithm Simhash calculation, hidden service multi-domain name list construction;< / title> (1) <title> The specific steps for same value classification and Simhash calculation are as follows:< / title> a) Write a script to check the value of the same attribute <title> Group and classify;< / title> b) Perform Simhash calculation on the HTML resource file of each domain name in each group; (2) Constructing a list of multiple hidden service domain names. The specific steps are as follows: a) Write a script, set the same website classification threshold to 0.3, and compare the Simhash results of each group; b) retain all domains with a comparison result of no more than 0.3, and remove all domains with a comparison result of more than 0.3; c) Organize and form a third version of the hidden service multi-domain list.

5. The multi-domain hidden service website fingerprint attack method based on the attention mechanism according to claim 1 is characterized in that: S21: Build a multi-domain traffic collection system based on cloud servers and Tor proxies. The specific process is divided into four steps: (1) Traffic generation end configuration, the specific steps are as follows: a) The installation script controls the browser to simulate user access behavior and accesses the domain names in the multi-domain name list of the hidden service in sequence. b) Feedback the access status of the hidden service site to the Tor proxy server and record the access log information. (2) Configuration of the traffic collection end, the specific steps are as follows: a) Configure the Tor proxy environment on a cloud server different from the client; multiple cloud servers in different geographical locations can be selected to configure the Tor proxy environment simultaneously. b) Check the accessibility of the Tor network. c) Read the access status feedback from the traffic generation end and perform corresponding operations. (3) Domain name accessibility check, the specific steps are as follows: a) Conduct a few full-list traversal accesses to the third version of the hidden service domain name list obtained in S13. b) Check the feedback access status and access logs, and screen out the inaccessible domain names. c) Rearrange the domain name list and construct a sub-list of accessible third version of the hidden service domain names. d) This step needs to be executed during each traffic collection process to ensure that the collected traffic is valid traffic generated by accessible sites. (4) Connectivity test: After fully executing the processes (1) to (3) in S21, correctly and orderly constructing the traffic generation end and the traffic collection end, and completing the domain name accessibility check, test the connectivity of the multi-domain name hidden service traffic collection system. The judgment condition for qualified connectivity test is: the script can correctly and orderly read the domain name list, operate the browser to connect to the Tor proxy, and then successfully access the hidden service through the Tor proxy, and prove that the service is accessible by judging the feedback access information, which indicates that the execution logic of the traffic collection system is correct and the connection is effective.

6. The method for multi-domain name hidden service website fingerprint attack based on the attention mechanism according to claim 1, wherein S22: Multi-domain name hidden service traffic collection is specifically divided into 3 steps: generation of multi-domain name hidden service access traffic, collection of multi-domain name hidden service traffic, and supplementary collection of multi-domain name hidden service invalid traffic. (1) Generation of multi-domain name hidden service access traffic, the specific steps are as follows: a) The script借助工具,模拟真实用户访问隐藏服务的网络行为,包括域名输入、鼠标点击、内容搜索操作,生成用户的网络访问流量; b) Read the domain name list and start accessing the hidden service site; record the access information (record the group serial number where the traffic is located, the domain name label, and the specific domain name url), and feedback the website access status information to the traffic collection end. c) Record the <title attribute> in the html resource file read during each domain name access. (2) Collection of multi-domain name hidden service traffic, the specific steps are as follows: a) Initialize the Tor proxy and establish a Tor proxy access circuit. b) Accept the status code feedback from the traffic generation end; there are 3 types of status codes in total: RUN indicates that the traffic collection tool starts to run and the traffic collection process starts; OVER indicates that this round of traffic collection work ends and the collection process is aborted, waiting for the next instruction; KILL indicates that the traffic collection end process terminates, the traffic collection process completely exits, all statuses are cleared, and returns to the initialization stage. It should be noted that there is an unclear expression "借助工具" in item , which needs to be further clarified for a more accurate translation. c) Store the traffic and name it with "hidden service site number - domain name number of the collected traffic + collection time"; (3) Re-collection of invalid traffic from multiple hidden domain services. The specific steps are as follows: a) Invalid traffic records: all domain names with HTTP status codes of 4xx and 5xx, domain names clearly marked as "Timeout" in the log, and domain names that read <title> Domain names with blank attributes are organized into a new domain name queue;< / title> b) revisit the invalid traffic and collect the corresponding traffic; meanwhile, record the invalid traffic that still has errors during the revisit; c) Repeat a) and b) until the invalid traffic domain name queue is empty; if the invalid traffic domain name queue is still not empty, proceed d) operation; d) After several rounds of supplementary procurement are completed, if the invalid traffic domain name queue is still not empty, the remaining invalid traffic domain names will be replaced to ensure that all invalid traffic can be supplemented within a limited number of rounds of supplementary procurement.

7. The multi-domain hidden service website fingerprint attack method based on the attention mechanism according to claim 1 is characterized in that: S23: Preprocessing of multi-domain hidden service traffic data, which is divided into five steps: traffic filtering, stream selection, data representation conversion, labeled data, and input construction; (1) Traffic filtering is divided into three steps: a) Split the original traffic into bidirectional flows according to the five-tuple rule. After swapping the order, the flows are considered the same. b) Based on prior knowledge of the client and Tor entry node IP addresses, filter out background traffic that does not belong to any of these IP addresses; (2) Flow selection. After traffic filtering, each domain name traffic contains multiple flow data with the same five-tuple. For the attack method, only one piece of data is needed as the representative of the domain name. The flow with the largest size is selected as the representative of the domain name, and all other flow data are deleted. (3) Data representation conversion, the specific steps are as follows: a) Calculate the number of data packets contained in the entire bidirectional flow; b) Divide the total number of packets in the bidirectional flow by 100 to obtain the number of packets per hundredth; c) taking out every hundredth of the total number of data packets in sequence for processing; d) Extract the header information of the IP layer and TCP layer of the data packet, including the data packet direction information and TCP payload size information, The TCP payload sizes of the data packets retrieved in step c) are accumulated according to the direction of the data packets. A positive accumulation occurs when the destination IP address points to the source IP address, and a negative accumulation occurs when the source IP address points to the destination IP address. The sum obtained in this step is the cumulative sum of the TCP payload sizes of each hundredth of the data packets. e) Count the number of packets in c) that are directed from the source IP address to the destination IP address, and count the number of times the direction of the packets changes; f) concatenating the calculated feature data for each hundredth bit, whereby the input is composed of: the cumulative sum of the TCP payload size of each hundredth packet, the cumulative sum of the TCP payload size of each hundredth packet, the number of directions from the source IP address to the destination IP address, and the number of direction changes, concatenated in order, for a total of 300 bits; (4) Labeling the data: associate labels with the traffic data in the form of "feature data, hidden service site number" obtained in (3), and save them into a CSV file by row. This step will generate two CSV data files; (5) Input construction, the numerical data obtained in (4) is subjected to data scaling RobustScaler standardization processing.

Citation Information

Patent Citations

  • Method used for tracing hidden service in Tor anonymous network

    CN108494769A

  • Tor hidden service traffic identification method based on feature selection

    CN115189936A