mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-08 18:57:38 +02:00
Automagic: Refactor ASLR finding for all symbol_finder using OSes
This commit is contained in:
@@ -62,9 +62,7 @@ class Check_afinfo(plugins.PluginInterface):
|
||||
yield var_name, "show", var.seq_show
|
||||
|
||||
def _generator(self):
|
||||
masked_vmlinux_symbols = linux.LinuxUtilities.aslr_mask_symbol_table(self.context, self.config['vmlinux'], self.config['primary'])
|
||||
|
||||
vmlinux = contexts.Module(self.context, masked_vmlinux_symbols, self.config['primary'], 0)
|
||||
vmlinux = contexts.Module(self.context, self.config['vmlinux'], self.config['primary'], 0)
|
||||
|
||||
op_members = vmlinux.get_type('file_operations').members
|
||||
seq_members = vmlinux.get_type('seq_operations').members
|
||||
|
||||
@@ -122,10 +122,7 @@ class Check_syscall(plugins.PluginInterface):
|
||||
|
||||
# TODO - add finding and parsing unistd.h once cached file enumeration is added
|
||||
def _generator(self):
|
||||
masked_symbol_table = linux.LinuxUtilities.aslr_mask_symbol_table(self.context, self.config['vmlinux'],
|
||||
self.config['primary'])
|
||||
|
||||
vmlinux = contexts.Module(self.context, masked_symbol_table, self.config['primary'], 0)
|
||||
vmlinux = contexts.Module(self.context, self.config['vmlinux'], self.config['primary'], 0)
|
||||
|
||||
ptr_sz = vmlinux.get_type("pointer").size
|
||||
if ptr_sz == 4:
|
||||
|
||||
@@ -45,9 +45,7 @@ class Lsmod(plugins.PluginInterface):
|
||||
|
||||
This function will throw a SymbolError exception if kernel module support is not enabled.
|
||||
"""
|
||||
masked_vmlinux_symbols = linux.LinuxUtilities.aslr_mask_symbol_table(context, vmlinux_symbols, layer_name)
|
||||
|
||||
vmlinux = contexts.Module(context, masked_vmlinux_symbols, layer_name, 0)
|
||||
vmlinux = contexts.Module(context, vmlinux_symbols, layer_name, 0)
|
||||
|
||||
modules = vmlinux.object_from_symbol(symbol_name = "modules").cast("list_head")
|
||||
|
||||
|
||||
@@ -45,14 +45,11 @@ class Lsof(plugins.PluginInterface):
|
||||
yield (0, (pid, name, fd_num, full_path))
|
||||
|
||||
def run(self):
|
||||
masked_vmlinux_symbols = linux.LinuxUtilities.aslr_mask_symbol_table(self.context, self.config['vmlinux'],
|
||||
self.config['primary'])
|
||||
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
return renderers.TreeGrid([("PID", int), ("Process", str), ("FD", int), ("Path", str)],
|
||||
self._generator(
|
||||
pslist.PsList.list_tasks(self.context,
|
||||
self.config['primary'],
|
||||
masked_vmlinux_symbols,
|
||||
self.config['vmlinux'],
|
||||
filter_func = filter_func)))
|
||||
|
||||
@@ -75,9 +75,7 @@ class PsList(interfaces.plugins.PluginInterface):
|
||||
Yields:
|
||||
Process objects
|
||||
"""
|
||||
masked_vmlinux_symbols = linux.LinuxUtilities.aslr_mask_symbol_table(context, vmlinux_symbols, layer_name)
|
||||
|
||||
vmlinux = contexts.Module(context, masked_vmlinux_symbols, layer_name, 0)
|
||||
vmlinux = contexts.Module(context, vmlinux_symbols, layer_name, 0)
|
||||
|
||||
init_task = vmlinux.object_from_symbol(symbol_name = "init_task")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user