-
Notifications
You must be signed in to change notification settings - Fork 482
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 low stub offset kernel detection #1566
Conversation
reference: Memprocfs and https://www.youtube.com/watch?v=_ShCSth6dWM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much, this looks really interesting! Have you managed to test it against older systems (x86, PAE, etc)? My concern is that it has a lot of hard coded hex bytes which may not be applicable to all x86-based architectures or memory layouts so I'd want to be careful about that. It would also be good to get a few more comments (although I appreciate the continue comments explaining which bit the guard statements were looking for)...
Could you please also apply ruff (which just wants the unnecessary struct
import removing) and black to format the file appropriately please? Having it pass all the tests will give us a bit of confidence that it's working as intended...
Thanks for your feedback! I'm checking and working on everything you mentioned. |
* Eliminate unnecessary scanning for 32 bit processors where the structure PROCESSOR_START_BLOCK doesn't exist * Put offsets as values of constants in a class - LowStubLayout. * Add documentation in the class and in the function method_low_stub_offset * Run "ruff check --fix" and "black ." * Checked the method works on 3 physical machines
Hi @ikelos, I've addressed your feedback and made the following updates:
Please let me know if there's anything else you'd like me to refine or modify! |
Thanks very much for clearing all those up! It's looking really good now. Rather than a separate class in the middle of the code, would it be possible to move the constants and their comments to the |
* Moved constants out of the class and moved to constants.windows * Applied ruff and black
I've moved the constants into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, very happy with that, thanks! 5:D I'll merge it as soon as the tests finish...
Summary
This PR introduces a Low-Stub based method as an additional approach to kernel offset discovery in Volatility.
When available, this method resolves the kernel offset in ~3 seconds, a significant improvement compared to the ~90 seconds required by the current KDBG scan for large memory dumps (e.g., 32GB).
If the Low Stub method fails (e.g., for Hyper-V .vmem files), Volatility gracefully falls back to the existing KDBG scan.
Motivation
The KDBG scan is computationally intensive, particularly for large memory dumps, and can delay forensic investigations and incident response.
By leveraging the Low Stub, which contains the DTB and kernel base address hint, the kernel offset can be determined far more efficiently, improving overall runtime for all plugins dependent on this step.
Testing
This hybrid approach was tested on:
References
Special thanks to Ulf Frisk and Alex Ionescu for their pioneering research, which informed and inspired this contribution.
Acknowledgment
Thank you for maintaining Volatility as an indispensable tool in the forensic community. I hope this contribution enhances its usability and performance. I welcome any feedback or suggestions for further improvement.