Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Extract crash line if symbols present #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

illera88
Copy link

Very useful when analyzing multiple crashes.
Cleaned up some code. making it more legible.

Cheers

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 89.573% when pulling c8d7ede on illera88:master into 1a10e7b on rc0r:master.

Copy link
Owner

@rc0r rc0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Reporting the crash location in terms of location in a particular source file might indeed be useful. I also like the proposed introduction of a Crash (or maybe better Sample) object for increased readability.

However please consider the following changes in order to keep the code as high quality as possible:

  1. Please rebase your changes onto branch experimental! master is used for stable code only, so PRs should be requested against experimental.
  2. Please run the test suite python setup.py test and provide tests for newly added code! Inspecting the results on coveralls.io greatly helps finding code paths uncovered by the test suite.
  3. Please see the inline comments I made to the proposed changes!
  4. It may be useful to also add the newly introduced line info to the crashes database afl-collect can generate. However this change would be a bit more involved since a db schema update is needed to incorporate the new field.

self.exploitability=""
self.description=""
self.hash=""
self.line=""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably wanted to initialize member variables from arguments (even it's not used anywhere in the code atm)?

self.sample=sample
...

@@ -80,16 +80,22 @@ def run(self):
self.in_queue_lock.release()
self.exit = True

class Crash:
Copy link
Owner

@rc0r rc0r Feb 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, maybe it's more suitable to call this class Sample since not necessarily all of the testing samples result in crashes?

@@ -234,13 +234,6 @@ def execute_gdb_script(out_dir, script_filename, num_samples, num_threads):

out_dir = os.path.expanduser(out_dir) + "/"

grep_for = [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep the list of exploitable output parsing keywords. This way they're all listed in one place throughout the code. So whenever the output of exploitable changes, we'll only have to update this list.

crash_obj.description=line.split("Short description: ")[1]
elif "Hash: " in line:
crash_obj.hash=line.split("Hash: ")[1]
elif " at " in line:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" at " does not match any output line of my personal gdb+exploitable setup (rendering the entire pr uneffective). Could this be improved to be more generic?

This is supposed to extract source file and line (f.e. main.c:123) from the crashing location, right?

@rc0r
Copy link
Owner

rc0r commented Jul 3, 2017

Ping @illera88, do you plan to implement (some of) the requested changes? Let me know if you want me to help.

@illera88
Copy link
Author

illera88 commented Jul 5, 2017

Unfortunately I have no time to do it. :/

@rc0r rc0r assigned rc0r and unassigned rc0r Jul 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants