Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Commit f978e3d

Browse files
committed
Add vagrant based solution
1 parent 02f1d0c commit f978e3d

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vagrant/
12
DELETE_THIS_TO_STOP_KILLER
23
data.pickle
34
venv/

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ ASAN (address sanitizer).
1818
Then, use `./wrapper.sh` to start the fuzzer, and watch the crashing
1919
inputs get dropped into the `crashes` directory.
2020

21+
### Quick Start
22+
23+
It is possible to start off quickly by spinning up a new virtual
24+
machine, and running the fuzzer inside it (it also would prevent any
25+
unintended side-effects that might occur due to fuzzing).
26+
27+
This has been implemented as a `Vagrantfile` in this directory itself,
28+
which runs an Ubuntu-14.04 virtual machine with all required
29+
configuration etc, and auto-starts the fuzzing process into the
30+
background whenever it boots. It can be booted simply by running
31+
`vagrant up` inside this repository. Following this, running `vagrant
32+
ssh` will let you access the box, where the running process can be
33+
seen with `screen -r` (and disconnected without killing by pressing
34+
Ctrl+a, d). To stop the fuzzer and the virtual machine, merely run
35+
`vagrant halt`.
36+
37+
**Note:** Starting up the vagrant box also creates a `crashes/`
38+
directory in the repository directory, which is symlinked inside the
39+
virtual machine, so that the crashes can be obtained outside the VM
40+
wiht ease.
41+
2142
## Structure of the Fuzzer
2243

2344
The fuzzer consists of multiple parts working in unison to lead to

Vagrantfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what
5+
# you're doing!
6+
VAGRANTFILE_API_VERSION = "2"
7+
8+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
9+
config.vm.box = "ubuntu/trusty64"
10+
config.vm.box_check_update = false
11+
config.vm.provider "virtualbox" do |vb|
12+
vb.customize ["modifyvm", :id, "--memory", "2048"]
13+
end
14+
15+
config.vm.provision "shell",
16+
path: "vagrant-provision.sh",
17+
privileged: false
18+
19+
config.vm.provision "shell",
20+
inline: "cd ~/fuzzing-numpy; screen -d -m ./wrapper.sh",
21+
privileged: false,
22+
run: "always"
23+
24+
end

vagrant-provision.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This has been tested on a new Ubuntu-14.04 vagrant box.
2+
# If using anything else, YMMV.
3+
4+
# PS: You might need to ensure that there is enough memory
5+
# given to the VM. I would suggest 2048MB or more.
6+
7+
# Install all requirements
8+
sudo apt-get update
9+
sudo apt-get install -y git make clang-3.5 realpath screen zlib1g-dev libssl-dev
10+
sudo apt-get build-dep -y python3.4
11+
12+
# Ensure that the clang and clang++ executables point correctly
13+
sudo update-alternatives --install /usr/bin/clang clang $(which clang-3.5) 100
14+
sudo update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-3.5) 100
15+
16+
# To prevent git from complaining
17+
export LC_CTYPE=en_US.UTF-8
18+
export LC_ALL=en_US.UTF-8
19+
20+
# Set up the fuzzing-numpy repository
21+
git clone /vagrant ~/fuzzing-numpy
22+
cd ~/fuzzing-numpy
23+
./first_run.sh
24+
cd ..
25+
26+
# Set up symlink for crashes directory
27+
cd ~/fuzzing-numpy
28+
mkdir -p /vagrant/crashes
29+
ln -s /vagrant/crashes ./crashes
30+
cd ..
31+

0 commit comments

Comments
 (0)