Skip to content

Commit e935254

Browse files
authored
Merge pull request #1640 from volatilityfoundation/plugin/windows_gui
Add APIs and initial plugins for GUI support and fit Windows major APIs to current design flow
2 parents caa52c0 + 7e00f2c commit e935254

File tree

96 files changed

+226824
-641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+226824
-641
lines changed

doc/source/simple-plugin.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ that will be output as part of the :py:class:`~volatility3.framework.interfaces.
198198
def run(self):
199199

200200
filter_func = pslist.PsList.create_pid_filter(self.config.get('pid', None))
201-
kernel = self.context.modules[self.config['kernel']]
202201

203202
return renderers.TreeGrid(
204203
[
@@ -211,9 +210,8 @@ that will be output as part of the :py:class:`~volatility3.framework.interfaces.
211210
],
212211
self._generator(
213212
pslist.PsList.list_processes(
214-
self.context,
215-
kernel.layer_name,
216-
kernel.symbol_table_name,
213+
context=self.context,
214+
kernel_module_name=self.config['kernel'],
217215
filter_func = filter_func
218216
)
219217
)
@@ -235,7 +233,7 @@ the :py:class:`~volatility3.plugins.windows.pslist.PsList` plugin. That plugin
235233
so that other plugins can call it. As such, it takes all the necessary parameters rather than accessing them
236234
from a configuration. Since it must be portable code, it takes a context, as well as the layer name,
237235
symbol table and optionally a filter. In this instance we unconditionally
238-
pass it the values from the configuration for the layer and symbol table from the kernel module object, constructed from
236+
pass it the value from the configuration for the kernel module name, constructed from
239237
the ``kernel`` configuration requirement. This will generate a list
240238
of :py:class:`~volatility3.framework.symbols.windows.extensions.EPROCESS` objects, as provided by the :py:class:`~volatility.plugins.windows.pslist.PsList` plugin,
241239
and is not covered here but is used as an example for how to share code across plugins

volatility3/cli/volshell/windows.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_requirements(cls):
1818
return [
1919
requirements.ModuleRequirement(name="kernel", description="Windows kernel"),
2020
requirements.PluginRequirement(
21-
name="pslist", plugin=pslist.PsList, version=(2, 0, 0)
21+
name="pslist", plugin=pslist.PsList, version=(3, 0, 0)
2222
),
2323
requirements.IntRequirement(
2424
name="pid", description="Process ID", optional=True
@@ -39,9 +39,7 @@ def list_processes(self):
3939
"""Returns a list of EPROCESS objects from the primary layer"""
4040
# We always use the main kernel memory and associated symbols
4141
return list(
42-
pslist.PsList.list_processes(
43-
self.context, self.current_layer, self.current_symbol_table
44-
)
42+
pslist.PsList.list_processes(self.context, self.current_kernel_name)
4543
)
4644

4745
def get_process(self, pid=None, virtaddr=None, physaddr=None):

volatility3/framework/constants/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We use the SemVer 2.0.0 versioning scheme
22
VERSION_MAJOR = 2 # Number of releases of the library with a breaking change
3-
VERSION_MINOR = 22 # Number of changes that only add to the interface
3+
VERSION_MINOR = 23 # Number of changes that only add to the interface
44
VERSION_PATCH = 0 # Number of changes that do not change the interface
55
VERSION_SUFFIX = ""
66

volatility3/framework/layers/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
# Win10 17063 introduced the Registry process to map most hives. Check
6767
# if it exists and update RegistryHive._base_layer
6868
for proc in pslist.PsList.list_processes(
69-
self.context, self.config["base_layer"], self.config["nt_symbols"]
69+
context=self.context, kernel_module_name=self.config["kernel_module_name"]
7070
):
7171
proc_name = proc.ImageFileName.cast(
7272
"string", max_length=proc.ImageFileName.vol.count, errors="replace"

volatility3/framework/plugins/linux/bash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
4646
def _generator(self, tasks):
4747
vmlinux = self.context.modules[self.config["kernel"]]
4848
is_32bit = not symbols.symbol_table_is_64bit(
49-
self.context, vmlinux.symbol_table_name
49+
context=self.context, symbol_table_name=vmlinux.symbol_table_name
5050
)
5151
if is_32bit:
5252
pack_format = "I"

volatility3/framework/plugins/linux/malfind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _generator(self, tasks):
6464
# determine if we're on a 32 or 64 bit kernel
6565
vmlinux = self.context.modules[self.config["kernel"]]
6666
is_32bit_arch = not symbols.symbol_table_is_64bit(
67-
self.context, vmlinux.symbol_table_name
67+
context=self.context, symbol_table_name=vmlinux.symbol_table_name
6868
)
6969

7070
for task in tasks:

volatility3/framework/plugins/linux/psscan.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def scan_tasks(
8484
vmlinux = context.modules[vmlinux_module_name]
8585

8686
# check if this image is 32bit or 64bit
87-
is_32bit = not symbols.symbol_table_is_64bit(context, vmlinux.symbol_table_name)
87+
is_32bit = not symbols.symbol_table_is_64bit(
88+
context=context, symbol_table_name=vmlinux.symbol_table_name
89+
)
8890
if is_32bit:
8991
pack_format = "I"
9092
else:

volatility3/framework/plugins/mac/bash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_requirements(cls):
4444
def _generator(self, tasks):
4545
darwin = self.context.modules[self.config["kernel"]]
4646
is_32bit = not symbols.symbol_table_is_64bit(
47-
self.context, darwin.symbol_table_name
47+
context=self.context, symbol_table_name=darwin.symbol_table_name
4848
)
4949
if is_32bit:
5050
pack_format = "I"

volatility3/framework/plugins/windows/amcache.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ class Amcache(interfaces.plugins.PluginInterface, timeliner.TimeLinerInterface):
218218
"""Extract information on executed applications from the AmCache."""
219219

220220
_required_framework_version = (2, 0, 0)
221-
_version = (1, 0, 0)
221+
222+
# 2.0.0 - changed the signature of get_amcache_hive
223+
_version = (2, 0, 0)
222224

223225
@classmethod
224226
def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:
@@ -230,7 +232,7 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
230232
architectures=["Intel32", "Intel64"],
231233
),
232234
requirements.PluginRequirement(
233-
name="hivelist", plugin=hivelist.HiveList, version=(1, 0, 0)
235+
name="hivelist", plugin=hivelist.HiveList, version=(2, 0, 0)
234236
),
235237
]
236238

@@ -252,7 +254,7 @@ def get_amcache_hive(
252254
cls,
253255
context: interfaces.context.ContextInterface,
254256
config_path: str,
255-
kernel: interfaces.context.ModuleInterface,
257+
kernel_module_name: str,
256258
) -> Optional[registry.RegistryHive]:
257259
"""Retrieves the `Amcache.hve` registry hive from the kernel module, if it can be located."""
258260
return next(
@@ -261,8 +263,7 @@ def get_amcache_hive(
261263
base_config_path=interfaces.configuration.path_join(
262264
config_path, "hivelist"
263265
),
264-
layer_name=kernel.layer_name,
265-
symbol_table=kernel.symbol_table_name,
266+
kernel_module_name=kernel_module_name,
266267
filter_string="amcache",
267268
),
268269
None,
@@ -523,8 +524,6 @@ def parse_driver_binary_key(
523524
)
524525

525526
def _generator(self) -> Iterator[Tuple[int, _AmcacheEntry]]:
526-
kernel = self.context.modules[self.config["kernel"]]
527-
528527
def indented(
529528
entry_gen: Iterable[_AmcacheEntry], indent: int = 0
530529
) -> Iterator[Tuple[int, _AmcacheEntry]]:
@@ -533,7 +532,9 @@ def indented(
533532

534533
# Building the dictionary ahead of time is much better for performance
535534
# vs looking up each service's DLL individually.
536-
amcache = self.get_amcache_hive(self.context, self.config_path, kernel)
535+
amcache = self.get_amcache_hive(
536+
self.context, self.config_path, self.config["kernel"]
537+
)
537538
if amcache is None:
538539
return
539540

volatility3/framework/plugins/windows/cachedump.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_requirements(cls):
3333
architectures=["Intel32", "Intel64"],
3434
),
3535
requirements.PluginRequirement(
36-
name="hivelist", plugin=hivelist.HiveList, version=(1, 0, 0)
36+
name="hivelist", plugin=hivelist.HiveList, version=(2, 0, 0)
3737
),
3838
requirements.PluginRequirement(
3939
name="lsadump", plugin=lsadump.Lsadump, version=(1, 0, 0)
@@ -169,13 +169,11 @@ def run(self):
169169
offset = self.config.get("offset", None)
170170

171171
syshive = sechive = None
172-
kernel = self.context.modules[self.config["kernel"]]
173172

174173
for hive in hivelist.HiveList.list_hives(
175-
self.context,
176-
self.config_path,
177-
kernel.layer_name,
178-
kernel.symbol_table_name,
174+
context=self.context,
175+
base_config_path=self.config_path,
176+
kernel_module_name=self.config["kernel"],
179177
hive_offsets=None if offset is None else [offset],
180178
):
181179
if hive.get_name().split("\\")[-1].upper() == "SYSTEM":

0 commit comments

Comments
 (0)