dissect.target 3.20.2.dev18__py3-none-any.whl → 3.20.2.dev19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dissect/target/plugins/os/windows/regf/cam.py +118 -0
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/METADATA +1 -1
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/RECORD +8 -7
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/COPYRIGHT +0 -0
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/LICENSE +0 -0
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/WHEEL +0 -0
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/entry_points.txt +0 -0
- {dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,118 @@
|
|
1
|
+
from typing import Iterator
|
2
|
+
|
3
|
+
from dissect.util.ts import wintimestamp
|
4
|
+
from flow.record.fieldtypes import windows_path
|
5
|
+
|
6
|
+
from dissect.target.exceptions import UnsupportedPluginError
|
7
|
+
from dissect.target.helpers.descriptor_extensions import (
|
8
|
+
RegistryRecordDescriptorExtension,
|
9
|
+
UserRecordDescriptorExtension,
|
10
|
+
)
|
11
|
+
from dissect.target.helpers.record import create_extended_descriptor
|
12
|
+
from dissect.target.helpers.regutil import RegistryKey, RegistryValueNotFoundError
|
13
|
+
from dissect.target.plugin import Plugin, export
|
14
|
+
from dissect.target.target import Target
|
15
|
+
|
16
|
+
CamRecord = create_extended_descriptor([RegistryRecordDescriptorExtension, UserRecordDescriptorExtension])(
|
17
|
+
"windows/registry/cam",
|
18
|
+
[
|
19
|
+
("datetime", "ts"),
|
20
|
+
("string", "device"),
|
21
|
+
("string", "app_name"),
|
22
|
+
("path", "path"),
|
23
|
+
("datetime", "last_started"),
|
24
|
+
("datetime", "last_stopped"),
|
25
|
+
("varint", "duration"),
|
26
|
+
],
|
27
|
+
)
|
28
|
+
|
29
|
+
|
30
|
+
class CamPlugin(Plugin):
|
31
|
+
"""Plugin that iterates various Capability Access Manager registry key locations."""
|
32
|
+
|
33
|
+
CONSENT_STORES = [
|
34
|
+
"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore",
|
35
|
+
"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore",
|
36
|
+
]
|
37
|
+
|
38
|
+
def __init__(self, target: Target):
|
39
|
+
super().__init__(target)
|
40
|
+
self.app_regf_keys = self._find_apps()
|
41
|
+
|
42
|
+
def _find_apps(self) -> list[RegistryKey]:
|
43
|
+
apps = []
|
44
|
+
for store in self.target.registry.keys(self.CONSENT_STORES):
|
45
|
+
for key in store.subkeys():
|
46
|
+
apps.append(key)
|
47
|
+
|
48
|
+
return apps
|
49
|
+
|
50
|
+
def check_compatible(self) -> None:
|
51
|
+
if not self.app_regf_keys:
|
52
|
+
raise UnsupportedPluginError("No Capability Access Manager keys found")
|
53
|
+
|
54
|
+
def yield_apps(self) -> Iterator[RegistryKey]:
|
55
|
+
for app in self.app_regf_keys:
|
56
|
+
for key in app.subkeys():
|
57
|
+
if key.name == "NonPackaged": # NonPackaged registry key has more apps, so yield those apps
|
58
|
+
yield from key.subkeys()
|
59
|
+
else:
|
60
|
+
yield key
|
61
|
+
|
62
|
+
@export(record=CamRecord)
|
63
|
+
def cam(self) -> Iterator[CamRecord]:
|
64
|
+
"""Iterate Capability Access Manager key locations.
|
65
|
+
|
66
|
+
The Capability Access Manager keeps track of processes that access I/O devices, like the webcam or microphone.
|
67
|
+
Applications are divided into packaged and non-packaged applications meaning Microsoft or
|
68
|
+
non-Microsoft applications.
|
69
|
+
|
70
|
+
References:
|
71
|
+
- https://docs.velociraptor.app/exchange/artifacts/pages/windows.registry.capabilityaccessmanager/
|
72
|
+
- https://svch0st.medium.com/can-you-track-processes-accessing-the-camera-and-microphone-7e6885b37072
|
73
|
+
|
74
|
+
Yields ``CamRecord`` with the following fields:
|
75
|
+
|
76
|
+
.. code-block:: text
|
77
|
+
|
78
|
+
hostname (string): The target hostname.
|
79
|
+
domain (string): The target domain.
|
80
|
+
ts (datetime): The modification timestamp of the registry key.
|
81
|
+
device (string): Name of the device privacy permission where asked for.
|
82
|
+
app_name (string): The name of the application.
|
83
|
+
path (path): The possible path to the application.
|
84
|
+
last_started (datetime): When the application last started using the device.
|
85
|
+
last_stopped (datetime): When the application last stopped using the device.
|
86
|
+
duration (datetime): How long the application used the device (seconds).
|
87
|
+
"""
|
88
|
+
|
89
|
+
for key in self.yield_apps():
|
90
|
+
last_started = None
|
91
|
+
last_stopped = None
|
92
|
+
duration = None
|
93
|
+
|
94
|
+
try:
|
95
|
+
last_started = wintimestamp(key.value("LastUsedTimeStart").value)
|
96
|
+
except RegistryValueNotFoundError:
|
97
|
+
self.target.log.warning("No LastUsedTimeStart for application: %s", key.name)
|
98
|
+
|
99
|
+
try:
|
100
|
+
last_stopped = wintimestamp(key.value("LastUsedTimeStop").value)
|
101
|
+
except RegistryValueNotFoundError:
|
102
|
+
self.target.log.warning("No LastUsedTimeStop for application: %s", key.name)
|
103
|
+
|
104
|
+
if last_started and last_stopped:
|
105
|
+
duration = (last_stopped - last_started).seconds
|
106
|
+
|
107
|
+
yield CamRecord(
|
108
|
+
ts=key.ts,
|
109
|
+
device=key.path.split("\\")[-2],
|
110
|
+
app_name=key.name,
|
111
|
+
path=windows_path(key.name.replace("#", "\\")) if "#" in key.name else None,
|
112
|
+
last_started=last_started,
|
113
|
+
last_stopped=last_stopped,
|
114
|
+
duration=duration,
|
115
|
+
_target=self.target,
|
116
|
+
_key=key,
|
117
|
+
_user=self.target.registry.get_user(key),
|
118
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: dissect.target
|
3
|
-
Version: 3.20.2.
|
3
|
+
Version: 3.20.2.dev19
|
4
4
|
Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
6
6
|
License: Affero General Public License v3
|
@@ -339,6 +339,7 @@ dissect/target/plugins/os/windows/regf/applications.py,sha256=AZwaLXsVmqMjoZYI3d
|
|
339
339
|
dissect/target/plugins/os/windows/regf/appxdebugkeys.py,sha256=X8MYLcD76pIZoIWwS_DgUp6q6pi2WO7jhZeoc4uGLak,3966
|
340
340
|
dissect/target/plugins/os/windows/regf/auditpol.py,sha256=vTqWw0_vu9p_emWC8FuYcYQpOXhEFQQDLV0K6-18i9c,5208
|
341
341
|
dissect/target/plugins/os/windows/regf/bam.py,sha256=jJ0i-82uteBU0hPgs81f8NV8NCeRtIklK82Me2S_ro0,2131
|
342
|
+
dissect/target/plugins/os/windows/regf/cam.py,sha256=e0y4mhWBfgMIRvOxybLFGZ3ztH3tyqvv5wY5uVEDatI,4717
|
342
343
|
dissect/target/plugins/os/windows/regf/cit.py,sha256=WYuwzTJKSR8Ki0582zpTpRUApx_J3OIYFWivKgqH-Is,39178
|
343
344
|
dissect/target/plugins/os/windows/regf/clsid.py,sha256=ellokL8H7TR8XkGqqWraJ3bL0qP5RJrjNsp4JeBLU7A,3810
|
344
345
|
dissect/target/plugins/os/windows/regf/firewall.py,sha256=86JvlBc418nHB5l3IkbEnTw6zr-H5pEGEoZ8fBhmeLE,3231
|
@@ -383,10 +384,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
|
|
383
384
|
dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
|
384
385
|
dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
|
385
386
|
dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
|
386
|
-
dissect.target-3.20.2.
|
387
|
-
dissect.target-3.20.2.
|
388
|
-
dissect.target-3.20.2.
|
389
|
-
dissect.target-3.20.2.
|
390
|
-
dissect.target-3.20.2.
|
391
|
-
dissect.target-3.20.2.
|
392
|
-
dissect.target-3.20.2.
|
387
|
+
dissect.target-3.20.2.dev19.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
|
388
|
+
dissect.target-3.20.2.dev19.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
389
|
+
dissect.target-3.20.2.dev19.dist-info/METADATA,sha256=-4siqHElFX4TAmQ403qAyFwVMdhU1UPquE_a68cW0LU,13184
|
390
|
+
dissect.target-3.20.2.dev19.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
391
|
+
dissect.target-3.20.2.dev19.dist-info/entry_points.txt,sha256=yQwLCWUuzHgS6-sfCcRk66gAfoCfqXdCjqKjvhnQW8o,537
|
392
|
+
dissect.target-3.20.2.dev19.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
|
393
|
+
dissect.target-3.20.2.dev19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
{dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/entry_points.txt
RENAMED
File without changes
|
{dissect.target-3.20.2.dev18.dist-info → dissect.target-3.20.2.dev19.dist-info}/top_level.txt
RENAMED
File without changes
|