Sign inSign up

tungns1207/warp_masque_testbed

By tungns1207

•Updated 2 months ago

Image
0

91

tungns1207/warp_masque_testbed repository overview

⁠Traffic Capture Testbed

This repository contains an automated testing environment using Docker to capture and analyze network traffic (PCAP and CSV generation) via a SOCKS5 proxy (Masque).

ā šŸš€ Quick Start Guide

Follow these three steps to deploy the container and start capturing traffic.

⁠Prerequisites ( On your host machine)

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
⁠Step 1: Start the Docker Container

Run the following command to start the container in the background (detached mode). This command also mounts your current working directory on the host machine to /workspace/output_data inside the container, ensuring your captured files are safely saved to your host.

sudo docker run --init --rm -d --name masque_testbed1 -v "$(pwd):/workspace/output_data" tungns1207/warp_masque_testbed:1
⁠Step 2: Access the Container

Open an interactive bash shell inside the running container to execute the script:

sudo docker exec -it masque_testbed1 /bin/bash
warp-cli registration new
warp-cli mode proxy
⁠Step 3: Run the Capture Script

Once inside the container (root@...:/workspace#), execute the Python script. Ensure you have your input list of URLs (e.g., cleaned_websites.txt) ready in the workspace.

python3 WARP_traffic_capture.py --trace_file_dir output_data/ --target_websites cleaned_websites.txt --websites_count 20 --gap_count 0 --access_count 300 --filter

ā āš™ļø Script Parameters (Arguments)

You can customize the script's behavior using the following command-line arguments:

ArgumentDefault ValueDescription
--trace_file_dir./traces/Output Directory: The directory where the pcap and csv folders will be generated. Set this to your mounted volume (e.g., output_data/) to save files to your host machine.
--target_websites./target_websites.txtInput File: The path to the .txt file containing the list of target URLs (one URL per line).
--websites_count10Execution Limit: The maximum number of websites to process from the input list during this run.
--gap_count0Offset/Skip: The number of websites (rows) to skip from the beginning of the input file. Useful for splitting tasks across multiple containers (e.g., skipping the first 1000 URLs).
--access_count2Iterations: The number of times the script will visit each website to collect multiple traffic samples.
--filterFalseQUIC Filter: A flag. If provided, the script will strictly validate the PCAP and only save the CSV data if the capture successfully contains QUIC (HTTP/3) traffic.

ā šŸ“ Output Structure

Once the script finishes, check your mounted folder on the host machine. You will see the following structure:

output_data/
ā”œā”€ā”€ pcap/
│   ā”œā”€ā”€ www_google_com/
│   │   ā”œā”€ā”€ 1_www_google_com.pcap
│   │   └── 2_www_google_com.pcap
│   └── ...
└── csv/
    ā”œā”€ā”€ www_google_com/
    │   ā”œā”€ā”€ 1_www_google_com.csv
    │   └── 2_www_google_com.csv
    └── ...

This command to unlock permisson the folder contain pcap and csv:

sudo chown -R $USER:$USER my_docker_data

Tag summary

Content type

Image

Digest

sha256:0ed82e58c…

Size

808.1 MB

Last updated

2 months ago

docker pull tungns1207/warp_masque_testbed:1