Giter VIP home page Giter VIP logo

sensegrind's Introduction

Sensegrind: Inferring sensitive variables through Taintgrind

Support for Valgrind 3.18.1, x86_linux, amd64_linux, arm_linux v3.18.1

Support for Valgrind 3.17.0, x86_linux, amd64_linux, arm_linux v3.17.0

Support for Valgrind 3.16.1, x86_linux, amd64_linux, arm_linux v3.16.1

Support for Valgrind 3.15.0, x86_linux, amd64_linux, arm_linux v3.15.0

Installation (from source)

  1. Install Dependencies (Ubuntu)

     ~$ apt install -y git wget gcc build-essential automake python gcc-multilib
    
  2. Download Valgrind

     ~$ tar jxvf valgrind-X.X.X.tar.bz2
     ~$ cd valgrind-X.X.X
     ~/valgrind-X.X.X$ 
    
  3. Git clone sensegrind

     ~/valgrind-X.X.X$ git clone https://github.com/matte6288/sensegrind
     ~/valgrind-X.X.X$ cd sensegrind
    
  4. Run build_taintgrind.sh (to build valgrind, taintgrind and Capstone)

Compile with

~$ ../sensegrind$ gcc -O0 -g -o test test.c

Run with

~$ ../sensegrind$ ../build/bin/valgrind --tool=taintgrind  --taint-stdin=yes test

or simply

~$ ../sensegrind$ ../build/bin/taintgrind --taint-stdin=yes test

Filtering Ouput and Graph Visualisation

You will need to save STDERR output from your taintgrind run to a file the easiest way to do this: ../taintgrind$ ../build/bin/taintgrind --taint-stdin=yes test 2>log.txt

You will also need to get all variable from the c file:

~$ python cparser.py -f test.c

Then run logSenseParser.py to get dot file for visualization and retrieve potentially sensitive variables:

~$ python logSenseParser.py -v var_names.txt -l log.txt

Most likely you will want to write doto output to file like this:

~$ python logSenseParser.py -v var_names.txt -l log.txt > test.dot

Visualise the graph with

~$ sudo apt install graphviz
~$ dot -Tpng test.dot -o test.png

Or, for larger graphs

~$ dot -Tsvg test.dot -o test.svg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.