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.
The code library includes 11 DL-based website fingerprinting attacks.
We implemented all attacks using the same framework (Pytorch) and a consistent coding style, enabling researchers to evaluate and compare existing attacks easily.
pip install --user .
Note
- Python 3.8 is required.
-
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
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.
If you have any questions or suggestions, feel free to contact:
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.