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

Windows: Add support for missing callback types #1110

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

Conversation

dgmcdona
Copy link
Contributor

@dgmcdona dgmcdona commented Mar 5, 2024

This PR updates the windows.callbacks.Callbacks plugin to support callback types that were present in the original volatility framework but have not yet been added to volatility3. These callback types include:

  • IoRegisterShutdownNotification
  • IoRegisterFsRegistrationChange
  • GenericKernelCallback
  • EventCategoryHardwareProfileChange
  • EventCategoryDeviceInterfaceChange
  • EventCategoryTargetDeviceChange
  • DbgSetDebugPrintCallback

This required updates to the callbacks JSON symbol files, the creation of a _SHUTDOWN_PACKET extension, and updates to the plugin itself. Because it introduces three new requirements (handles, driverirp, and poolscanner), I have incremented the major version number for the callbacks plugin. No other plugins depend on the callbacks plugin at this time, so it was not necessary to increase version numbers in other plugins.

Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

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

Thanks, there's a lot to go through here but it generally looks pretty good. It's quite a significant chunk of functionality though so I'd quite like to defer to @iMHLv2 's opinion to ensure it does what it's supposed and there's no gotchas that I've missed...

volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
@ikelos ikelos requested a review from iMHLv2 March 5, 2024 22:07
@dgmcdona dgmcdona force-pushed the dgmcdona/windows-callbacks branch 3 times, most recently from 186c814 to 84f8997 Compare March 12, 2024 03:12
Updates the windows callbacks symbol files to include structures that
were missing from the original volatility plugin.
Fixes a bad format string inside of a raised exception
Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

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

Yep, pretty happy with this, just a few more comments. 5:)

volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
context, layer_name, nt_symbol_table, constraints
):
try:
if hasattr(mem_object, "is_valid") and not mem_object.is_valid():
Copy link
Member

Choose a reason for hiding this comment

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

What objects don't have an is_valid method? Feels like this could be changed to just check pointers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The check fails for StructType objects if we remove the hasattr check. For instance: AttributeError: StructType has no attribute: callbacks-x641!_NOTIFICATION_PACKET.is_valid

There is an explicitly defined is_valid method in the callbacks extension added as part of this PR, but I don't think any other objects will have an is_valid method since they are just StructType objects defined in the callbacks symbol files.

volatility3/framework/plugins/windows/callbacks.py Outdated Show resolved Hide resolved
@ikelos
Copy link
Member

ikelos commented Mar 13, 2024

@iMHLv2 could you give this a scan over to check there's nothing subtle I've missed please?

Updates the Windows callbacks plugin to support several types of
callbacks that were present in the original volatility framework, but
were missing in volatility3. Adds an extension for `_SHUTDOWN_PACKET`
structures for determining validity of structure.
This plugin class was missing a `_version` attribute, so I added one and
set it to (1, 0, 0).
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

Successfully merging this pull request may close these issues.

None yet

3 participants