volatility.plugins.windows.poolscanner module¶
-
class
PoolConstraint
(tag, type_name, object_type=None, page_type=None, size=None, index=None, alignment=1)[source]¶ Bases:
object
Class to maintain tag/size/index/type information about Pool header tags.
-
class
PoolHeaderScanner
(module, constraint_lookup, alignment)[source]¶ Bases:
volatility.framework.interfaces.layers.ScannerInterface
-
property
context
¶ - Return type
-
thread_safe
= False¶
-
property
-
class
PoolScanner
(context, config_path, progress_callback=None)[source]¶ Bases:
volatility.framework.interfaces.plugins.PluginInterface
A generic pool scanner plugin.
- Parameters
-
build_configuration
()¶ Constructs a HierarchicalDictionary of all the options required to build this component in the current context.
Ensures that if the class has been created, it can be recreated using the configuration built Inheriting classes must override this to ensure any dependent classes update their configurations too
- Return type
-
static
builtin_constraints
(symbol_table, tags_filter=None)[source]¶ Get built-in PoolConstraints given a list of pool tags.
The tags_filter is a list of pool tags, and the associated PoolConstraints are returned. If tags_filter is empty or not supplied, then all builtin constraints are returned.
-
property
config
¶ The Hierarchical configuration Dictionary for this Configurable object.
- Return type
-
property
context
¶ The context object that this configurable belongs to/configuration is stored in.
- Return type
-
classmethod
generate_pool_scan
(context, layer_name, symbol_table, constraints)[source]¶ - Parameters
context (
ContextInterface
) – The context to retrieve required elements (layers, symbol tables) fromlayer_name (
str
) – The name of the layer on which to operatesymbol_table (
str
) – The name of the table containing the kernel symbolsconstraints (
List
[PoolConstraint
]) – List of pool constraints used to limit the scan results
- Return type
Generator
[Tuple
[PoolConstraint
,ObjectInterface
,ObjectInterface
],None
,None
]- Returns
Iterable of tuples, containing the constraint that matched, the object from memory, the object header used to determine the object
-
classmethod
get_requirements
()[source]¶ Returns a list of Requirement objects for this plugin.
- Return type
-
is_windows_10
(symbol_table: str) → bool¶ - Parameters
context (
ContextInterface
) – The context that contains the symbol table named symbol_tablesymbol_table (
str
) – Name of the symbol table within the context to distinguish the version of
- Return type
- Returns
True if the symbol table is of the required version
-
is_windows_7
(symbol_table: str) → bool¶ - Parameters
context (
ContextInterface
) – The context that contains the symbol table named symbol_tablesymbol_table (
str
) – Name of the symbol table within the context to distinguish the version of
- Return type
- Returns
True if the symbol table is of the required version
-
is_windows_8_or_later
(symbol_table: str) → bool¶ - Parameters
context (
ContextInterface
) – The context that contains the symbol table named symbol_tablesymbol_table (
str
) – Name of the symbol table within the context to distinguish the version of
- Return type
- Returns
True if the symbol table is of the required version
-
classmethod
make_subconfig
(context, base_config_path, **kwargs)¶ Convenience function to allow constructing a new randomly generated sub-configuration path, containing each element from kwargs.
- Parameters
context (
ContextInterface
) – The context in which to store the new configurationbase_config_path (
str
) – The base configuration path on which to build the new configurationkwargs – Keyword arguments that are used to populate the new configuration path
- Returns
The newly generated full configuration path
- Return type
-
classmethod
pool_scan
(context, layer_name, symbol_table, pool_constraints, alignment=8, progress_callback=None)[source]¶ Returns the _POOL_HEADER object (based on the symbol_table template) after scanning through layer_name returning all headers that match any of the constraints provided. Only one constraint can be provided per tag.
- Parameters
context (
ContextInterface
) – The context to retrieve required elements (layers, symbol tables) fromlayer_name (
str
) – The name of the layer on which to operatesymbol_table (
str
) – The name of the table containing the kernel symbolspool_constraints (
List
[PoolConstraint
]) – List of pool constraints used to limit the scan resultsalignment (
int
) – An optional value that all pool headers will be aligned toprogress_callback (
Optional
[Callable
[[float
,str
],None
]]) – An optional function to provide progress feedback whilst scanning
- Return type
Generator
[Tuple
[PoolConstraint
,ObjectInterface
],None
,None
]- Returns
An Iterable of pool constraints and the pool headers associated with them
-
produce_file
(filedata)¶ Adds a file to the plugin’s file store and returns the chosen filename for the file.
- Return type
None
-
run
()[source]¶ Executes the functionality of the code.
Note
This method expects self.validate to have been called to ensure all necessary options have been provided
- Return type
- Returns
A TreeGrid object that can then be passed to a Renderer.
-
set_file_consumer
(consumer)¶ Sets the file consumer to be used by this plugin.
- Return type
None
-
classmethod
unsatisfied
(context, config_path)¶ Returns a list of the names of all unsatisfied requirements.
Since a satisfied set of requirements will return [], it can be used in tests as follows:
unmet = configurable.unsatisfied(context, config_path) if unmet: raise RuntimeError("Unsatisfied requirements: {}".format(unmet)
- Return type
-
version
= (1, 0, 0)¶
-
class
PoolType
[source]¶ Bases:
enum.IntEnum
Class to maintain the different possible PoolTypes The values must be integer powers of 2.
-
FREE
= 4¶
-
NONPAGED
= 2¶
-
PAGED
= 1¶
-
-
os_distinguisher
(version_check, fallback_checks)[source]¶ Distinguishes a symbol table as being above a particular version or point.
This will primarily check the version metadata first and foremost. If that metadata isn’t available then each item in the fallback_checks is tested. If invert is specified then the result will be true if the version is less than that specified, or in the case of fallback, if any of the fallback checks is successful.
- A fallback check is made up of:
a symbol or type name
a member name (implying that the value before was a type name)
whether that symbol, type or member must be present or absent for the symbol table to be more above the required point
Note
Specifying that a member must not be present includes the whole type not being present too (ie, either will pass the test)
- Parameters
version_check (
Callable
[[Tuple
[int
, …]],bool
]) – Function that takes a 4-tuple version and returns whether whether the provided version is above a particular pointfallback_checks (
List
[Tuple
[str
,Optional
[str
],bool
]]) – A list of symbol/types/members of types, and whether they must be present to be above the required point
- Return type
Callable
[[ContextInterface
,str
],bool
]- Returns
A function that takes a context and a symbol table name and determines whether that symbol table passes the distinguishing checks