Skip to content

Commit f537c4a

Browse files
committed
Merge branch 'develop' into linux_hidden_modules
2 parents 8960bda + a196140 commit f537c4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+10922
-533
lines changed

.github/workflows/black.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ jobs:
1111
with:
1212
options: "--check --diff --verbose"
1313
src: "./volatility3"
14+
# FIXME: Remove when Volatility3 minimum Python version is >3.8
15+
version: "24.8.0"

.style.yapf

Lines changed: 0 additions & 261 deletions
This file was deleted.

doc/source/getting-started-linux-tutorial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Volatility3 does not provide the ability to acquire memory. Below are some exam
1111
* `AVML - Acquire Volatile Memory for Linux <https://github.com/microsoft/avml>`_
1212
* `LiME - Linux Memory Extract <https://github.com/504ensicsLabs/LiME>`_
1313

14+
Be aware that LiME raw format is not supported by volatility3, the padded or lime option should be used instead. `This issue contains further information <https://github.com/504ensicsLabs/LiME/issues/111>`_.
1415

1516
Procedure to create symbol tables for linux
1617
--------------------------------------------

test/test_volatility.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,17 @@ def test_linux_tty_check(image, volatility, python):
341341
assert out.count(b"\n") >= 5
342342
assert rc == 0
343343

344+
def test_linux_sockstat(image, volatility, python):
345+
rc, out, err = runvol_plugin("linux.sockstat.Sockstat", image, volatility, python)
346+
347+
assert out.count(b"AF_UNIX") >= 354
348+
assert out.count(b"AF_BLUETOOTH") >= 5
349+
assert out.count(b"AF_INET") >= 32
350+
assert out.count(b"AF_INET6") >= 20
351+
assert out.count(b"AF_PACKET") >= 1
352+
assert out.count(b"AF_NETLINK") >= 43
353+
assert rc == 0
354+
344355

345356
def test_linux_library_list(image, volatility, python):
346357
rc, out, err = runvol_plugin(

volatility3/cli/__init__.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,35 @@ def run(self):
235235
default=constants.CACHE_PATH,
236236
type=str,
237237
)
238-
parser.add_argument(
238+
isf_group = parser.add_mutually_exclusive_group()
239+
isf_group.add_argument(
239240
"--offline",
240241
help="Do not search online for additional JSON files",
241242
default=False,
242243
action="store_true",
243244
)
245+
isf_group.add_argument(
246+
"-u",
247+
"--remote-isf-url",
248+
metavar="URL",
249+
help="Search online for ISF json files",
250+
default=constants.REMOTE_ISF_URL,
251+
type=str,
252+
)
244253
parser.add_argument(
245254
"--filters",
246255
help="List of filters to apply to the output (in the form of [+-]columname,pattern[!])",
247256
default=[],
248257
action="append",
249258
)
259+
parser.add_argument(
260+
"--hide-columns",
261+
help="Case-insensitive space separated list of prefixes to determine which columns to hide in the output if provided",
262+
default=None,
263+
action="extend",
264+
nargs="*",
265+
type=str,
266+
)
250267

251268
parser.set_defaults(**default_config)
252269

@@ -313,6 +330,8 @@ def run(self):
313330

314331
if partial_args.offline:
315332
constants.OFFLINE = partial_args.offline
333+
elif partial_args.remote_isf_url:
334+
constants.REMOTE_ISF_URL = partial_args.remote_isf_url
316335

317336
# Do the initialization
318337
ctx = contexts.Context() # Construct a blank context
@@ -477,6 +496,7 @@ def run(self):
477496
grid = constructed.run()
478497
renderer = renderers[args.renderer]()
479498
renderer.filter = text_filter.CLIFilter(grid, args.filters)
499+
renderer.column_hide_list = args.hide_columns
480500
renderer.render(grid)
481501
except exceptions.VolatilityException as excp:
482502
self.process_exceptions(excp)
@@ -604,6 +624,10 @@ def process_exceptions(self, excp):
604624
caused_by = [
605625
"A required python module is not installed (install the module and re-run)"
606626
]
627+
elif isinstance(excp, exceptions.RenderException):
628+
general = "Volatility experienced an issue when rendering the output:"
629+
detail = f"{excp}"
630+
caused_by = ["An invalid renderer option, such as no visible columns"]
607631
else:
608632
general = "Volatility encountered an unexpected situation."
609633
detail = ""

volatility3/cli/text_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def filter(
5353
"""Filters the row based on each of the column_filters"""
5454
if not self._filters:
5555
return False
56-
found = any([column_filter.found(row) for column_filter in self._filters])
56+
found = any(column_filter.found(row) for column_filter in self._filters)
5757
return not found
5858

5959

@@ -86,7 +86,7 @@ def found(self, row: List[Any]) -> bool:
8686
otherwise it is filtered.
8787
"""
8888
if self.column_num is None:
89-
found = any([self.find(x) for x in row])
89+
found = any(self.find(x) for x in row)
9090
else:
9191
found = self.find(row[self.column_num])
9292
if self.exclude:

0 commit comments

Comments
 (0)