Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Andrea Mambretti edited this page Sep 9, 2019 · 2 revisions

The main speculator component is the monitor that can be used to run tests in test mode or attacker/victim mode.

Hereafter the description of the monitor options:

Speculator v1.0.0
Usage: speculator_mon --victim/-v victim [--attacker/-a attacker] [--config/-c config]
                [--output/-o output_file] [--repeat/-r repeat] [--venv ENV1=val ENV2=val]
                [--aenv ENV1=val ENV2=val] [--invert/-i] [--delay/-d delay] [--quiet/-q] [--help/-h]
Option Details:
        --victim/-v     specifies the victim binary
        --attacker/-a   specifies the attacker binary (if any)
        --config/-c     specifies the json config file [default: "speculator.json"]
        --output/-o     specifies the output file location [default: "results/speculator_output"]
        --repeat/-r     specifies the # of tries for the current test [default: 1]
        --delay/-d      specifies the delay in (usec) elapsed between the two threads start in attack/victim mode [default: off]
        --invert/-i     inverts the order of the threads start [default:attacker thread starts first]
        --venv          specifies the environment variable to pass to the victim (if any)
        --aenv          specifies the environment variable to pass to the attacker (if any)
        --serial/-s     serialize the execution of attacker and victim
        --quiet/-q      enables quite mode
        --help/-h       prints this message

  • Manually run single mytest 1000 times in quite mode

sudo $SPEC_I/speculator_mon -v $SPEC_I/mytest/mytest -c myconfig.json -r 1000 -q -o $SPEC_I/results

  • Run attacker/victim mode, providing LD_PRELOAD to victim and attacker, and LD_BIND_NOW to the attacker for 1000 times. Run first victim (-i) and serialize the execution (e.g. victim starts and ends before the attacker is run)

sudo $SPEC_I/speculator_mon --venv LD_PRELOAD=my_library.so --aenv LD_BIND_NOW=1 LD_PRELOAD=my_library.so --victim $SPEC_I/victim/victim --attacker $SPEC_I/attacker/attacker -r 1000 -c $SPEC_I/speculator.json -q -i -s

Clone this wiki locally