ruigulala / ConAnalysis

Concurrency Bug Vulnerability Analysis
12 stars 2 forks source link

ConAnalysis

Concurrency Attack Analysis. Right now, all the developement is under Ubuntu 16.04 LTS. Make sure you have allocated at least 4GB memory. Otherwise the LLVM linking process may run out of memory and fail.

Install LLVM 3.6.1 & clang 3.6.1 & LLDB 3.6.1 & ThreadSanitizer 3.6.1.

mv cfe-3.6.1.src clang
mv compiler-rt-3.6.1.src compiler-rt
mv lldb-3.6.1.src lldb

Goto path-to-llvm-source, the folder name is llvm-3.6.1.src

Make sure you replace the path-to... with your own path name!!!!

cd path-to-llvm-source

Install the following dependencies.

sudo apt-get update
sudo apt-get install build-essential subversion python2.7-dev libedit-dev libncurses5-dev cmake inotify-tools fdupes libxml2-dev swig expect

Build LLVM together with Clang using CMake

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

After this step, under path-to-llvm-source/build/bin, you'll see all the executables including clang and clang++ etc.

sudo make install

Install submodules

Currently, we're using whole-program-llvm to build the target project into one single llvm bitcode file. We're using whole-program-llvm as a submodule of our project. The following are the steps to set up whole-program-llvm. Other than this, we also using another git repository to reference all the source code of bugs of analyzed.

Build ConAnalysis project

Now, since you've installed all the dependencies of ConAnalysis project, you can build it now.

Or you can go to $CONANAL_ROOT/TESTS/libsafe-cve-1125 and

./run.sh no_race_detector

for an automatic run which contains the race detection and static analysis. The output will be in

$CONANAL_ROOT/build/TESTS/libsafe-cve-1125/final*

If you want to take a look at the source code of the target application, for example, apache-25520, you can go to concurrency-exploits folder to find the corresponding source code. Notice that some source code will be shown only after ./configure .

Future work

Now you have finished all the required steps. You can enjoy the hacking on our project. If you've encounted any problems, send an email to Rui Gu at rui.gu3@gmail.com or open an issue on github.