Skip to content

Commit 923ea92

Browse files
authored
Merge pull request #1772 from volatilityfoundation/fix_symlink_scanning
Poolscanners: Fix symlink pool types
2 parents 8dae65e + 2199375 commit 923ea92

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

test/plugins/windows/windows.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,51 @@ def test_windows_generic_kpcrs(self, volatility, python, image):
746746
assert test_volatility.count_entries_flat(json.loads(out)) > 0
747747

748748

749+
class TestWindowsSymlinkScan:
750+
def test_windows_generic_symlinkscan(self, volatility, python, image):
751+
rc, out, _err = test_volatility.runvol_plugin(
752+
"windows.symlinkscan.SymlinkScan",
753+
image,
754+
volatility,
755+
python,
756+
globalargs=("-r", "json"),
757+
)
758+
assert rc == 0
759+
assert test_volatility.count_entries_flat(json.loads(out)) > 0
760+
761+
def test_windows_specific_symlinkscan(self, volatility, python):
762+
image = WindowsSamples.WINDOWSXP_GENERIC.value.path
763+
rc, out, _err = test_volatility.runvol_plugin(
764+
"windows.symlinkscan.SymlinkScan",
765+
image,
766+
volatility,
767+
python,
768+
globalargs=("-r", "json"),
769+
)
770+
assert rc == 0
771+
json_out = json.loads(out)
772+
assert test_volatility.count_entries_flat(json_out) > 5
773+
expected_rows = [
774+
{
775+
"CreateTime": "2005-06-25T16:47:28+00:00",
776+
"From Name": "AUX",
777+
"Offset": 453082584,
778+
"To Name": "\\DosDevices\\COM1",
779+
"__children": []
780+
},
781+
{
782+
"CreateTime": "2005-06-25T16:47:28+00:00",
783+
"From Name": "UNC",
784+
"Offset": 453176664,
785+
"To Name": "\\Device\\Mup",
786+
"__children": []
787+
}
788+
]
789+
790+
for expected_row in expected_rows:
791+
assert test_volatility.match_output_row(expected_row, json_out)
792+
793+
749794
class TestWindowsLdrModules:
750795
def test_windows_specific_ldrmodules(self, volatility, python):
751796
image = WindowsSamples.WINDOWSXP_GENERIC.value.path

volatility3/framework/plugins/windows/poolscanner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class PoolScanner(plugins.PluginInterface):
131131
"""A generic pool scanner plugin."""
132132

133133
_required_framework_version = (2, 0, 0)
134-
_version = (3, 0, 0)
134+
_version = (3, 0, 1)
135135

136136
@classmethod
137137
def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:
@@ -343,15 +343,15 @@ def builtin_constraints(
343343
type_name=symbol_table + constants.BANG + "_OBJECT_SYMBOLIC_LINK",
344344
object_type="SymbolicLink",
345345
size=(72, None),
346-
page_type=PoolType.NONPAGED | PoolType.FREE,
346+
page_type=PoolType.PAGED | PoolType.FREE,
347347
),
348348
# symlinks on windows starting with windows 8
349349
PoolConstraint(
350350
b"Symb",
351351
type_name=symbol_table + constants.BANG + "_OBJECT_SYMBOLIC_LINK",
352352
object_type="SymbolicLink",
353353
size=(72, None),
354-
page_type=PoolType.NONPAGED | PoolType.FREE,
354+
page_type=PoolType.PAGED | PoolType.FREE,
355355
),
356356
# registry hives
357357
PoolConstraint(

0 commit comments

Comments
 (0)