Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag to support command-line argument fuzzing #16

Open
bannsec opened this issue Sep 2, 2018 · 3 comments
Open

Flag to support command-line argument fuzzing #16

bannsec opened this issue Sep 2, 2018 · 3 comments

Comments

@bannsec
Copy link
Owner

bannsec commented Sep 2, 2018

Currently autoPwn should work as normal with afl style command fuzzing, which boils down to @@ generation of a file name per run. This doesn't actually fuzz the command-line arguments and there is experimental support for fuzzing command-line arguments for afl if you compile your target binary with some modifications.

It would be helpful if autoPwn could automate this for black-box fuzzing. Generally, that would seem to boil down into the following steps:

  1. Modify binary in some way to initially take input from stdin and input that into argv correctly.
    a. Possibly via LD_PRELOAD somehow
    b. Possibly via on-the-fly binary patching (i.e.: patchkit, preeny in-memory patch, patcherex if they ever fix it...)
  2. User would need to specify where to fuzz via some param (similar to @@)
  3. autoPwn would spawn with that argument filled with a buffer of "A", to simply make sure argv has room for the fuzz. Likely would also pass in this argument placement via environment variable (i.e.: AUTOPWN_ARGV=1)
  4. Hooked code would lookup the environment variable, strlen check the existing input for that argument, then read in up to that length of input from stdin, ensuring to null terminate.

It's messy, but i haven't seen a great solution to this challenge yet.

@bannsec
Copy link
Owner Author

bannsec commented Sep 3, 2018

Initial support for @@@ argument has been added. Currently, it only works for amd64 and likely has some bugs.

If anyone wants to try, simply use it the same way that you would use the AFL @@ command. I.e.:

autoPwn --disable-drill ls @@@

Recommending --disable-drill for now since it will not correctly hand-off input to driller.

@bannsec
Copy link
Owner Author

bannsec commented Sep 4, 2018

Added support for arbitrary number of @@@ fuzz locations: 2c66175

bannsec added a commit that referenced this issue Sep 5, 2018
@bannsec
Copy link
Owner Author

bannsec commented Sep 5, 2018

Supports i386 now as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant