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 filtering by type to handles. #1072

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions volatility3/framework/plugins/windows/handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
description="Process offset in the physical address space",
optional=True,
),
requirements.ListRequirement(
name="types",
element_type=str,
description="Types of handles to include (all other handle types are excluded)",
optional=True,
),
]

def _decode_pointer(self, value, magic):
Expand Down Expand Up @@ -357,6 +363,8 @@ def _generator(self, procs):
symbol_table=kernel.symbol_table_name,
)

object_types = [s.lower() for s in self.config.get("types", [])]

cookie = self.find_cookie(
context=self.context,
layer_name=kernel.layer_name,
Expand All @@ -380,6 +388,9 @@ def _generator(self, procs):
obj_type = entry.get_object_type(type_map, cookie)
if obj_type is None:
continue
elif object_types and obj_type.lower() not in object_types:
continue

if obj_type == "File":
item = entry.Body.cast("_FILE_OBJECT")
obj_name = item.file_name_with_device()
Expand Down