GithubHelp home page GithubHelp logo

nafl's Introduction

NaFl

FAQ

  • Why NaFl?

    • NaFl means sarcastically: "It is totally Not AFL"
    • NOTE: when I say AFL, I mean AFL v.0.1 alpha ;)
  • What is it?

    • It is a prototype of a code coverage fuzzer. I wanted to have something like AFL to use in Windows. Unfortunately everything looked very *NIX centric (AFAIK) so I decided to implement the core principles from the ground up (and learned something on the way)

    • It leverages dynamic binary instrumentation (DBI) to measure code coverage in blackbox Windows binaries.

      • "Fun" fact: adding support for Intel PIN to AFL was actually my original research project but mothran beat me to it, see his (her?) fantastic work here
      • NaFl can be thought as this with some Python core implementing a simple fuzzing logic
  • Why does the code suck so much?

    • Don't let physicists do computer science. Or anything else for that matter :)

Installation

NaFl is written in Python (Core) and C/C++ (the DBI core). Most of the installation is straightforward:

  • Clone the project

  • There are two major directories:

    • NaFlCore: nothing to do here at installation time
    • PinTool: contains a single file "MyPinTool.cpp"
    • Compiling your own PinTool is kind of a pain so most of the people I know use this little trick:
      • cd to Pin_directory\source\tools\MyPinTool
      • Overwrite the MyPinTool.cpp file with yours
      • Open the project in Visual Studio (I used VS Community 2013, very recommended to use this one)
      • Build the project
        • NOTE: if you get errors complaining about SafeSEH just deactivate it in the linker options.
        • Right click -> Properties -> Configuration Properties -> Linker -> All Options
        • Search for "Image Has Safe Exception Handlers" and set it to "NO (/SAFESEH: NO)"
      • Move the resulting DLL to a directory of your choice (you can rename it as well)
  • That should do it.

Dependencies

  • Python 2.7.x (grab it here)

    • Recommended Python 2.7.9+ (includes pip)
  • Intel PIN (download it here)

These Python modules are part of the client's core:

  • Winappdbg (pip install winappdbg)
    • This is awesome sauce, check more here
  • SQLAlchemy (pip install sqlalchemy)

The following Python modules are needed for the server:

  • Tornado (pip install tornado)
  • Twisted (pip install twisted)

Running

Once currently installed, running is pretty straightforward.

  • Run the server for collecting information and crash files

    • python server\xmlrpc-server.py
  • Edit the config file

    • Location of PIN and the corresponding PinTool
    • Location of the victim binary to analyze
  • Run the core

    • python NaFlCore.py

Future Enhancements

SO MANY…

  • Plugin system

    • Pre- & Post- processing of the mutation
    • Unzip / Zip for formats like DOCX and alike
    • Decrypt / Encrypt...
    • etc.
  • Static analysis of the victim binary itself

    • Cannibalize strings
    • Check proximity to str(n)cmp and alike…
  • Analysis of the samples

    • Find high entropy regions (uninteresting)
    • Find ASCII regions
    • Compare samples to find fixed tokens (PNG, etc.)
  • Regularly evaluate the quality of mutations in the queue

    • Remove ones not yielding anything interesting in a long time?
    • Trim mutations?

Thanks

This was done during my work time and therefore paid by my current employer, Siemens AG

Yes we do more than washing machines! ;)

Thanks for allowing this public release.

nafl's People

Contributors

carlosgprado avatar

Watchers

James Cloos 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.