Date: | Wed, 25 Mar 2015 21:34:29 +0100 |
---|---|
From: | Aleksandar Nikolich <anikolich@xxxxxxxxxxxxxx> |
Subject: | [DynInst_API:] Fuzzing tool leveraging Dyninst static binary rewriting |
Hello,
We have just published a tool that leverages Dyninst's static binary rewriting capabilities to enable fuzz testing with American Fuzzy Lop [0] to binaries whose source is unavailable. American Fuzzy Lop (AFL) is a file fuzzer that employs genetic algorithms and source code instrumentation Âto achieve high code coverage and discover interesting test cases. The core of AFL is it's instrumentation that tracks edge transitions during testcase execution and employs a number of heuristics for selecting new interesting testcases. AFL works as a compiler addon, adding its instrumentation during compile time which makes it usable on open source applications. By using Dyninst static binary rewriting, our tool adds AFL-compatible instrumentation to already compiled binaries. Instrumentation tool (afl-dyninst) instruments the supplied binary by inserting callbacks for each basic block and an initialization callback either at _init or at specified entry point. A "libAflDyninst" library contains the callbacks.  During instrumentation, every basic block is assigned a random ID which is used to record the paths as explained in [1]. A special initialization callback is inserted at the binary entry point which spins up the fork server with the logic copied from afl-as. Sources can be found at https://github.com/vrtadmin/moflow/tree/master/afl-dyninst . Usage: ./afl-dyninst -i <binary> -o <binary> -l <library> -e <address> -s <number>       Â-i: Input binary       Â-o: Output binary       Â-l: Library to instrument (repeat for more than one)       Â-e: Entry point address to patch (required for stripped binaries)       Â-r: Runtime library to instrument (path to, repeat for more than one)       Â-s: Number of basic blocks to skip       Â-v: Verbose output Switch -l is used to supply the names of the libraries that should be instrumented along the binary. Instrumented libraries will be copied to the current working directory. This option can be repeated as many times as needed. Depending on the environment, the LD_LIBRARY_PATH should be set to point to instrumented libraries while fuzzing. Runtime loaded shared libraries (loaded via dlopen(3)) can be specified with switch -r. Instrumented runtime libraries will be written to the same location with a ".ins" suffix as not to overwrite the original ones. Make sure to backup the originals and then rename the instrumented ones to original name. If the binary being instrumented is not stripped and switch -e isn't specified, callback to fork server initialization is inserted at _init. Otherwise, it is inserted at the specified address. Address of main is usually a good place to start. In some cases on stripped binaries, static analysis can fail leading to wrong basic block detection. Coupled with verbose output, switch -s can be used to skip specified number of initial basic blocks. The afl-users mailing list anouncement is atÂhttps://groups.google.com/forum/#!topic/afl-users/HlSQdbOTlpg . We would be happy to receive any feedback. |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | [DynInst_API:] COMMIT: InstructionAPI Integer Multiply, Alexander Morris |
---|---|
Next by Date: | Re: [DynInst_API:] COMMIT: InstructionAPI Integer Multiply, Josh Stone |
Previous by Thread: | Re: [DynInst_API:] Examples for constructing instrumentation code snippets, Bill Williams |
Next by Thread: | [DynInst_API:] Fwd: Dyninst Help, Barton Miller |
Indexes: | [Date] [Thread] |