-
Notifications
You must be signed in to change notification settings - Fork 11
Basic recording setup
Let’s start by recording one 5-second trace of google.com.
python record_data.py --browser chrome --num_runs 1 --sites_list google.com --trace_length 5
This should open google.com twice: once to load the site into your computer’s cache, and a second time for the actual recording. When we run experiments for the paper, we typically record 100 traces per site for 15 seconds, on all of the top Alexa sites. These experiments take about 42-43 hours.
python record_data.py --browser chrome --num_runs 100 --sites_list alexa100 --trace_length 15
To change the browser, you can update the browser
parameter to one of the following. Check out our README for more details on installing the necessary drivers for each of these:
chrome
chrome_headless
firefox
safari
-
links
(Links) -
remote
(more details) -
tor_browser
(more details)
For the sites_list
parameter, you can pass one of the following arguments:
-
open_world
: Collects traces on each of our 5,000 open-world sites -
alexaN
: Collects traces from each of the top N sites, according to Alexa in July 2021 (see Appendix A in our paper for the list) -
example1.com,example2.com
: Comma-separated list of your own domain names
You can enable countermeasures on any Chrome experiment by setting --enable_cache_countermeasure true
and/or --enable_interrupts_countermeasure true
If you're planning to run experiments with Tor, keep reading. This is only supported on Linux. Please note that you don't need to use this guide if you're not using the javascript
attacker. Things get tricky when you use Tor with the javascript
attacker because by default, the Tor Browser can't access localhost
or 127.0.0.1
, which we typically use to load the Snoopy attacker.
In this guide, we will refer to two computers: the host, which will be used to create a Snoopy onion service, and the attacker, which will run the experiment. The host only needs to be accessible to start the experiment. Both computers should be Linux machines, however the host can be a virtual machine on a different computer. The host can be the same computer as the attacker, however it may add unnecessary noise to the experiment.
-
Download, start, and close the Tor Browser. You should extract the browser to somewhere you won't delete it, such as the
Documents
folder. -
Install nginx
sudo apt install nginx
- Delete the default nginx files. Then, build the Snoopy web frontend and move it to the nginx directory
sudo rm /var/www/html/*
cd snoopy
yarn build
sudo mv dist/* /var/www/html
- Configure the Tor onion service. Edit the torrc file, which can be located at
<tor_browser_path>/Browser/TorBrowser/Data/Tor/torrc
, and add the following lines:
HiddenServiceDir <some_path>/snoopy/
HiddenServicePort 80 127.0.0.1:80
-
Start the Tor Browser
-
Note the Snoopy onion address from
<some_path>/snoopy/hostname
— we will need this to start the experiment
-
Download, start, and close the Tor Browser. You should extract the browser to somewhere you won't delete it, such as the
Documents
folder. -
Install
tbselenium
pip install tbselenium
- Start the experiment by providing the onion address from host step 6, and the browser path from step 1.
python record_data.py --browser tor_browser --tor_browser_path <path> --tor_onion_address <address> --attacker_type javascript --trace_length 50 <other_args>
- Once the experiment has started, you can safely close Tor and shut down the host computer.
-
Go to the Chrome Releases feed and search for the version of Chrome you need. Look for an exact version number, such as 98.0.4758.107.
-
Go to this page and look up the version number you found in step 1. Save the branch base position, such as 950365.
-
Go to this page and look for your version. On Linux, enter the Linux_x64 folder and use the prefix in the URL to narrow down the search to your base position. You may need to take an earlier base position.
-
Download the chrome and chromedriver zip files, place them into a folder, and then pass the folder with the
--chrome_binary_path
argument
If you add a twilio.json
file to the project folder, you will get SMS notifications as your experiments run. Use the twilio_interval
parameter to make these updates more/less frequent. The file should look something like this:
{
"account_sid": <twilio account sid>,
"auth_token": <twilio auth token>,
"from": <your twilio phone number>,
"to": <your personal phone number>,
"name": <a name identifying the machine>
}