Giter Site home page Giter Site logo

ebfuscator's Introduction

Ebfuscator

Ebfuscator is the first tool that allows you to obfuscate strings using the ebfuscation technique.

Ebfuscator takes a C source file, the target platform (Windows, Linux) and a list of variables in the source you want to obfuscate. It applies a transformation based on Ebfuscation technique and produces a C source obfuscated file.

This tool is a proof of concept so there are many features that are not yet implemented and it has its limitations. For more information read the Limitations section.

Ebfuscation: Abusing system errors for binary obfuscation

Ebfuscation, is a technique which can be used to implement different transformations such as Literals encoding, Control Flow Flattening and Virtualization. This technique is based on System's errors. To understand better how this technique works please read the article I wrote here where I explain in detail the technique.

Usage

Ebfuscator must be run from the project path, since it depends on the files located into {CURRENT_PATH}/errors/*

First you need to ebfuscate your source program

Linux:

./ebfuscator.bin --platform [platform] --source [source] --var [variables] ...

If success the folder ./output/ is created where you can find your C source code obfuscated (ebfuscated.c) and both errors.c and erros.h files where you can find the need code to generate errors for the target platform you chose.

So now you only need to compile the sources for your target platform. In case of linux you can do

gcc -o my_program ./output/ebfuscated.c ./output/errors.c -lm

Enjoy!

Example

The following example uses the source program ./examples/crackme_test.c and it can be ebfuscated for both Linux and Windows

  1. ebfuscate the variable passwd for windows platform.

./ebfuscator.bin --platform windows --source ./examples/crackme_test.c --var passwd

  1. ebfuscate the variables passwd, invalid_pass and valid_pass for linux platform.

./ebfuscator.bin --platform linux --source ./examples/crackme_test.c --var passwd valid_pass invalid_pass

  1. ebfuscate the variables invalid_pass and valid_pass for windows platform.

./ebfuscator.bin --platform windows --source ./examples/crackme_test.c --var valid_pass --var invalid_pass

Limitations

  • Analyzer: The main idea of this project was not to have a powerful analyzer, rather the analyzer is very dumb. So in order for your variables to be found by the analyzer they have to be declared in compliance with the following requirements:

    • Declaration and initialization of the string/bytearray must be done in the same line.
    • The declaration must match the following regex r#"([\s\t])char\s*?\s*{variable}\s*([[0-9]])?\s=\s*(".")\s;"#. Here some valid examples:
      • char * valid = "test";
      • char valid[] = "test";
      • char valid[5] = "test\0";
      • char *shellcode = "\xDE\xAD\xBE\xEF";
  • Platform: At this moment the tool only supports Windows and Linux based operating systems.

  • Errors: There are only a few errors implemented for each platform, this causes a lot of overhead when generating the obfuscated program. This overhead could be as well a feature but it's preferible to have the way to generate an error for a given value instead of combine different errors to get it.

Upcoming

  • Ebfuscator code release.
  • Stealthy mode to retrieve the errors. Instead of use GetLastError() or errno, read errors from TIB.
  • Implementation of more errors, for both Windows and Linux (Pull Request are allowed :D)

ebfuscator's People

Contributors

d00rt avatar

Stargazers

Murad 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.