{"id":23122459,"url":"https://github.com/Xinhao-Deng/Website-Fingerprinting-Library","last_synced_at":"2025-08-17T01:32:16.859Z","repository":{"id":243506069,"uuid":"806452826","full_name":"Xinhao-Deng/Website-Fingerprinting-Library","owner":"Xinhao-Deng","description":"A Library for Advanced DL-based Website Fingerprinting Attacks.","archived":false,"fork":false,"pushed_at":"2025-01-24T10:56:08.000Z","size":697,"stargazers_count":81,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T11:31:10.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xinhao-Deng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-27T08:22:07.000Z","updated_at":"2025-01-24T10:56:11.000Z","dependencies_parsed_at":"2024-08-04T15:51:28.594Z","dependency_job_id":"2df7e309-38a6-463e-a127-475de3244deb","html_url":"https://github.com/Xinhao-Deng/Website-Fingerprinting-Library","commit_stats":null,"previous_names":["xinhao-deng/website-fingerprinting-library"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Xinhao-Deng/Website-Fingerprinting-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xinhao-Deng%2FWebsite-Fingerprinting-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xinhao-Deng%2FWebsite-Fingerprinting-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xinhao-Deng%2FWebsite-Fingerprinting-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xinhao-Deng%2FWebsite-Fingerprinting-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xinhao-Deng","download_url":"https://codeload.github.com/Xinhao-Deng/Website-Fingerprinting-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xinhao-Deng%2FWebsite-Fingerprinting-Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796224,"owners_count":24647320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T07:27:43.698Z","updated_at":"2025-08-17T01:32:16.837Z","avatar_url":"https://github.com/Xinhao-Deng.png","language":"Python","funding_links":[],"categories":["Libraries \u0026 Projects"],"sub_categories":["Index"],"readme":"# Website-Fingerprinting-Library (WFlib)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\".\\figures\\wflib.jpg\" height = \"180\" alt=\"\" align=center /\u003e\n\u003cbr\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n\nWFlib is a Pytorch-based open-source library for website fingerprinting attacks, intended for research purposes only.\n\nWebsite fingerprinting is a type of network attack in which an adversary attempts to deduce which website a user is visiting based on encrypted traffic patterns, even without directly seeing the content of the traffic.\n\nWe 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.\n\n```bibtex\n@inproceedings{deng2024wflib,\n  title={Robust and Reliable Early-Stage Website Fingerprinting Attacks via Spatial-Temporal Distribution Analysis},\n  author={Deng, Xinhao and Li, Qi and Xu, Ke},\n  booktitle={Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security},\n  year={2024}\n}\n```\n\nContributions via pull requests are welcome and appreciated.\n\n## WFlib Overview\n\nThe code library includes 11 DL-based website fingerprinting attacks.\n\n| Attacks | Conference  | Paper | Code |\n|----------|----------|----------|----------|\n| AWF | NDSS 2018 | [Automated Website Fingerprinting through Deep Learning](https://arxiv.org/pdf/1708.06376) | [DLWF](https://github.com/DistriNet/DLWF) |\n| DF | CCS 2018 | [Deep Fingerprinting: Undermining Website Fingerprinting Defenses with Deep Learning](https://dl.acm.org/doi/pdf/10.1145/3243734.3243768) | [df](https://github.com/deep-fingerprinting/df) |\n| Tik-Tok | PETS 2019 | [Tik-Tok: The Utility of Packet Timing in Website Fingerprinting Attacks](https://petsymposium.org/popets/2020/popets-2020-0043.pdf) | [Tik_Tok](https://github.com/msrocean/Tik_Tok) |\n| Var-CNN | PETS 2019 | [Var-CNN: A Data-Efficient Website Fingerprinting Attack Based on Deep Learning](https://arxiv.org/pdf/1802.10215) | [Var-CNN](https://github.com/sanjit-bhat/Var-CNN) |\n| TF | CCS 2019 | [Triplet Fingerprinting: More Practical and Portable Website Fingerprinting with N-shot Learning](https://dl.acm.org/doi/pdf/10.1145/3319535.3354217) | [tf](https://github.com/triplet-fingerprinting/tf) |\n| BAPM | ACSAC 2021 | [BAPM: Block Attention Profiling Model for Multi-tab Website Fingerprinting Attacks on Tor](https://dl.acm.org/doi/pdf/10.1145/3485832.3485891) | None |\n| ARES | S\u0026P 2023 | [Robust Multi-tab Website Fingerprinting Attacks in the Wild](https://arxiv.org/pdf/2501.12622) | [Multitab-WF-Datasets](https://github.com/Xinhao-Deng/Multitab-WF-Datasets) |\n| RF | Security 2023 | [Subverting Website Fingerprinting Defenses with Robust Traffic Representation](https://www.usenix.org/system/files/sec23fall-prepub-621_shen-meng.pdf) | [RF](https://github.com/robust-fingerprinting/RF) |\n| NetCLR | CCS 2023 | [Realistic Website Fingerprinting By Augmenting Network Trace](https://arxiv.org/pdf/2309.10147) | [Realistic-Website-Fingerprinting-By-Augmenting-Network-Traces](https://github.com/SPIN-UMass/Realistic-Website-Fingerprinting-By-Augmenting-Network-Traces) |\n| TMWF | CCS 2023 | [Transformer-based Model for Multi-tab Website Fingerprinting Attack](https://dl.acm.org/doi/abs/10.1145/3576915.3623107) | [TMWF](https://github.com/jzx-bupt/TMWF) |\n| Holmes | CCS 2024 | [Robust and Reliable Early-Stage Website Fingerprinting Attacks via Spatial-Temporal Distribution Analysis](https://arxiv.org/pdf/2407.00918) | [WFlib](https://github.com/Xinhao-Deng/Website-Fingerprinting-Library)|\n\n\nWe implemented all attacks using the same framework (Pytorch) and a consistent coding style, enabling researchers to evaluate and compare existing attacks easily.\n\n## Usage\n\n### Install \n\n```sh\ngit clone git@github.com:Xinhao-Deng/Website-Fingerprinting-Library.git\npip install --user .\n```\n\n**Note**\n\n- Python 3.8 is required.\n\n### Datasets\n\n```sh\nmkdir datasets\n```\n\n- Download datasets ([link](https://zenodo.org/records/13732130)) and place it in the folder `./datasets`\n\n| Datasets | # of monitored websites | # of instances | Intro |\n| --- | --- | --- | --- |\n| CW.npz | 95 | 105730 | Closed-world dataset. [Details](https://dl.acm.org/doi/pdf/10.1145/3243734.3243768)|\n| OW.npz |  95 | 146446 | Open-world dataset. [Details](https://dl.acm.org/doi/pdf/10.1145/3243734.3243768) |\n| WTF-PAD.npz | 95 | 105730 | Dataset with WTF-PAD defense. [Details](https://arxiv.org/pdf/1512.00524) |\n| Front.npz |  95 | 95000 | Dataset with Front defense. [Details](https://www.usenix.org/system/files/sec20-gong.pdf) |\n| Walkie-Talkie.npz |  100 | 90000 | Dataset with Walkie-Talkie defense. [Details](https://www.usenix.org/system/files/conference/usenixsecurity17/sec17-wang-tao.pdf) |\n| TrafficSliver.npz |  95 | 95000 | Dataset with TrafficSliver defense. [Details](https://sebastianreuter.info/publications/pdf/ccs-trafficsliver.pdf) |\n| NCDrift_sup.npz |  93 | 21430 | Network condition drift dataset, including superior traces. [Details](https://arxiv.org/pdf/2309.10147) |\n| NCDrift_inf.npz |  93 | 6882 | Network condition drift dataset, including inferior traces. [Details](https://arxiv.org/pdf/2309.10147) |\n| Closed_2tab.npz |  100 | 58000 | 2-tab dataset in the closed-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf) |\n| Closed_3tab.npz |  100 | 58000 | 3-tab dataset in the closed-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf)  |\n| Closed_4tab.npz |  100 | 58000 | 4-tab dataset in the closed-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf)  |\n| Closed_5tab.npz |  100 | 58000 | 5-tab dataset in the closed-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf)  |\n| Open_2tab.npz |  100 | 64000 | 2-tab dataset in the open-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf)  |\n| Open_3tab.npz |  100 | 64000 | 3-tab dataset in the open-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf)  |\n| Open_4tab.npz |  100 | 64000 | 4-tab dataset in the open-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf) |\n| Open_5tab.npz |  100 | 64000 | 5-tab dataset in the open-world scenario. [Details](http://www.thucsnet.com/wp-content/papers/xinhao_sp2023.pdf) |\n\n\n- The extracted dataset is in npz format and contains two values: X and y. X represents the cell sequence, with values being the direction (e.g., 1 or -1) multiplied by the timestamp. y corresponds to the labels. Note that the input of some datasets consists only of direction sequences.\n\n- Divide the dataset into training, validation, and test sets.\n\n```sh\n# For single-tab datasets\npython exp/dataset_process/dataset_split.py --dataset CW\n# For multi-tab datasets\npython exp/dataset_process/dataset_split.py --dataset Closed_2tab --use_stratify False\n```\n\n### Training \\\u0026 Evaluation\n\nWe provide all experiment scripts for WF attacks in the folder `./scripts/`. For example, you can reproduce the DF attack on the CW dataset by executing the following command.\n\n```sh\nbash scripts/DF.sh\n```\n\nThe `./scripts/DF.sh` file contains the commands for model training and evaluation.\n\n```sh\ndataset=CW\n\npython -u exp/train.py \\\n  --dataset ${dataset} \\\n  --model DF \\\n  --device cuda:1 \\\n  --feature DIR \\\n  --seq_len 5000 \\\n  --train_epochs 30 \\\n  --batch_size 128 \\\n  --learning_rate 2e-3 \\\n  --optimizer Adamax \\\n  --eval_metrics Accuracy Precision Recall F1-score \\\n  --save_metric F1-score \\\n  --save_name max_f1\n\npython -u exp/test.py \\\n  --dataset ${dataset} \\\n  --model DF \\\n  --device cuda:1 \\\n  --feature DIR \\\n  --seq_len 5000 \\\n  --batch_size 256 \\\n  --eval_metrics Accuracy Precision Recall F1-score \\\n  --load_name max_f1\n```\n\nThe 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.\n\n## Contact\nIf you have any questions or suggestions, feel free to contact:\n\n- [Xinhao Deng](https://xinhao-deng.github.io/) (dengxh23@mails.tsinghua.edu.cn)\n- Yixiang Zhang (zhangyix24@mails.tsinghua.edu.cn)\n\n## Acknowledgements\n\nWe would like to thank all the authors of the referenced papers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXinhao-Deng%2FWebsite-Fingerprinting-Library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXinhao-Deng%2FWebsite-Fingerprinting-Library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXinhao-Deng%2FWebsite-Fingerprinting-Library/lists"}