Skip to content

Commit b788733

Browse files
committed
More comments on unhooked system calls
1 parent 79b8ff7 commit b788733

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

volatility3/framework/plugins/windows/debugregisters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# This file is Copyright 2024 Volatility Foundation and licensed under the Volatility Software License 1.0
22
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
33

4+
# Full details on the techniques used in these plugins to detect EDR-evading malware
5+
# can be found in our 20 page whitepaper submitted to DEFCON along with the presentation
6+
# https://www.volexity.com/wp-content/uploads/2024/08/Defcon24_EDR_Evasion_Detection_White-Paper_Andrew-Case.pdf
7+
48
import logging
59

610
from typing import Tuple, Optional, Generator, List, Dict

volatility3/framework/plugins/windows/unhooked_system_calls.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# This file is Copyright 2024 Volatility Foundation and licensed under the Volatility Software License 1.0
22
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
33

4+
# Full details on the techniques used in these plugins to detect EDR-evading malware
5+
# can be found in our 20 page whitepaper submitted to DEFCON along with the presentation
6+
# https://www.volexity.com/wp-content/uploads/2024/08/Defcon24_EDR_Evasion_Detection_White-Paper_Andrew-Case.pdf
7+
48
import logging
59

610
from typing import Dict, Tuple, List, Generator
@@ -162,20 +166,30 @@ def _generator(self) -> Generator[Tuple[int, Tuple[str, str, int]], None, None]:
162166
# code_bytes[dll_name][func_name][func_bytes]
163167
code_bytes = self._gather_code_bytes(kernel, found_symbols)
164168

169+
# walk the functions that were evaluated
165170
for functions in code_bytes.values():
171+
# cbb is the distinct groups of bytes (instructions)
172+
# for this function across processes
166173
for func_name, cbb in functions.items():
174+
# the dict key here is the raw instructions, which is not helpful to look at
175+
# the values are the list of tuples for the (proc_id, proc_name) pairs for this set of bytes (instructions)
167176
cb = list(cbb.values())
168177

169-
# same implementation in all
178+
# if all processes map to the same implementation, then no malware is present
170179
if len(cb) == 1:
171180
yield 0, (func_name, "", len(cb[0]))
172181
else:
173-
# find the processes that are hooked for reporting
182+
# if there are differing implementations then it means
183+
# that malware has overwritten system call(s) in infected processes
184+
# max_idx and small_idx find which implementation of a system call has the least processes
185+
# as all observed malware and open source projects only infected a few targets, leaving the
186+
# rest with the original EDR hooks in place
174187
max_idx = 0 if len(cb[0]) > len(cb[1]) else 1
175188
small_idx = (~max_idx) & 1
176189

177190
ps = []
178191

192+
# gather processes on small_idx since these are the malware infected ones
179193
for pid, pname in cb[small_idx]:
180194
ps.append("{:d}:{}".format(pid, pname))
181195

0 commit comments

Comments
 (0)