Git Product home page Git Product logo

pwnslinger / sn4ke Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 5.0 181.93 MB

Evaluation of two binary mutation engines based on ddisasm and rev.ng

Python 98.57% C 0.90% C++ 0.16% Shell 0.08% PowerShell 0.01% JavaScript 0.10% HTML 0.04% CSS 0.05% SCSS 0.06% Perl 0.01% Go 0.01% Rust 0.01% Ruby 0.01% Roff 0.03% Batchfile 0.01% CMake 0.01%
binary reverse-engineering binary-rewriting mutation-testing

sn4ke's Introduction

SN4KE

DOI
Binary mutation engine based on ddisasm and Rev.ng with a massive set of source-level muatation operators.

REWRITING

To get more insight on our rewriting engine and mutations please take a look at REWRITE.md.

Expetiment results

You can get access to our expetiment results and mutation breakdown through this link. Just in case the above URL was not valid anymore, you can find the results under results.xlsx.

Citing SN4KE

SN4KE has been accepted to the Binary Analysis Research (BAR) workshop co-located with NDSS'21. If you want to refer to our work, please use the following BibTeX for citation.

@misc{ahmadi2021sn4ke,
    title={SN4KE: Practical Mutation Testing at Binary Level},
    author={Mohsen Ahmadi and Pantea Kiaei and Navid Emamdoost},
    year={2021},
    eprint={2102.05709},
    archivePrefix={arXiv},
    primaryClass={cs.SE}
}

Gtirb-capstone

I modified the baseline Gtirb-capstone module to support capstone in the context. This is a patch for the master branch and will be merged later on.

Please get this branch using the following:

git clone --depth=1 --branch=wip/dev https://github.com/pwnslinger/gtirb-capstone/

and install it effectively:

python setup.py install

For detailed instructions on how to run and interact with gtirb-based mutation engine, please take a look at Rewriter doc.

Test

The following pass simply duplicates the any jump group of instructions using Grammatech framework:

First you need to generate the gtirb from binary:

ddisasm thing --ir thing.gtirb

Then fed the generated IR to our binary rewriter:

python myrewriter.py --rebuild patched -o patched.gtirb thing.gtirb

Before patch:

#-----------------------------------
.align 2
.globl main
.type main, @function
#-----------------------------------
main:

.cfi_startproc
.cfi_lsda 255
.cfi_personality 255
.cfi_def_cfa 7, 8
.cfi_offset 16, -8
            push RBP
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
            mov RBP,RSP
.cfi_def_cfa_register 6
            sub RSP,16
            mov RAX,QWORD PTR FS:[40]
            mov QWORD PTR [RBP-8],RAX
            xor EAX,EAX
            lea RAX,QWORD PTR [RBP-12]
            mov RSI,RAX
            lea RDI,QWORD PTR [RIP+.L\_824]
            mov EAX,0
            call __isoc99_scanf@PLT

            mov EAX,DWORD PTR [RBP-12]
            cmp EAX,4919
            jne .L_766

After patch:

#-----------------------------------
.align 2
.globl main
.type main, @function
#-----------------------------------
main:

            push RBP
            mov RBP,RSP
            sub RSP,16
            mov RAX,QWORD PTR FS:[40]
            mov QWORD PTR [RBP-8],RAX
            xor EAX,EAX
            lea RAX,QWORD PTR [RBP-12]
            mov RSI,RAX
            lea RDI,QWORD PTR [RIP+.L\_824]
            mov EAX,0
            call __isoc99_scanf@PLT

            mov EAX,DWORD PTR [RBP-12]
            cmp EAX,4919
            jne .L_766
            jne .L_766

sn4ke's People

Contributors

pantea95 avatar pwnslinger avatar

Stargazers

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

Watchers

 avatar  avatar

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.