Skip to content

Commit cbc745d

Browse files
authored
Merge pull request #936 from volatilityfoundation/release/v2.4.1
Release v2.4.1 ``` New plugins: linux.sockstat linux.iomem linux.psscan linux.envars windows.drivermodule windows.vadwalk Pid filtering for Windows pstree plugin Minor fixes for Windows callbacks plugin Minimum python version was increased to 3.7 Python-snappy dependency was replaced with ctypes to ease installation Whole codebase was reformatted with black Faster release cycle (targetting every 4 months) ```
2 parents d67ad9f + 1b5a6b6 commit cbc745d

Some content is hidden

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

101 files changed

+1835
-243
lines changed

.github/workflows/black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
lint:
77
runs-on: ubuntu-20.04
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- uses: psf/black@stable
1111
with:
1212
options: "--check --diff --verbose"

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "develop" ]
20-
schedule:
21-
- cron: '16 8 * * 0'
20+
# schedule:
21+
# - cron: '16 8 * * 0'
2222

2323
jobs:
2424
analyze:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The latest generated copy of the documentation can be found at: <https://volatil
107107

108108
## Licensing and Copyright
109109

110-
Copyright (C) 2007-2022 Volatility Foundation
110+
Copyright (C) 2007-2023 Volatility Foundation
111111

112112
All Rights Reserved
113113

doc/source/simple-plugin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ The plugin then takes the process's ``BaseDllName`` value, and calls :py:meth:`~
259259
as defined by the symbols, are directly accessible and use the case-style of the symbol library it came from (in Windows,
260260
attributes are CamelCase), such as ``entry.BaseDllName`` in this instance. Any attributes not defined by the symbol but added
261261
by Volatility extensions cannot be properties (in case they overlap with the attributes defined in the symbol libraries)
262-
and are therefore always methods and pretended with ``get_``, in this example ``BaseDllName.get_string()``.
262+
and are therefore always methods and prepended with ``get_``, in this example ``BaseDllName.get_string()``.
263263

264264
Finally, ``FullDllName`` is populated. These operations read from memory, and as such, the memory image may be unable to
265265
read the data at a particular offset. This will cause an exception to be thrown. In Volatility 3, exceptions are thrown

requirements-dev.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ jsonschema>=2.3.0
2020

2121
# This is required for memory acquisition via leechcore/pcileech.
2222
leechcorepyc>=2.4.0
23-
24-
# This is required for analyzing Linux samples compressed using AVMLs native
25-
# compression format. It is not required for AVML's standard LiME compression.
26-
python-snappy==0.6.0

requirements.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ pycryptodome
1616

1717
# This is required for memory acquisition via leechcore/pcileech.
1818
leechcorepyc>=2.4.0
19-
20-
# This is required for analyzing Linux samples compressed using AVMLs native
21-
# compression format. It is not required for AVML's standard LiME compression.
22-
python-snappy==0.6.0

volatility3/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def run(self):
443443
# Construct and run the plugin
444444
if constructed:
445445
renderers[args.renderer]().render(constructed.run())
446-
except (exceptions.VolatilityException) as excp:
446+
except exceptions.VolatilityException as excp:
447447
self.process_exceptions(excp)
448448

449449
@classmethod

volatility3/cli/text_renderer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ def render(self, grid: interfaces.renderers.TreeGrid) -> None:
241241
# Ignore the type because namedtuples don't realize they have accessible attributes
242242
header_list.append(f"{column.name}")
243243

244-
writer = csv.DictWriter(outfd, header_list, lineterminator="\n")
244+
writer = csv.DictWriter(
245+
outfd, header_list, lineterminator="\n", escapechar="\\"
246+
)
245247
writer.writeheader()
246248

247249
def visitor(node: interfaces.renderers.TreeNode, accumulator):
@@ -346,7 +348,7 @@ def visitor(
346348

347349
column_titles = [""] + [column.name for column in grid.columns]
348350
outfd.write(format_string.format(*column_titles))
349-
for (depth, line) in final_output:
351+
for depth, line in final_output:
350352
nums_line = max([len(line[column]) for column in line])
351353
for column in line:
352354
line[column] = line[column] + ([""] * (nums_line - len(line[column])))

volatility3/cli/volargparse.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def __call__(
3131
values: Union[str, Sequence[Any], None],
3232
option_string: Optional[str] = None,
3333
) -> None:
34-
3534
parser_name = ""
3635
arg_strings = [] # type: List[str]
3736
if values is not None:

volatility3/framework/automagic/construct_layers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def __call__(
3636
progress_callback=None,
3737
optional=False,
3838
) -> List[str]:
39-
4039
# Make sure we import the layers, so they can reconstructed
4140
framework.import_files(sys.modules["volatility3.framework.layers"])
4241

volatility3/framework/automagic/mac.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def _scan_generator(cls, context, layer_name, progress_callback):
251251
context=context,
252252
progress_callback=progress_callback,
253253
):
254-
255254
banner = context.layers[layer_name].read(offset, 128)
256255

257256
idx = banner.find(b"\x00")

volatility3/framework/automagic/symbol_cache.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def get_location_statistics(
161161
"""Returns ISF statistics based on the location
162162
163163
Returns:
164-
A tuple of base_types, types, enums, symbols, or None is location not found"""
164+
A tuple of base_types, types, enums, symbols, or None is location not found
165+
"""
165166

166167
def get_hash(self, location: str) -> Optional[str]:
167168
"""Returns the hash of the JSON from within a location ISF"""
@@ -331,7 +332,7 @@ def update(self, progress_callback=None):
331332
if inner_url.scheme == "file":
332333
pathname = inner_url.path.split("!")[0]
333334

334-
if pathname:
335+
if pathname and os.path.exists(pathname):
335336
timestamp = datetime.datetime.fromtimestamp(
336337
os.stat(pathname).st_mtime
337338
)
@@ -370,7 +371,7 @@ def update(self, progress_callback=None):
370371

371372
# Get stats
372373
stats_base_types = len(json_obj.get("base_types", {}))
373-
stats_types = len(json_obj.get("types", {}))
374+
stats_types = len(json_obj.get("user_types", {}))
374375
stats_enums = len(json_obj.get("enums", {}))
375376
stats_symbols = len(json_obj.get("symbols", {}))
376377

volatility3/framework/automagic/symbol_finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ def __call__(
8282
shortcut=False,
8383
)
8484

85-
for (sub_path, requirement) in self._requirements:
85+
for sub_path, requirement in self._requirements:
8686
parent_path = interfaces.configuration.parent_path(sub_path)
8787

8888
if isinstance(
8989
requirement, requirements.SymbolTableRequirement
9090
) and requirement.unsatisfied(context, parent_path):
91-
for (tl_sub_path, tl_requirement) in self._requirements:
91+
for tl_sub_path, tl_requirement in self._requirements:
9292
tl_parent_path = interfaces.configuration.parent_path(tl_sub_path)
9393
# Find the TranslationLayer sibling to the SymbolTableRequirement
9494
if (

volatility3/framework/constants/linux/__init__.py

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,223 @@
1414

1515
# include/linux/sched.h
1616
PF_KTHREAD = 0x00200000 # I'm a kernel thread
17+
18+
# Standard well-defined IP protocols.
19+
# ref: include/uapi/linux/in.h
20+
IP_PROTOCOLS = {
21+
0: "IP",
22+
1: "ICMP",
23+
2: "IGMP",
24+
4: "IPIP",
25+
6: "TCP",
26+
8: "EGP",
27+
12: "PUP",
28+
17: "UDP",
29+
22: "IDP",
30+
29: "TP",
31+
33: "DCCP",
32+
41: "IPV6",
33+
46: "RSVP",
34+
47: "GRE",
35+
50: "ESP",
36+
51: "AH",
37+
92: "MTP",
38+
94: "BEETPH",
39+
98: "ENCAP",
40+
103: "PIM",
41+
108: "COMP",
42+
132: "SCTP",
43+
136: "UDPLITE",
44+
137: "MPLS",
45+
143: "ETHERNET",
46+
255: "RAW",
47+
262: "MPTCP",
48+
}
49+
50+
# IPV6 extension headers
51+
# ref: include/uapi/linux/in6.h
52+
IPV6_PROTOCOLS = {
53+
0: "HOPBYHOP_OPTS",
54+
43: "ROUTING",
55+
44: "FRAGMENT",
56+
58: "ICMPv6",
57+
59: "NO_NEXT",
58+
60: "DESTINATION_OPTS",
59+
135: "MOBILITY",
60+
}
61+
62+
# ref: include/net/tcp_states.h
63+
TCP_STATES = (
64+
"",
65+
"ESTABLISHED",
66+
"SYN_SENT",
67+
"SYN_RECV",
68+
"FIN_WAIT1",
69+
"FIN_WAIT2",
70+
"TIME_WAIT",
71+
"CLOSE",
72+
"CLOSE_WAIT",
73+
"LAST_ACK",
74+
"LISTEN",
75+
"CLOSING",
76+
"TCP_NEW_SYN_RECV",
77+
)
78+
79+
# ref: include/linux/net.h (socket_type enum)
80+
SOCK_TYPES = {
81+
1: "STREAM",
82+
2: "DGRAM",
83+
3: "RAW",
84+
4: "RDM",
85+
5: "SEQPACKET",
86+
6: "DCCP",
87+
10: "PACKET",
88+
}
89+
90+
# Address families
91+
# ref: include/linux/socket.h
92+
SOCK_FAMILY = (
93+
"AF_UNSPEC",
94+
"AF_UNIX",
95+
"AF_INET",
96+
"AF_AX25",
97+
"AF_IPX",
98+
"AF_APPLETALK",
99+
"AF_NETROM",
100+
"AF_BRIDGE",
101+
"AF_ATMPVC",
102+
"AF_X25",
103+
"AF_INET6",
104+
"AF_ROSE",
105+
"AF_DECnet",
106+
"AF_NETBEUI",
107+
"AF_SECURITY",
108+
"AF_KEY",
109+
"AF_NETLINK",
110+
"AF_PACKET",
111+
"AF_ASH",
112+
"AF_ECONET",
113+
"AF_ATMSVC",
114+
"AF_RDS",
115+
"AF_SNA",
116+
"AF_IRDA",
117+
"AF_PPPOX",
118+
"AF_WANPIPE",
119+
"AF_LLC",
120+
"AF_IB",
121+
"AF_MPLS",
122+
"AF_CAN",
123+
"AF_TIPC",
124+
"AF_BLUETOOTH",
125+
"AF_IUCV",
126+
"AF_RXRPC",
127+
"AF_ISDN",
128+
"AF_PHONET",
129+
"AF_IEEE802154",
130+
"AF_CAIF",
131+
"AF_ALG",
132+
"AF_NFC",
133+
"AF_VSOCK",
134+
"AF_KCM",
135+
"AF_QIPCRTR",
136+
"AF_SMC",
137+
"AF_XDP",
138+
)
139+
140+
# Socket states
141+
# ref: include/uapi/linux/net.h
142+
SOCKET_STATES = ("FREE", "UNCONNECTED", "CONNECTING", "CONNECTED", "DISCONNECTING")
143+
144+
# Netlink protocols
145+
# ref: include/uapi/linux/netlink.h
146+
NETLINK_PROTOCOLS = (
147+
"NETLINK_ROUTE",
148+
"NETLINK_UNUSED",
149+
"NETLINK_USERSOCK",
150+
"NETLINK_FIREWALL",
151+
"NETLINK_SOCK_DIAG",
152+
"NETLINK_NFLOG",
153+
"NETLINK_XFRM",
154+
"NETLINK_SELINUX",
155+
"NETLINK_ISCSI",
156+
"NETLINK_AUDIT",
157+
"NETLINK_FIB_LOOKUP",
158+
"NETLINK_CONNECTOR",
159+
"NETLINK_NETFILTER",
160+
"NETLINK_IP6_FW",
161+
"NETLINK_DNRTMSG",
162+
"NETLINK_KOBJECT_UEVENT",
163+
"NETLINK_GENERIC",
164+
"NETLINK_DM",
165+
"NETLINK_SCSITRANSPORT",
166+
"NETLINK_ECRYPTFS",
167+
"NETLINK_RDMA",
168+
"NETLINK_CRYPTO",
169+
"NETLINK_SMC",
170+
)
171+
172+
# Short list of Ethernet Protocol ID's.
173+
# ref: include/uapi/linux/if_ether.h
174+
# Used in AF_PACKET socket family
175+
ETH_PROTOCOLS = {
176+
0x0001: "ETH_P_802_3",
177+
0x0002: "ETH_P_AX25",
178+
0x0003: "ETH_P_ALL",
179+
0x0004: "ETH_P_802_2",
180+
0x0005: "ETH_P_SNAP",
181+
0x0006: "ETH_P_DDCMP",
182+
0x0007: "ETH_P_WAN_PPP",
183+
0x0008: "ETH_P_PPP_MP",
184+
0x0009: "ETH_P_LOCALTALK",
185+
0x000C: "ETH_P_CAN",
186+
0x000F: "ETH_P_CANFD",
187+
0x0010: "ETH_P_PPPTALK",
188+
0x0011: "ETH_P_TR_802_2",
189+
0x0016: "ETH_P_CONTROL",
190+
0x0017: "ETH_P_IRDA",
191+
0x0018: "ETH_P_ECONET",
192+
0x0019: "ETH_P_HDLC",
193+
0x001A: "ETH_P_ARCNET",
194+
0x001B: "ETH_P_DSA",
195+
0x001C: "ETH_P_TRAILER",
196+
0x0060: "ETH_P_LOOP",
197+
0x00F6: "ETH_P_IEEE802154",
198+
0x00F7: "ETH_P_CAIF",
199+
0x00F8: "ETH_P_XDSA",
200+
0x00F9: "ETH_P_MAP",
201+
0x0800: "ETH_P_IP",
202+
0x0805: "ETH_P_X25",
203+
0x0806: "ETH_P_ARP",
204+
0x8035: "ETH_P_RARP",
205+
0x809B: "ETH_P_ATALK",
206+
0x80F3: "ETH_P_AARP",
207+
0x8100: "ETH_P_8021Q",
208+
}
209+
210+
# Connection and socket states
211+
# ref: include/net/bluetooth/bluetooth.h
212+
BLUETOOTH_STATES = (
213+
"",
214+
"CONNECTED",
215+
"OPEN",
216+
"BOUND",
217+
"LISTEN",
218+
"CONNECT",
219+
"CONNECT2",
220+
"CONFIG",
221+
"DISCONN",
222+
"CLOSED",
223+
)
224+
225+
# Bluetooth protocols
226+
# ref: include/net/bluetooth/bluetooth.h
227+
BLUETOOTH_PROTOCOLS = (
228+
"L2CAP",
229+
"HCI",
230+
"SCO",
231+
"RFCOMM",
232+
"BNEP",
233+
"CMTP",
234+
"HIDP",
235+
"AVDTP",
236+
)

0 commit comments

Comments
 (0)