Coder Social home page Coder Social logo

h4sh5 / bcddb Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 314 KB

cross-architecture binary comparison database

License: BSD 3-Clause "New" or "Revised" License

Python 73.48% Shell 7.04% CSS 7.11% Jinja 12.37%
reverse-engineering lsh minhash retdec decompiler

bcddb's Introduction

BCD: Cross-architecture Binary Comparison DB

workflow: binary -> retdec lift into llvm-ir -> minhash -> db

Stores functions in binaries as minhash sets for quick lookup for similar functions. Example usecases:

  • detect libc functions with stripped names (demangling)
  • detect similar functions in other binaries (e.g. malware analysis/clustering)
  • match functions in a binary with open source functions (source code recovery / decompiling)

pre-requisites

(can comment out ssdeep and pysimhash if not running experiments, the main db is in minhash)

pip3 install -r requirements.txt

need to install retdec from https://github.com/avast/retdec and place retdec-decompiler on PATH

index functions in a binary

./bcd.py -i /bin/whoami

(if no picklefile specified, a new db is saved in the db_dict.pkl)

search similar functions from a binary

./bcd.py /bin/echo

usage recommendations

  • index binaries that have symbols (not stripped) for symbol demangling

    • to see binaries with symbols, use nm <path to binary> on linux/mac (use WSL if you are on windows)
  • index known functions, like crypto routines, to detect similar crypto routines (e.g. in ransomware)

web app

The Work-In-Progress flask app works ONLY IN SINGLE THREADED MODE (because of global variables)

If you are running it behind a reverse proxy (like nginx), do NOT use multiple workers. Just use one python and process and proxy pass the port (e.g. 5000)

Make sure you have flask installed (already in requirements.txt).

to run:

./server.py

bcddb's People

Contributors

h4sh5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

clayne jbx81-1337

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.