Giter VIP home page Giter VIP logo

rune's Introduction

rune - symbolic execution for everyone

rune is a symbolic execution engine over ESIL. Integrated with radare2 for your everyday use!

rune is extensible and customizable. Almost every component in rune can have multiple implementations (each with their own tradeoffs) and still be compatible with the existing system.

At the moment, rune is not designed to be run on an entire binary, rather it is used to reason about smaller pieces of code iteratively and assist in reverse engineering tasks. If you need something that can be run on an entire binary automatically, you are better off other symbolic execution engines, such as angr.

Warning: rune is under heavy development and the API is highly unstable. However, feel free to use rune as any comments, suggestions and feedbacks are highly valued at this stage of the project!

NOTE: I am actively collecting suggestions for changes to the API. Please open issues for the same.

Asciinema

asciicast

Installing

Requires:

  • Standard rust toolchain. This should work with stable, but nightly is recommended
  • Latest build of radare2

Clone this repository. Then run cargo build

Cargo automatically fetches the required dependencies required for this project. To use runec, it is recommended to make a symlink to ./target/debug/runec

ln -s ./target/debug/runec /usr/bin/runec

Examples

TODO

Documentation

Documentation will be available (shortly) at: docs

Contributing

Contributing in terms of suggestions, bug-reports, blog posts and most importantly pull requests are greatly appreciated. Unless otherwise requested by the authors, all code will be dual-licensed under MIT and Apache Version 2.0,

To make reviews easier please ensure that the code adhers to the standard rust style of coding.

Update Notice

This project is being actively developed over at radare/rune.

Project Milestones and Roadmap

Please check the Issues

License

rune is dual-licensed under:

Use under either one of the above listed licenses is acceptable.

rune's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rune's Issues

Hooks and Breakpoints

Implement an API for hooks and breakpoints. Perhaps it is better to implement these as a part of esil-rs as other applications that use esil-rs will probably need some hooking functionality too.

Path feasibilty

Check for path feasibility before dequeue to avoid taking impossible paths

Handle symbolic jumps

RuneContext currently cannot handle symbolic jumps. Some amount of refactoring is needed in order to implement this feature efficiently.

Easy creation of FileStream

Implement From<R2Stream> for FileStream in order to convert R2Stream into
a FileStream. This allows radare2 to be closed and additionally provides a
way to construct files that can be reused for further tests wihtout depending
on radare2.

CI

  • Setup Travis CI
  • Setup coveralls

Cast operand widths

write implementation for RuneContext does not check if the size of destination and source are correct. This will lead to generation of invalid constraints which cannot be solved by the solver. A simple example where this can occus is in x86 instruction such as:
mov rax, ax

Scalability and radeco IL

Current implementation of context uses SMTLIB2 directly. This is not scalable on the long run as we do not perform any optimizations on the constraints that are generated before feeding it into the backend SMT solver.
This can be fixed by leveraging radeco IL from radeco IL and performing static analysis / optimizations before feeding the constraints to a solver.

As an added part of this task, concrete values must be treated differently from symbolic values. This reduces unnecessary constraints from being generated in the first place.

rune should allow users to set register values and start/break addresses in the console

Right now, the user requires to type in a long command to set up a session. This makes it a little cumbersome since a single error in the command would require them to fix the command again. It would be ideal if we could have a default context setup and then the user could interact in the console to set those values.

Example:

krypt0@chinmaydd: runec ./a.out
[+] Loading default context values
>> set zf=1
>> set break=0x8000
>> run
[+] Halted at 0x8000

Better integration with radare2

  • Load breakpoints from flags in r2
  • Load start address based on current seek in r2 (unless the start flag is set)
  • Load register values set from r2.
  • Raw commands to radare2

Demo / Examples checklist

  • Interactive explorer
  • rune binary that parses command line options and sets up rune
  • Interactive shell to query for constraints

Engine semantics

  • Formalize and document the Rune engine semantics. Currently, it seems a bit arcane and maybe missing all the needed functionality.
  • Document and extend RuneControl functionality.
  • Generalize Rune to accept instruction in any format (as opposed to the current limitation of LOpInfo).
  • Generalize Rune to emit constraints in any form (as opposed to being restricted to QF_AUBV_Fn now).

Symbolic memory access

Add support for symbolic memory access in rune.

One simple way to solve this issue is to solve for the symbolic variable and spawn an instance of rune to work on each of these solutions.

Fix warnings

  • Fix warnings in build
  • Fix warnings after enabling rust_clippy to ensure better rust practices

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.