Skip to content

Commit 17f9d21

Browse files
committed
Windows PsList: Fix list traversal logic
The traversal of `ActiveProcessLinks` from `PsActiveProcessHead` was only being done in the forward direction; if for some reason `PsActiveProcessHead` hasn't been updated to point at the 'current' list head, entries in the backwards traversal direction will be missed.
1 parent 745e148 commit 17f9d21

File tree

1 file changed

+12
-5
lines changed
  • volatility3/framework/plugins/windows

1 file changed

+12
-5
lines changed

volatility3/framework/plugins/windows/pslist.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import logging
77
from typing import Callable, Iterator, List, Optional, Type
88

9-
from volatility3.framework import renderers, interfaces, layers, exceptions, constants
9+
from volatility3.framework import constants, exceptions, interfaces, layers, renderers
1010
from volatility3.framework.configuration import requirements
1111
from volatility3.framework.objects import utility
1212
from volatility3.framework.renderers import format_hints
1313
from volatility3.framework.symbols import intermed
14-
from volatility3.framework.symbols.windows.extensions import pe
1514
from volatility3.framework.symbols.windows import extensions
15+
from volatility3.framework.symbols.windows.extensions import pe
1616
from volatility3.plugins import timeliner
1717

1818
vollog = logging.getLogger(__name__)
@@ -261,9 +261,16 @@ def list_processes(
261261
absolute=True,
262262
)
263263

264-
for proc in eproc.ActiveProcessLinks:
265-
if not filter_func(proc):
266-
yield proc
264+
seen = set()
265+
for forward in (True, False):
266+
for proc in eproc.ActiveProcessLinks.to_list(
267+
eproc.vol.type_name, "ActiveProcessLinks", forward=forward
268+
):
269+
if proc.vol.offset in seen:
270+
continue
271+
seen.add(proc.vol.offset)
272+
if not filter_func(proc):
273+
yield proc
267274

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

0 commit comments

Comments
 (0)