|
| 1 | +## BUILD.md |
| 2 | + |
| 3 | + |
| 4 | +CRAX++ is implemented as a plugin of S2E, and it requires our custom patches for s2e which are only containted in this repository. |
| 5 | + |
| 6 | +This file contains the instructions for building CRAX++ (Requiem). |
| 7 | + |
| 8 | +## Preparation |
| 9 | + |
| 10 | +S2E officially supports 64-bit Ubuntu (18.04, 20.04 LTS, or later versions), older versions may not work. |
| 11 | + |
| 12 | +You need to install some additional tools or packages before building CRAX++. |
| 13 | +* [pwntools](https://github.com/Gallopsled/pwntools) (4.7.0) |
| 14 | +* [pybind11-dev](https://github.com/pybind/pybind11) (2.4.3-2build2) |
| 15 | +* [ROPgadget](https://github.com/JonathanSalwan/ROPgadget) (6.6) |
| 16 | + |
| 17 | +## Building S2E |
| 18 | + |
| 19 | +First, we will install **s2e-env**, a command-line tool for creating and administering isolated development environments for S2E. |
| 20 | +``` |
| 21 | +sudo apt-get install git gcc python3 python3-dev python3-venv python3-pip vim neovim tmux |
| 22 | +
|
| 23 | +cd |
| 24 | +git clone https://github.com/s2e/s2e-env.git |
| 25 | +cd s2e-env |
| 26 | +
|
| 27 | +python3 -m venv venv |
| 28 | +. venv/bin/activate |
| 29 | +pip install --upgrade pip |
| 30 | +pip install . |
| 31 | +``` |
| 32 | + |
| 33 | +Create a new S2E environment (which consists of an S2E engine, tools, 1+ VM images, 1+ projects) |
| 34 | +``` |
| 35 | +s2e init /home/aesophor/s2e |
| 36 | +``` |
| 37 | + |
| 38 | +Exit your shell, start another one: |
| 39 | +``` |
| 40 | +cd |
| 41 | +rm -rf s2e-env |
| 42 | +exit |
| 43 | +``` |
| 44 | + |
| 45 | +We'll use the s2e-env in `~/s2e` from now on. |
| 46 | +``` |
| 47 | +cd ~/s2e/source/s2e-env |
| 48 | +python3 -m venv venv |
| 49 | +. venv/bin/activate |
| 50 | +pip install --upgrade pip |
| 51 | +pip install . |
| 52 | +
|
| 53 | +cd ~/s2e |
| 54 | +source s2e_activate |
| 55 | +``` |
| 56 | + |
| 57 | +Clone CRAX++, replace s2e with CRAX++, and build. (~60 mins) |
| 58 | + |
| 59 | +``` |
| 60 | +cd ~/s2e/source |
| 61 | +rm -rf s2e |
| 62 | +git clone https://github.com/aesophor/CRAXplusplus s2e |
| 63 | +
|
| 64 | +s2e build |
| 65 | +``` |
| 66 | + |
| 67 | +Download pre-built VM images (~30 mins) |
| 68 | +``` |
| 69 | +s2e image_build linux -d |
| 70 | +``` |
| 71 | + |
| 72 | +Create an S2E project with our concolic execution wrapper |
| 73 | +``` |
| 74 | +cd ~/s2e/source/s2e/wrappers/symio |
| 75 | +make |
| 76 | +cd ~/s2e |
| 77 | +s2e new_project --image debian-9.2.1-x86_64 source/s2e/wrappers/symio/symio |
| 78 | +``` |
| 79 | + |
| 80 | +Install our configuration, target and poc |
| 81 | + |
| 82 | +``` |
| 83 | +cp source/s2e/wrappers/examples/* projects/symio/. |
| 84 | +cd projects/symio |
| 85 | +ln -s ../../examples/rop/rop target |
| 86 | +ln -s ../../examples/rop/poc poc |
| 87 | +./launch_s2e.sh |
| 88 | +``` |
| 89 | + |
| 90 | +## Reference |
| 91 | + |
| 92 | +http://s2e.systems/docs/s2e-env.html |
0 commit comments