CRITICAL: Before running the container, you must increase the UDP buffer sizes for QUIC to work properly.
sudo sysctl -w net.core.rmem_max=7500000
sudo sysctl -w net.core.wmem_max=7500000
To start the container and mount your current directory to save capture files:
sudo docker run --rm --privileged -d -p 6901:6901 -p 5901:5901 -v "$(pwd):/home/headless/Documents" -e VNC_PW=password123 --name tor_1 tungns1207/tor_keyword_duckduckgo:1
Once inside the container, execute the Python script. Ensure you have your input list of URLs (e.g., cleaned_websites.txt) ready in the workspace. There are 2 script one is txt_traffic_capture that convert pcap to txt and only keep the txt, the other is pcap keeper only.
python3 traffic_capture.py --trace_file_dir output_data/ --target_websites url.txt --websites_count 10 --gap_count 0 --access_count 500
Bạn có thể tùy chỉnh quá trình thu thập lưu lượng mạng (Traffic Fingerprinting) thông qua các tham số dòng lệnh sau:
| Tham số (Argument) | Giá trị mặc định | Mô tả (Description) |
|---|---|---|
--tbb_path | /opt/tor-browser_en-US | Đường dẫn Tor: Vị trí thư mục chứa lõi Tor Browser trên hệ thống. Đã được thiết lập mặc định nên bạn không cần khai báo trừ khi cài Tor ở thư mục khác. |
--target_websites | Bắt buộc nhập | File đầu vào: Đường dẫn tới file .txt chứa danh sách các từ khóa tìm kiếm (Ví dụ: ./AOL.txt). Mỗi từ khóa nằm trên một dòng. |
--trace_file_dir | ./traces/ | Thư mục đầu ra: Nơi chứa các file lưu lượng mạng (.pcap) và file dữ liệu đã lọc Guard IP (.txt). |
--websites_count | 10 | Giới hạn từ khóa: Số lượng từ khóa tối đa sẽ được đọc và xử lý từ file danh sách đầu vào trong lần chạy hiện tại. |
--gap_count | 0 | Điểm neo (Offset/Skip): Số lượng từ khóa bị bỏ qua tính từ đầu file. Dùng để chia nhỏ file danh sách gốc chạy song song trên nhiều Terminal hoặc Container khác nhau. |
--access_count | 500 | Số vòng lặp (Epochs/Attempts): Số lượng mẫu dữ liệu (traffic samples) cần thu thập cho mỗi từ khóa. Mỗi vòng lặp script sẽ tự động tạo một mạch Tor mới, đổi Guard IP và dọn sạch Cache trình duyệt. |
Once the script finishes, check your mounted folder on the host machine. You will see the following structure:
output_data/
├── www_google_com/
│ ├── www_google_com_1.txt
│ └── www_google_com_2.txt
└── ...
├── www_facebook_com/
├── www_facebook_com_1.txt
└── www_facebook_com_2.txt
└── ...
This command to unlock permisson the folder contain pcap and csv:
sudo chown -R $USER:$USER my_docker_data
Content type
Image
Digest
sha256:1dcb01caa…
Size
658.9 MB
Last updated
4 months ago
docker pull tungns1207/tor_keyword_duckduckgo:1