/Website-Fingerprinting-Library

A Library for Advanced DL-based Website Fingerprinting Attacks.

Primary LanguagePythonMIT LicenseMIT

Website-Fingerprinting-Library (WFlib)



WFlib is a Pytorch-based open-source library for website fingerprinting attacks, intended for research purposes only.

We provide a neat code base to evaluate 11 advanced DL-based WF attacks on multiple datasets. This library is derived from our ACM CCS 2024 paper. If you find this repo useful, please cite our paper.

@inproceedings{deng2024wflib,
  title={Robust and Reliable Early-Stage Website Fingerprinting Attacks via Spatial-Temporal Distribution Analysis},
  author={Deng, Xinhao and Li, Qi and Xu, Ke},
  booktitle={Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security},
  year={2024}
}

We will continue to add new attacks. Contributions via pull requests are welcome and appreciated.

WFlib Overview

The code library includes 11 DL-based website fingerprinting attacks.

Attacks Conference Paper Code
AWF NDSS 2018 Automated Website Fingerprinting through Deep Learning DLWF
DF CCS 2018 Deep Fingerprinting: Undermining Website Fingerprinting Defenses with Deep Learning df
Tik-Tok PETS 2019 Tik-Tok: The Utility of Packet Timing in Website Fingerprinting Attacks Tik_Tok
Var-CNN PETS 2019 Var-CNN: A Data-Efficient Website Fingerprinting Attack Based on Deep Learning Var-CNN
TF CCS 2019 Triplet Fingerprinting: More Practical and Portable Website Fingerprinting with N-shot Learning tf
BAPM ACSAC 2021 BAPM: Block Attention Profiling Model for Multi-tab Website Fingerprinting Attacks on Tor None
ARES S&P 2023 Robust Multi-tab Website Fingerprinting Attacks in the Wild Multitab-WF-Datasets
RF Security 2023 Subverting Website Fingerprinting Defenses with Robust Traffic Representation RF
NetCLR CCS 2023 Realistic Website Fingerprinting By Augmenting Network Trace Realistic-Website-Fingerprinting-By-Augmenting-Network-Traces
TMWF CCS 2023 Transformer-based Model for Multi-tab Website Fingerprinting Attack TMWF
Holmes CCS 2024 Robust and Reliable Early-Stage Website Fingerprinting Attacks via Spatial-Temporal Distribution Analysis WFlib

We implemented all attacks using the same framework (Pytorch) and a consistent coding style, enabling researchers to evaluate and compare existing attacks easily.

Usage

Install

pip install --user .

Note

  • Python 3.8 is required.

Datasets

  • Download datasets (link) and place it in the folder ./datasets

  • Divide the dataset into training, validation, and test sets. For example, you can execute the following command.

python exp/dataset_process/dataset_split.py --dataset DF18

Training & Evaluation

We provide all experiment scripts for WF attacks in the folder ./scripts/. For example, you can reproduce the AWF attack on the DF18 dataset by executing the following command.

bash scripts/AWF.sh

The ./scripts/AWF.sh file contains the commands for model training and evaluation.

python -u exp/train.py \
  --dataset DF18 \
  --model AWF \
  --gpu 0 \
  --feature DIR \
  --seq_len 3000 \
  --train_epochs 30 \
  --batch_size 256 \
  --learning_rate 8e-4 \
  --optimizer RMSprop \
  --eval_metrics Accuracy Precision Recall F1-score P@min \
  --save_metric F1-score \
  --save_name max_f1

python -u exp/test.py \
  --dataset DF18 \
  --model AWF \
  --gpu 0 \
  --feature DIR \
  --seq_len 3000 \
  --batch_size 256 \
  --eval_metrics Accuracy Precision Recall F1-score P@min \
  --save_name max_f1

The meanings of all parameters can be found in the exp/train.py and exp/test.py files. WFlib supports modifying parameters to easily implement different attacks. Moreover, you can use WFlib to implement combinations of different attacks or perform ablation analysis.

Contact

If you have any questions or suggestions, feel free to contact:

Acknowledgements

We would like to thank all the authors of the referenced papers. Special thanks to Yixiang Zhang and Jie Yan for their participation in the code review.