Code Monkey home page Code Monkey logo

sys-extracter's Introduction

Sys-Extracter

This is the cross platform framework to recover driver's dispatch routine and all constraints for valid IOCTL codes.

It based on IREC and improve the IREC's limitations.

Installation & Getting Start

# make virtual environment
pip uninstall virtualenv
pip install virtualenv
sudo apt install python3-virtualenv -y

virtualenv sangjun
source sangjun/bin/activate

pip install angr

python3 sys-extracter.py -driver target_driver.sys

Example Result

Dispatch Routine

Recovered IOCTL Constraints

Implements of IREC

Recovering IOCTL as well as other dispatch routine

Fix the finding method of Recovering OutputBufferLength & InputBufferLength Constraints

When OutputBufferLength < 8, it is invalid constraints but IREC have mistake analyze it.

Sys-Extracter

    {   'InBufferLength': ['0-inf'],
        'IoControlCode': '0x7405c',
        'OutBufferLength': ['8-inf']},

IREC

  {   'InBufferLength': ['0-inf'],
        'IoControlCode': '0x7405c',
        'OutBufferLength': ['0-7']},

I fix this issue, so it can discover untainted code blocks.

IREC find the ended first Simstate and consider it is invalid constraints. But that has a error when All Simstate end same level.

So My Finder check IRP.IoStatus.Status fields and consider invalid constraints based on the NT_STATUS Code

NT_SUCCESS(Status)
Evaluates to TRUE if the return value specified by Status is a success type (0 − 0x3FFFFFFF) or an informational type (0x40000000 − 0x7FFFFFFF).

NT_INFORMATION(Status)
Evaluates to TRUE if the return value specified by Status is an informational type (0x40000000 − 0x7FFFFFFF).

NT_WARNING(Status)
Evaluates to TRUE if the return value specified by Status is a warning type (0x80000000 − 0xBFFFFFFF).

NT_ERROR(Status)
Evaluates to TRUE if the return value specified by Status is an error type (0xC0000000 - 0xFFFFFFFF).

sys-extracter's People

Contributors

5angjun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

gbdngb12

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.