Skip to content

Commit

Permalink
Housekeeping to make official 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ex0dus-0x committed Nov 17, 2021
1 parent 3ffc08b commit 9dfcd77
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,33 @@ Check out the blog post detailing the plugin [here](https://codemuch.tech/2021/0

## Example

Here is an example of the fuzzable plugin running on Binary Ninja's `libbinaryninjacore.so` dependency,
accuracy identifying targets that are optimal for fuzzing and further vulnerability assessment:
Here is an example of the fuzzable plugin running on [cesanta/mjs](https://github.com/cesanta/mjs),
accuracy identifying targets for fuzzing and further vulnerability assessment:

![Sample](https://github.com/ex0dus-0x/fuzzable/blob/master/screen.png?raw=true "Sample")

## Settings

Given how diverse binaries are, the plugin provides several settings one may choose to tweak for different targets:

* `fuzzable.depth_threshold`

Minimum number of levels in callgraph to be considered optimal for fuzzing.

Functions that automatically have a callgraph depth of >100 will be marked as fuzzable. However, this may be unnecessary in smaller/less
complex binaries, or those that employing inlining.

* `fuzzable.loop_increase_score`

Don't include natural loop as part of the fuzzability score.

The presence of natural loops are incorporated as part of the fuzzability score, since they may denote some form of scanning/parsing
behavior that is worthy to analyze. Turn off if it generates a lot of false positives.

* `fuzzable.skip_stripped`

Ignore including functions that are stripped as part of the final results.

## License

[MIT](https://codemuch.tech/license.txt)
[MIT License](https://codemuch.tech/license.txt)
7 changes: 3 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
""",
)


Settings().register_setting(
"fuzzable.skip_stripped",
"""
Expand Down Expand Up @@ -126,13 +125,13 @@ def run(self):


def run_fuzzable(view):
""" Callback used to instantiate thread and start analysis """
"""Callback used to instantiate thread and start analysis"""
task = WrapperTask(view)
task.start()


def run_export_report(view):
""" Generate a report from a previous analysis, and export as CSV """
"""Generate a report from a previous analysis, and export as CSV"""
log.log_info("Attempting to export results to CSV")
try:
csv_output = view.query_metadata("csv")
Expand All @@ -154,7 +153,7 @@ def run_export_report(view):


def run_harness_generation(view, func):
""" Experimental automatic fuzzer harness generation support """
"""Experimental automatic fuzzer harness generation support"""

template_file = os.path.join(binaryninja.user_plugin_path(), "fuzzable")
if view.view_type == "ELF":
Expand Down
4 changes: 2 additions & 2 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def __init__(self, target):
self.has_loop = FuzzableAnalysis.contains_loop(target)

def markdown_row(self):
""" Output as a Markdown row when displaying back to user """
"""Output as a Markdown row when displaying back to user"""
return f"| [{self.name}](binaryninja://?expr={self.name}) | {self.fuzzability} | {self.depth} | {self.has_loop} | {self.recursive} | \n"

def csv_row(self):
""" Generate a CSV row for exporting to file """
"""Generate a CSV row for exporting to file"""
return f"{self.name}, {self.stripped}, {self.interesting_name}, {self.interesting_args}, {self.depth}, {self.has_loop}, {self.fuzzability}\n"

@staticmethod
Expand Down
6 changes: 4 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"api": [
"python3"
],
"description": "Automatically identify fuzzable targets",
"description": "Automatically identify fuzzable targets in binaries.",
"longdescription": "This is a helper Binary Ninja plugin to assist in identifying functions that are optimal targets for fuzzing and dynamic analysis. This is useful for vulnerability researchers wanting to fuzz executables or libraries without manual reverse engineering, and need some fast insight about what functions are potential targets to extrapolate for their harnesses.",
"license": {
"name": "MIT"
"name": "MIT",
"text": "Copyright 2021 @ex0dus-0x Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
},
"platforms": [
"Darwin",
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

0 comments on commit 9dfcd77

Please sign in to comment.