dissect.target 3.20.dev51__py3-none-any.whl → 3.20.dev53__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.
@@ -76,13 +76,13 @@ class JFFSFilesystemEntry(FilesystemEntry):
76
76
  entry_path = fsutil.join(self.path, name, alt_separator=self.fs.alt_separator)
77
77
  yield JFFSFilesystemEntry(self.fs, entry_path, entry)
78
78
 
79
- def is_dir(self, follow_symlinks: bool = False) -> bool:
79
+ def is_dir(self, follow_symlinks: bool = True) -> bool:
80
80
  try:
81
81
  return self._resolve(follow_symlinks).entry.is_dir()
82
82
  except FilesystemError:
83
83
  return False
84
84
 
85
- def is_file(self, follow_symlinks: bool = False) -> bool:
85
+ def is_file(self, follow_symlinks: bool = True) -> bool:
86
86
  try:
87
87
  return self._resolve(follow_symlinks).entry.is_file()
88
88
  except FilesystemError:
@@ -97,7 +97,7 @@ class JFFSFilesystemEntry(FilesystemEntry):
97
97
 
98
98
  return self.entry.link
99
99
 
100
- def stat(self, follow_symlinks: bool = False) -> fsutil.stat_result:
100
+ def stat(self, follow_symlinks: bool = True) -> fsutil.stat_result:
101
101
  return self._resolve(follow_symlinks).lstat()
102
102
 
103
103
  def lstat(self) -> fsutil.stat_result:
@@ -1,8 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import struct
3
4
  from datetime import datetime
4
5
  from typing import Iterator
5
6
 
7
+ from dissect.util.sid import read_sid
6
8
  from dissect.util.ts import from_unix
7
9
 
8
10
  from dissect.target.exceptions import RegistryError, UnsupportedPluginError
@@ -10,7 +12,10 @@ from dissect.target.helpers.descriptor_extensions import (
10
12
  RegistryRecordDescriptorExtension,
11
13
  UserRecordDescriptorExtension,
12
14
  )
13
- from dissect.target.helpers.record import create_extended_descriptor
15
+ from dissect.target.helpers.record import (
16
+ TargetRecordDescriptor,
17
+ create_extended_descriptor,
18
+ )
14
19
  from dissect.target.plugin import Plugin, export
15
20
 
16
21
  UserRegistryRecordDescriptor = create_extended_descriptor(
@@ -113,6 +118,15 @@ WinSockNamespaceProviderRecord = UserRegistryRecordDescriptor(
113
118
  ],
114
119
  )
115
120
 
121
+ ComputerSidRecord = TargetRecordDescriptor(
122
+ "windows/sid/computer",
123
+ [
124
+ ("datetime", "ts"),
125
+ ("string", "sidtype"),
126
+ ("string", "sid"),
127
+ ],
128
+ )
129
+
116
130
 
117
131
  class GenericPlugin(Plugin):
118
132
  """Generic Windows plugin.
@@ -573,3 +587,36 @@ class GenericPlugin(Plugin):
573
587
  return self.target.registry.key(key).value("ACP").value
574
588
  except RegistryError:
575
589
  pass
590
+
591
+ @export(record=ComputerSidRecord)
592
+ def sid(self) -> Iterator[ComputerSidRecord]:
593
+ """Return the machine- and optional domain SID of the system."""
594
+
595
+ try:
596
+ key = self.target.registry.key("HKLM\\SAM\\SAM\\Domains\\Account")
597
+
598
+ # The machine SID is stored in the last 12 bytes of the V value as little-endian
599
+ # The machine SID differs from a 'normal' binary SID as only holds 3 values and lacks a prefix / Revision
600
+ # NOTE: Consider moving this to dissect.util.sid if we encounter this more often
601
+ sid = struct.unpack_from("<III", key.value("V").value, -12)
602
+
603
+ yield ComputerSidRecord(
604
+ ts=key.timestamp,
605
+ sidtype="Machine",
606
+ sid=f"S-1-5-21-{sid[0]}-{sid[1]}-{sid[2]}",
607
+ _target=self.target,
608
+ )
609
+ except (RegistryError, struct.error):
610
+ pass
611
+
612
+ try:
613
+ key = self.target.registry.key("HKLM\\SECURITY\\Policy\\PolMachineAccountS")
614
+
615
+ yield ComputerSidRecord(
616
+ ts=key.timestamp,
617
+ sidtype="Domain",
618
+ sid=read_sid(key.value("(Default)").value),
619
+ _target=self.target,
620
+ )
621
+ except (RegistryError, struct.error):
622
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.20.dev51
3
+ Version: 3.20.dev53
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
@@ -33,7 +33,7 @@ dissect/target/filesystems/extfs.py,sha256=LVdB94lUI2DRHW0xUPx8lwuY-NKVeSwFGZiLO
33
33
  dissect/target/filesystems/fat.py,sha256=cCIiUAY0-5dL76Zhvji1QbwlMVX7YqKWp-NmUdqz8yA,4605
34
34
  dissect/target/filesystems/ffs.py,sha256=ry7aPb_AQeApTuhVQVioQPn4Q795_Ak5XloEtd-0bww,4950
35
35
  dissect/target/filesystems/itunes.py,sha256=w2lcWv6jlBPm84tsGZehxKBMXXyuW3KlmwVTF4ssQec,6395
36
- dissect/target/filesystems/jffs.py,sha256=v0fom9zofWNI2umEtKEikxh3kPsbz2rrLOHA3T6Pw1o,4210
36
+ dissect/target/filesystems/jffs.py,sha256=fw25gM-Cx26VuTBmbaVNP1hKw73APkZ4RhI8MGY7-cQ,4207
37
37
  dissect/target/filesystems/ntfs.py,sha256=ADSv_VkX0fir6NYaOJD1ewWo9UG84Q7AEbDwULiEoN4,7632
38
38
  dissect/target/filesystems/overlay.py,sha256=d0BNZcVd3SzBcM1SZO5nX2FrEYcdtVH34BPJQ6Oh4x8,4753
39
39
  dissect/target/filesystems/smb.py,sha256=gzPSIB6J3psFZ7RSU30llcJCt04SFSDpQTImxUUQG7Y,6400
@@ -284,7 +284,7 @@ dissect/target/plugins/os/windows/clfs.py,sha256=begVsZ-CY97Ksh6S1g03LjyBgu8ERY2
284
284
  dissect/target/plugins/os/windows/datetime.py,sha256=YKHUZU6lkKJocq15y0yCwvIIOb1Ej-kfvEBmHbrdIGw,9467
285
285
  dissect/target/plugins/os/windows/defender.py,sha256=JAJy8hr6jFGd290N1d5a-bVeD8rHc6E_pWEHxTpiMDk,32735
286
286
  dissect/target/plugins/os/windows/env.py,sha256=U5D74i_7tICxGDanqDU42Jqsx0asFFMIs6SpUwTnJc4,13884
287
- dissect/target/plugins/os/windows/generic.py,sha256=Z4eb9SrVMiO871bi5GS8V-rGF6QJ6afLarCJGa6VRcs,22703
287
+ dissect/target/plugins/os/windows/generic.py,sha256=RJ1znzsIa4CFxmdMh91SjMY_pnjwxvldlTEKo58m_e8,24262
288
288
  dissect/target/plugins/os/windows/jumplist.py,sha256=3gZk6O1B3lKK2Jxe0B-HapOCEehk94CYNvCVDpQC9nQ,11773
289
289
  dissect/target/plugins/os/windows/lnk.py,sha256=KTqhw0JMW-KjAxe4xlRDNSRSx-th-_nPVgTGyBaKmW0,7891
290
290
  dissect/target/plugins/os/windows/locale.py,sha256=QiLWGgWrGBGHiXgep5iSOo6VNim4YC-xd4MdW0BUJPA,2486
@@ -378,10 +378,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
378
378
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
379
379
  dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
380
380
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
381
- dissect.target-3.20.dev51.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
382
- dissect.target-3.20.dev51.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
383
- dissect.target-3.20.dev51.dist-info/METADATA,sha256=KbglItTMCNNZcuFn2IcpvW-aqdoPr6_SMcldbLRoSTM,12897
384
- dissect.target-3.20.dev51.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
385
- dissect.target-3.20.dev51.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
386
- dissect.target-3.20.dev51.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
387
- dissect.target-3.20.dev51.dist-info/RECORD,,
381
+ dissect.target-3.20.dev53.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
382
+ dissect.target-3.20.dev53.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
383
+ dissect.target-3.20.dev53.dist-info/METADATA,sha256=83_YSjif8SPpGDGODY4T2GwqkZoXDoxilQkzr9RsT7M,12897
384
+ dissect.target-3.20.dev53.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
385
+ dissect.target-3.20.dev53.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
386
+ dissect.target-3.20.dev53.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
387
+ dissect.target-3.20.dev53.dist-info/RECORD,,