Skip to content

Commit

Permalink
Merge pull request #1050 from eve-mem/windows_vadyarascan_issue_1047
Browse files Browse the repository at this point in the history
Windows: update vadyarascan to use generic yarascan requirements
  • Loading branch information
ikelos authored Dec 5, 2023
2 parents 8262737 + c610497 commit a08b780
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions volatility3/framework/plugins/windows/vadyarascan.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,26 @@ class VadYaraScan(interfaces.plugins.PluginInterface):
"""Scans all the Virtual Address Descriptor memory maps using yara."""

_required_framework_version = (2, 4, 0)
_version = (1, 0, 0)
_version = (1, 0, 1)

@classmethod
def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:
return [
# create a list of requirements for vadyarascan
vadyarascan_requirements = [
requirements.ModuleRequirement(
name="kernel",
description="Windows kernel",
architectures=["Intel32", "Intel64"],
),
requirements.BooleanRequirement(
name="wide",
description="Match wide (unicode) strings",
default=False,
optional=True,
),
requirements.StringRequirement(
name="yara_rules", description="Yara rules (as a string)", optional=True
),
requirements.URIRequirement(
name="yara_file", description="Yara rules (as a file)", optional=True
),
# This additional requirement is to follow suit with upstream, who feel that compiled rules could potentially be used to execute malicious code
# As such, there's a separate option to run compiled files, as happened with yara-3.9 and later
requirements.URIRequirement(
name="yara_compiled_file",
description="Yara compiled rules (as a file)",
optional=True,
),
requirements.IntRequirement(
name="max_size",
default=0x40000000,
description="Set the maximum size (default is 1GB)",
optional=True,
),
requirements.PluginRequirement(
name="pslist", plugin=pslist.PsList, version=(2, 0, 0)
),
requirements.VersionRequirement(
name="yarascanner", component=yarascan.YaraScanner, version=(2, 0, 0)
),
requirements.PluginRequirement(
name="yarascan", plugin=yarascan.YaraScan, version=(1, 2, 0)
),
requirements.ListRequirement(
name="pid",
element_type=int,
Expand All @@ -67,6 +46,12 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
),
]

# get base yarascan requirements for command line options
yarascan_requirements = yarascan.YaraScan.get_yarascan_option_requirements()

# return the combined requirements
return yarascan_requirements + vadyarascan_requirements

def _generator(self):
kernel = self.context.modules[self.config["kernel"]]

Expand Down

0 comments on commit a08b780

Please sign in to comment.