-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
add "ioctl" target #155
add "ioctl" target #155
Conversation
Woot, this looks awesome! Give me a week or two to review this :)
Cheers
…On Sat, Mar 4, 2023 at 4:43 AM Roman ***@***.***> wrote:
Universal code for fuzzing any driver from the state captured on
ntdll!NtDeviceIoControlFile().
There are 2 modes (switchable at compile time via MutateIoctl flag):
1. Mutate only the buffer - IOCTL from the state does not change.
2. Mutate buffer and IOCTL - the IOCTL is captured from the first 4
bytes of the input buffer).
------------------------------
You can view, comment on, or merge this pull request online at:
#155
Commit Summary
- a874eba
<a874eba>
add "ioctl" target
File Changes
(2 files <https://github.com/0vercl0k/wtf/pull/155/files>)
- *M* .gitignore
<https://github.com/0vercl0k/wtf/pull/155/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947>
(5)
- *A* src/wtf/fuzzer_ioctl.cc
<https://github.com/0vercl0k/wtf/pull/155/files#diff-b9ef863d266837d9694d2f95e16f1a9c4b86e26c3951c0169df9268b8bb1d30e>
(187)
Patch Links:
- https://github.com/0vercl0k/wtf/pull/155.patch
- https://github.com/0vercl0k/wtf/pull/155.diff
—
Reply to this email directly, view it on GitHub
<#155>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALIORKMB7KE4R7IFXTBCNDW2M2HNANCNFSM6AAAAAAVPQ3RNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@1ndahous3 I took the liberty to push some changes on your branch; basically I reworked the code to be a generic ioctl fuzzer as you wanted but without forcing the user to take their breakpoint at I also switched to Give it a shot and let me know what you think. I will probably change a little bit the Cheers |
@0vercl0k very interesting rework, awesome.
Definitely a good change!
Well, I understand the new idea and algorithm, but I don't fully understand the flow: what additional states can now be dumped? My reasoning is that if we allow a random state to be dumped, the following things can happen:
The second scenario is more dangerous: visually, when passing a corpus for a specific driver, no errors will occur for this state, but in practice, our buffers will not be passed to the ioctl handler of the desired driver. My opinion: if you mean that the "more general" variant allows to dump the state quite close prior to calling |
Why are you adding |
Okay yes you are right that it might not be ideal to mutate EVERY call to What do you think if we add a parameter that specifies the handle? If the handle doesn't match an hardcoded value, we don't do anything with the call; if it does, we mutate? Do you think that'd work? I am adding Cheers |
I don't think this is a good idea, because with such dumps (when calls to |
OK sounds fair - I'll revert that code. In that case, isn't the this fuzzer nearly equivalent to Cheers |
@0vercl0k I agree that the "hevd" target is a special case of "ioctl" in terms of fuzzing. But HEVD is a training kit (driver, usermode application, target), i.e. with a controlled IOCTL and buffer in usermode function that is easy to catch in a dump. A So maybe it's better to just leave the "hevd" target unchanged as part of a special simplified training kit? This does not exclude the possibility of using new "ioctl" target for fuzzing HEVD. |
Okay sounds good - I reverted the changes. I need to generate a dump to try it out (hopefully this weekend); let me know if you see anything wrong! Cheers |
Sorry for procrastinating on this - I finally grabbed a dump to be able to test this and was able to fix a few bugs. I will rework this Anyways, hopefully this will land tomorrow or the day after :) Cheers |
Universal code for fuzzing any driver from the state captured on
ntdll!NtDeviceIoControlFile()
.There are 2 modes (switchable at compile time via
MutateIoctl
flag):