diff --git a/volatility/framework/interfaces/plugins.py b/volatility/framework/interfaces/plugins.py index 28bce85e7..4694c09c2 100644 --- a/volatility/framework/interfaces/plugins.py +++ b/volatility/framework/interfaces/plugins.py @@ -78,6 +78,10 @@ class PluginInterface(interfaces_configuration.ConfigurableInterface, metaclass context it is passed. """ + # Be careful with inheritance around this + _version = (0, 0, 0) # type: Tuple[int, int, int] + """The _version variable is a quick way for plugins to define their current interface, it should follow SemVer rules""" + def __init__(self, context: interfaces_context.ContextInterface, config_path: str, @@ -111,7 +115,7 @@ class PluginInterface(interfaces_configuration.ConfigurableInterface, metaclass MINOR version when you add functionality in a backwards compatible manner. PATCH version when you make backwards compatible bug fixes. """ - return (0, 0, 0) + return cls._version @classmethod def get_requirements(cls) -> List[interfaces_configuration.RequirementInterface]: diff --git a/volatility/framework/plugins/linux/pslist.py b/volatility/framework/plugins/linux/pslist.py index 034e1505f..22e6d050d 100644 --- a/volatility/framework/plugins/linux/pslist.py +++ b/volatility/framework/plugins/linux/pslist.py @@ -21,7 +21,6 @@ from typing import Callable, Iterable, List, Any import volatility.framework.interfaces.plugins as interfaces_plugins -from volatility import classproperty from volatility.framework import renderers, interfaces, contexts from volatility.framework.automagic import linux from volatility.framework.configuration import requirements @@ -31,9 +30,7 @@ from volatility.framework.objects import utility class PsList(interfaces_plugins.PluginInterface): """Lists the processes present in a particular linux memory image""" - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]: diff --git a/volatility/framework/plugins/mac/lsmod.py b/volatility/framework/plugins/mac/lsmod.py index 110b18a45..a6bd35727 100644 --- a/volatility/framework/plugins/mac/lsmod.py +++ b/volatility/framework/plugins/mac/lsmod.py @@ -20,7 +20,6 @@ """A module containing a collection of plugins that produce data typically found in Mac's lsmod command. """ -from volatility import classproperty from volatility.framework import renderers, interfaces, contexts from volatility.framework.automagic import mac from volatility.framework.configuration import requirements @@ -32,9 +31,7 @@ from volatility.framework.renderers import format_hints class Lsmod(plugins.PluginInterface): """Lists loaded kernel modules""" - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls): diff --git a/volatility/framework/plugins/mac/pslist.py b/volatility/framework/plugins/mac/pslist.py index e4cc2434d..dda4f88bf 100644 --- a/volatility/framework/plugins/mac/pslist.py +++ b/volatility/framework/plugins/mac/pslist.py @@ -21,7 +21,6 @@ import logging from typing import Callable, Iterable, List -from volatility import classproperty from volatility.framework import renderers, interfaces, contexts from volatility.framework.automagic import mac from volatility.framework.configuration import requirements @@ -33,9 +32,7 @@ vollog = logging.getLogger(__name__) class PsList(interfaces.plugins.PluginInterface): """Lists the processes present in a particular mac memory image""" - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls): diff --git a/volatility/framework/plugins/windows/driverscan.py b/volatility/framework/plugins/windows/driverscan.py index 9166e0230..3f9137cc1 100644 --- a/volatility/framework/plugins/windows/driverscan.py +++ b/volatility/framework/plugins/windows/driverscan.py @@ -23,7 +23,6 @@ from typing import Iterable import volatility.plugins.windows.poolscanner as poolscanner import volatility.framework.interfaces.plugins as plugins -from volatility import classproperty from volatility.framework import renderers, interfaces, exceptions from volatility.framework.configuration import requirements from volatility.framework.renderers import format_hints @@ -32,6 +31,8 @@ from volatility.framework.renderers import format_hints class DriverScan(plugins.PluginInterface): """Scans for drivers present in a particular windows memory image""" + _version = (1, 0, 0) + @classmethod def get_requirements(cls): return [ @@ -80,7 +81,3 @@ class DriverScan(plugins.PluginInterface): return renderers.TreeGrid([("Offset", format_hints.Hex), ("Start", format_hints.Hex), ("Size", format_hints.Hex), ("Service Key", str), ("Driver Name", str), ("Name", str)], self._generator()) - - @classproperty - def version(cls): - return (1, 0, 0) diff --git a/volatility/framework/plugins/windows/modules.py b/volatility/framework/plugins/windows/modules.py index 7a90dcdad..c56610b79 100644 --- a/volatility/framework/plugins/windows/modules.py +++ b/volatility/framework/plugins/windows/modules.py @@ -20,7 +20,6 @@ from typing import List -from volatility import classproperty from volatility.framework import constants from volatility.framework import exceptions, interfaces from volatility.framework import renderers @@ -31,9 +30,7 @@ from volatility.framework.renderers import format_hints class Modules(interfaces.plugins.PluginInterface): """Lists the loaded kernel modules""" - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]: diff --git a/volatility/framework/plugins/windows/poolscanner.py b/volatility/framework/plugins/windows/poolscanner.py index 37696085a..3f9dfea88 100644 --- a/volatility/framework/plugins/windows/poolscanner.py +++ b/volatility/framework/plugins/windows/poolscanner.py @@ -25,7 +25,6 @@ from typing import Dict, Generator, List, Optional, Tuple, Callable import volatility.plugins.windows.handles as handles -from volatility import classproperty from volatility.framework import constants, interfaces, renderers, exceptions, symbols from volatility.framework.configuration import requirements from volatility.framework.interfaces import plugins, configuration @@ -179,9 +178,7 @@ def os_distinguisher(version_check: Callable[[Tuple[int, ...]], bool], class PoolScanner(plugins.PluginInterface): """A generic pool scanner plugin""" - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]: diff --git a/volatility/framework/plugins/windows/pslist.py b/volatility/framework/plugins/windows/pslist.py index 24757d04a..14689fb0d 100644 --- a/volatility/framework/plugins/windows/pslist.py +++ b/volatility/framework/plugins/windows/pslist.py @@ -22,7 +22,6 @@ import datetime from typing import Callable, Iterable, List import volatility.framework.interfaces.plugins as plugins -from volatility import classproperty from volatility.framework import renderers, interfaces, layers from volatility.framework.configuration import requirements from volatility.framework.objects import utility @@ -33,6 +32,7 @@ from volatility.plugins import timeliner class PsList(plugins.PluginInterface, timeliner.TimeLinerInterface): """Lists the processes present in a particular windows memory image""" + _version = (1, 0, 0) PHYSICAL_DEFAULT = False @classmethod @@ -51,10 +51,6 @@ class PsList(plugins.PluginInterface, timeliner.TimeLinerInterface): name = 'pid', description = "Process ID to include (all other processes are excluded)", optional = True) ] - @classproperty - def version(cls): - return (1, 0, 0) - @classmethod def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[interfaces.objects.ObjectInterface], bool]: filter_func = lambda _: False diff --git a/volatility/framework/plugins/windows/ssdt.py b/volatility/framework/plugins/windows/ssdt.py index 39b889d34..0ef3114e2 100644 --- a/volatility/framework/plugins/windows/ssdt.py +++ b/volatility/framework/plugins/windows/ssdt.py @@ -21,7 +21,6 @@ import os from typing import Any, Iterator, List, Tuple -from volatility import classproperty from volatility.framework import constants, interfaces from volatility.framework import contexts from volatility.framework import exceptions, symbols @@ -36,6 +35,8 @@ from volatility.plugins.windows import modules class SSDT(plugins.PluginInterface): """Lists the system call table""" + _version = (1, 0, 0) + @classmethod def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]: return [ @@ -132,7 +133,3 @@ class SSDT(plugins.PluginInterface): def run(self) -> renderers.TreeGrid: return renderers.TreeGrid([("Index", int), ("Address", format_hints.Hex), ("Module", str), ("Symbol", str)], self._generator()) - - @classproperty - def version(cls): - return (1, 0, 0) diff --git a/volatility/framework/plugins/windows/vadyarascan.py b/volatility/framework/plugins/windows/vadyarascan.py index 676acd8ad..ea72ee1a1 100644 --- a/volatility/framework/plugins/windows/vadyarascan.py +++ b/volatility/framework/plugins/windows/vadyarascan.py @@ -21,7 +21,6 @@ import logging from typing import Iterable, List, Tuple -from volatility import classproperty from volatility.framework import interfaces, renderers from volatility.framework.configuration import requirements from volatility.framework.layers import resources @@ -38,10 +37,7 @@ except ImportError: class VadYaraScan(interfaces.plugins.PluginInterface): - - @classproperty - def version(cls): - return (1, 0, 0) + _version = (1, 0, 0) @classmethod def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]: