dissect.target 3.13.dev26__py3-none-any.whl → 3.14__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. dissect/target/container.py +9 -1
  2. dissect/target/containers/asdf.py +2 -0
  3. dissect/target/containers/ewf.py +2 -0
  4. dissect/target/containers/hdd.py +2 -0
  5. dissect/target/containers/hds.py +2 -0
  6. dissect/target/containers/qcow2.py +2 -0
  7. dissect/target/containers/raw.py +2 -0
  8. dissect/target/containers/split.py +2 -0
  9. dissect/target/containers/vdi.py +2 -0
  10. dissect/target/containers/vhd.py +2 -0
  11. dissect/target/containers/vhdx.py +2 -0
  12. dissect/target/containers/vmdk.py +2 -0
  13. dissect/target/filesystem.py +108 -15
  14. dissect/target/filesystems/ad1.py +1 -1
  15. dissect/target/filesystems/btrfs.py +180 -0
  16. dissect/target/filesystems/cb.py +4 -4
  17. dissect/target/filesystems/config.py +161 -31
  18. dissect/target/filesystems/dir.py +1 -1
  19. dissect/target/filesystems/exfat.py +1 -1
  20. dissect/target/filesystems/extfs.py +5 -1
  21. dissect/target/filesystems/fat.py +1 -1
  22. dissect/target/filesystems/ffs.py +1 -1
  23. dissect/target/filesystems/itunes.py +1 -1
  24. dissect/target/filesystems/ntfs.py +1 -1
  25. dissect/target/filesystems/smb.py +1 -1
  26. dissect/target/filesystems/squashfs.py +1 -1
  27. dissect/target/filesystems/tar.py +1 -1
  28. dissect/target/filesystems/vmfs.py +1 -1
  29. dissect/target/filesystems/xfs.py +1 -1
  30. dissect/target/filesystems/zip.py +1 -1
  31. dissect/target/helpers/cache.py +2 -2
  32. dissect/target/helpers/configutil.py +283 -83
  33. dissect/target/helpers/fsutil.py +9 -6
  34. dissect/target/helpers/hashutil.py +20 -19
  35. dissect/target/helpers/utils.py +14 -3
  36. dissect/target/loaders/ad1.py +1 -1
  37. dissect/target/loaders/asdf.py +1 -1
  38. dissect/target/loaders/log.py +2 -2
  39. dissect/target/loaders/smb.py +23 -13
  40. dissect/target/loaders/targetd.py +12 -2
  41. dissect/target/loaders/vma.py +1 -1
  42. dissect/target/loaders/xva.py +1 -1
  43. dissect/target/plugin.py +14 -2
  44. dissect/target/plugins/apps/av/sophos.py +1 -2
  45. dissect/target/plugins/apps/av/symantec.py +3 -4
  46. dissect/target/plugins/apps/av/trendmicro.py +2 -3
  47. dissect/target/plugins/{browsers → apps/browser}/chrome.py +6 -3
  48. dissect/target/plugins/{browsers → apps/browser}/chromium.py +18 -13
  49. dissect/target/plugins/{browsers → apps/browser}/edge.py +6 -3
  50. dissect/target/plugins/{browsers → apps/browser}/firefox.py +3 -7
  51. dissect/target/plugins/{browsers → apps/browser}/iexplore.py +14 -4
  52. dissect/target/plugins/apps/remoteaccess/teamviewer.py +55 -27
  53. dissect/target/plugins/apps/ssh/opensshd.py +31 -30
  54. dissect/target/plugins/apps/{webservers → webserver}/apache.py +1 -1
  55. dissect/target/plugins/apps/{webservers → webserver}/caddy.py +1 -1
  56. dissect/target/plugins/apps/{webservers → webserver}/iis.py +1 -1
  57. dissect/target/plugins/apps/{webservers → webserver}/nginx.py +1 -1
  58. dissect/target/plugins/child/hyperv.py +1 -2
  59. dissect/target/plugins/child/vmware_workstation.py +1 -3
  60. dissect/target/plugins/filesystem/acquire_handles.py +2 -0
  61. dissect/target/plugins/filesystem/acquire_hash.py +1 -7
  62. dissect/target/plugins/filesystem/icat.py +5 -5
  63. dissect/target/plugins/filesystem/ntfs/mft.py +2 -2
  64. dissect/target/plugins/filesystem/ntfs/mft_timeline.py +2 -2
  65. dissect/target/plugins/filesystem/ntfs/usnjrnl.py +2 -3
  66. dissect/target/plugins/filesystem/resolver.py +1 -1
  67. dissect/target/plugins/filesystem/unix/capability.py +77 -66
  68. dissect/target/plugins/filesystem/walkfs.py +25 -19
  69. dissect/target/plugins/filesystem/yara.py +20 -19
  70. dissect/target/plugins/general/config.py +28 -11
  71. dissect/target/plugins/os/unix/_os.py +28 -21
  72. dissect/target/plugins/os/unix/bsd/osx/user.py +1 -3
  73. dissect/target/plugins/os/unix/cronjobs.py +4 -16
  74. dissect/target/plugins/os/unix/{linux/esxi → esxi}/_os.py +5 -6
  75. dissect/target/plugins/os/unix/generic.py +5 -1
  76. dissect/target/plugins/os/unix/history.py +2 -1
  77. dissect/target/plugins/os/unix/linux/_os.py +12 -5
  78. dissect/target/plugins/os/unix/linux/services.py +112 -0
  79. dissect/target/plugins/os/unix/linux/suse/zypper.py +4 -4
  80. dissect/target/plugins/os/unix/locale.py +3 -1
  81. dissect/target/plugins/os/unix/log/journal.py +7 -6
  82. dissect/target/plugins/os/unix/packagemanager.py +3 -3
  83. dissect/target/plugins/os/unix/shadow.py +1 -1
  84. dissect/target/plugins/os/windows/_os.py +2 -1
  85. dissect/target/plugins/os/windows/amcache.py +9 -10
  86. dissect/target/plugins/os/windows/catroot.py +2 -2
  87. dissect/target/plugins/os/windows/cim.py +5 -4
  88. dissect/target/plugins/os/windows/datetime.py +4 -1
  89. dissect/target/plugins/os/windows/defender.py +3 -3
  90. dissect/target/plugins/os/windows/generic.py +10 -11
  91. dissect/target/plugins/os/windows/lnk.py +6 -6
  92. dissect/target/plugins/os/windows/log/amcache.py +3 -5
  93. dissect/target/plugins/os/windows/log/pfro.py +1 -3
  94. dissect/target/plugins/os/windows/prefetch.py +5 -6
  95. dissect/target/plugins/os/windows/recyclebin.py +3 -4
  96. dissect/target/plugins/os/windows/regf/7zip.py +2 -4
  97. dissect/target/plugins/os/windows/regf/bam.py +1 -2
  98. dissect/target/plugins/os/windows/regf/cit.py +4 -5
  99. dissect/target/plugins/os/windows/regf/mru.py +6 -2
  100. dissect/target/plugins/os/windows/regf/muicache.py +1 -3
  101. dissect/target/plugins/os/windows/regf/recentfilecache.py +1 -2
  102. dissect/target/plugins/os/windows/regf/shimcache.py +1 -2
  103. dissect/target/plugins/os/windows/regf/trusteddocs.py +1 -1
  104. dissect/target/plugins/os/windows/regf/userassist.py +1 -2
  105. dissect/target/plugins/os/windows/services.py +2 -4
  106. dissect/target/plugins/os/windows/sru.py +4 -4
  107. dissect/target/plugins/os/windows/startupinfo.py +5 -6
  108. dissect/target/plugins/os/windows/syscache.py +2 -3
  109. dissect/target/target.py +65 -32
  110. dissect/target/tools/info.py +2 -1
  111. dissect/target/tools/mount.py +2 -12
  112. dissect/target/tools/shell.py +3 -2
  113. dissect/target/volume.py +10 -9
  114. dissect/target/volumes/bde.py +1 -1
  115. dissect/target/volumes/ddf.py +2 -0
  116. dissect/target/volumes/disk.py +2 -0
  117. dissect/target/volumes/luks.py +1 -1
  118. dissect/target/volumes/lvm.py +2 -0
  119. dissect/target/volumes/md.py +2 -0
  120. dissect/target/volumes/vmfs.py +2 -0
  121. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/METADATA +2 -1
  122. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/RECORD +137 -136
  123. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/WHEEL +1 -1
  124. dissect/target/plugins/os/unix/services.py +0 -151
  125. /dissect/target/plugins/apps/{containers → browser}/__init__.py +0 -0
  126. /dissect/target/plugins/{browsers → apps/browser}/browser.py +0 -0
  127. /dissect/target/plugins/apps/{vpns → container}/__init__.py +0 -0
  128. /dissect/target/plugins/apps/{containers → container}/docker.py +0 -0
  129. /dissect/target/plugins/apps/{webservers → vpn}/__init__.py +0 -0
  130. /dissect/target/plugins/apps/{vpns → vpn}/openvpn.py +0 -0
  131. /dissect/target/plugins/apps/{vpns → vpn}/wireguard.py +0 -0
  132. /dissect/target/plugins/{browsers → apps/webserver}/__init__.py +0 -0
  133. /dissect/target/plugins/apps/{webservers/webservers.py → webserver/webserver.py} +0 -0
  134. /dissect/target/plugins/os/unix/{linux/esxi → esxi}/__init__.py +0 -0
  135. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/COPYRIGHT +0 -0
  136. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/LICENSE +0 -0
  137. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/entry_points.txt +0 -0
  138. {dissect.target-3.13.dev26.dist-info → dissect.target-3.14.dist-info}/top_level.txt +0 -0
@@ -64,10 +64,11 @@ class CimPlugin(Plugin):
64
64
  try:
65
65
  for binding in subscription_ns.class_("__filtertoconsumerbinding").instances:
66
66
  consumer = subscription_ns.query(binding.properties["Consumer"].value)
67
- yield ConsumerBindingRecord(
68
- query=consumer.properties["CommandLineTemplate"].value,
69
- _target=self.target,
70
- )
67
+ if query := consumer.properties.get("CommandLineTemplate"):
68
+ yield ConsumerBindingRecord(
69
+ query=query.value,
70
+ _target=self.target,
71
+ )
71
72
  except Exception as e: # noqa
72
73
  self.target.log.warning("Error during consumerbindings execution", exc_info=e)
73
74
  pass
@@ -37,7 +37,10 @@ c_tz = cstruct.cstruct()
37
37
  c_tz.load(tz_def)
38
38
 
39
39
 
40
- SundayFirstCalendar = calendar.Calendar(calendar.SUNDAY)
40
+ # Althoug calendar.SUNDAY is only officially documented since Python 3.10, it
41
+ # is present in Python 3.9, so we ignore the vermin warnings.
42
+ SUNDAY = calendar.SUNDAY # novermin
43
+ SundayFirstCalendar = calendar.Calendar(SUNDAY)
41
44
  TimezoneInformation = namedtuple(
42
45
  "TimezoneInformation",
43
46
  (
@@ -203,9 +203,9 @@ struct QuarantineEntryFileHeader {
203
203
  CHAR _Padding[32];
204
204
  DWORD Section1Size;
205
205
  DWORD Section2Size;
206
- DWORD Section1CrC;
207
- DWORD Section2CrC;
208
- char MagicFooter[4];
206
+ DWORD Section1CRC;
207
+ DWORD Section2CRC;
208
+ CHAR MagicFooter[4];
209
209
  };
210
210
 
211
211
  struct QuarantineEntrySection1 {
@@ -2,7 +2,6 @@ from datetime import datetime
2
2
  from typing import Optional
3
3
 
4
4
  from dissect.util.ts import from_unix
5
- from flow.record.fieldtypes import path
6
5
 
7
6
  from dissect.target.exceptions import RegistryError, UnsupportedPluginError
8
7
  from dissect.target.helpers.descriptor_extensions import (
@@ -250,7 +249,7 @@ class GenericPlugin(Plugin):
250
249
  value = r.value(name)
251
250
  yield AppInitRecord(
252
251
  ts=r.ts,
253
- path=path.from_windows(value.value),
252
+ path=self.target.fs.path(value.value),
254
253
  _target=self.target,
255
254
  _user=user,
256
255
  _key=r,
@@ -279,7 +278,7 @@ class GenericPlugin(Plugin):
279
278
  for value in r.values():
280
279
  yield KnownDllRecord(
281
280
  ts=r.ts,
282
- path=path.from_windows(value.value),
281
+ path=self.target.fs.path(value.value),
283
282
  _target=self.target,
284
283
  _user=user,
285
284
  _key=r,
@@ -325,7 +324,7 @@ class GenericPlugin(Plugin):
325
324
 
326
325
  yield SessionManagerRecord(
327
326
  ts=r.ts,
328
- path=path.from_windows(d),
327
+ path=self.target.fs.path(d),
329
328
  _target=self.target,
330
329
  _user=user,
331
330
  _key=r,
@@ -333,7 +332,7 @@ class GenericPlugin(Plugin):
333
332
  else:
334
333
  yield SessionManagerRecord(
335
334
  ts=r.ts,
336
- path=path.from_windows(data.split(" ")[0]),
335
+ path=self.target.fs.path(data.split(" ")[0]),
337
336
  _target=self.target,
338
337
  _user=user,
339
338
  _key=r,
@@ -427,7 +426,7 @@ class GenericPlugin(Plugin):
427
426
  value = r.value(name)
428
427
  yield CommandProcAutoRunRecord(
429
428
  ts=r.ts,
430
- path=path.from_windows(value.value),
429
+ path=self.target.fs.path(value.value),
431
430
  _target=self.target,
432
431
  _user=user,
433
432
  _key=r,
@@ -453,7 +452,7 @@ class GenericPlugin(Plugin):
453
452
  value = r.value("AlternateShell")
454
453
  yield AlternateShellRecord(
455
454
  ts=r.ts,
456
- path=path.from_windows(value.value),
455
+ path=self.target.fs.path(value.value),
457
456
  _target=self.target,
458
457
  _user=user,
459
458
  _key=r,
@@ -477,7 +476,7 @@ class GenericPlugin(Plugin):
477
476
 
478
477
  yield BootShellRecord(
479
478
  ts=r.ts,
480
- path=path.from_windows(value.value),
479
+ path=self.target.fs.path(value.value),
481
480
  _target=self.target,
482
481
  _user=user,
483
482
  _key=r,
@@ -500,7 +499,7 @@ class GenericPlugin(Plugin):
500
499
  user = self.target.registry.get_user(r)
501
500
  try:
502
501
  value = r.value("PendingFileRenameOperations")
503
- paths = map(path.from_windows, value.value)
502
+ paths = map(self.target.fs.path, value.value)
504
503
  except RegistryError:
505
504
  continue
506
505
 
@@ -528,7 +527,7 @@ class GenericPlugin(Plugin):
528
527
  for v in r.values():
529
528
  yield WinRarRecord(
530
529
  ts=r.ts,
531
- path=path.from_windows(v.value),
530
+ path=self.target.fs.path(v.value),
532
531
  _target=self.target,
533
532
  _user=user,
534
533
  _key=r,
@@ -552,7 +551,7 @@ class GenericPlugin(Plugin):
552
551
  for s in r.subkeys():
553
552
  yield WinSockNamespaceProviderRecord(
554
553
  ts=r.ts,
555
- librarypath=path.from_windows(s.value("LibraryPath").value),
554
+ librarypath=self.target.fs.path(s.value("LibraryPath").value),
556
555
  displaystring=s.value("DisplayString").value,
557
556
  providerid=s.value("ProviderID").value,
558
557
  enabled=s.value("Enabled").value,
@@ -2,7 +2,6 @@ from typing import Iterator, Optional
2
2
 
3
3
  from dissect.shellitem.lnk import Lnk
4
4
  from dissect.util import ts
5
- from flow.record.fieldtypes import path
6
5
 
7
6
  from dissect.target.exceptions import UnsupportedPluginError
8
7
  from dissect.target.helpers.fsutil import TargetPath
@@ -88,17 +87,17 @@ class LnkPlugin(Plugin):
88
87
  lnk_ctime = ts.from_unix(entry.stat().st_ctime)
89
88
 
90
89
  lnk_relativepath = (
91
- path.from_windows(lnk_file.stringdata.relative_path.string)
90
+ self.target.fs.path(lnk_file.stringdata.relative_path.string)
92
91
  if lnk_file.flag("has_relative_path")
93
92
  else None
94
93
  )
95
94
  lnk_workdir = (
96
- path.from_windows(lnk_file.stringdata.working_dir.string)
95
+ self.target.fs.path(lnk_file.stringdata.working_dir.string)
97
96
  if lnk_file.flag("has_working_dir")
98
97
  else None
99
98
  )
100
99
  lnk_iconlocation = (
101
- path.from_windows(lnk_file.stringdata.icon_location.string)
100
+ self.target.fs.path(lnk_file.stringdata.icon_location.string)
102
101
  if lnk_file.flag("has_icon_location")
103
102
  else None
104
103
  )
@@ -115,9 +114,9 @@ class LnkPlugin(Plugin):
115
114
  )
116
115
 
117
116
  if local_base_path and common_path_suffix:
118
- lnk_full_path = path.from_windows(local_base_path + common_path_suffix)
117
+ lnk_full_path = self.target.fs.path(local_base_path + common_path_suffix)
119
118
  elif local_base_path and not common_path_suffix:
120
- lnk_full_path = path.from_windows(local_base_path)
119
+ lnk_full_path = self.target.fs.path(local_base_path)
121
120
  else:
122
121
  lnk_full_path = None
123
122
 
@@ -161,6 +160,7 @@ class LnkPlugin(Plugin):
161
160
  target_mtime=target_mtime,
162
161
  target_atime=target_atime,
163
162
  target_ctime=target_ctime,
163
+ _target=self.target,
164
164
  )
165
165
 
166
166
  def lnk_entries(self, path: Optional[str] = None) -> Iterator[TargetPath]:
@@ -4,8 +4,6 @@ import re
4
4
  from datetime import datetime
5
5
  from typing import TYPE_CHECKING, Iterator, Union
6
6
 
7
- from flow.record.fieldtypes import path
8
-
9
7
  from dissect.target.exceptions import UnsupportedPluginError
10
8
  from dissect.target.helpers.record import TargetRecordDescriptor
11
9
  from dissect.target.plugin import Plugin, export
@@ -78,9 +76,9 @@ def create_record(
78
76
  modified=_to_log_timestamp(install_properties.get("modified")),
79
77
  access=_to_log_timestamp(install_properties.get("lastaccessed")),
80
78
  link_date=_to_log_timestamp(install_properties.get("linkdate")),
81
- path=path.from_windows(install_properties.get("path")),
82
- filename=path.from_windows(filename),
83
- create=path.from_windows(create),
79
+ path=target.fs.path(install_properties.get("path")),
80
+ filename=target.fs.path(filename),
81
+ create=target.fs.path(create),
84
82
  size_of_image=install_properties.get("sizeofimage"),
85
83
  file_description=install_properties.get("filedescription"),
86
84
  size=install_properties.get("size"),
@@ -1,8 +1,6 @@
1
1
  import datetime
2
2
  import re
3
3
 
4
- from flow.record.fieldtypes import path
5
-
6
4
  from dissect.target.exceptions import UnsupportedPluginError
7
5
  from dissect.target.helpers.record import TargetRecordDescriptor
8
6
  from dissect.target.plugin import Plugin, export
@@ -70,7 +68,7 @@ class PfroPlugin(Plugin):
70
68
 
71
69
  yield PfroRecord(
72
70
  ts=datetime.datetime.strptime(date, "%m/%d/%Y %H:%M:%S"),
73
- path=path.from_windows(file_path),
71
+ path=self.target.fs.path(file_path),
74
72
  operation=operation,
75
73
  _target=self.target,
76
74
  )
@@ -3,7 +3,6 @@ from io import BytesIO
3
3
  from dissect import cstruct
4
4
  from dissect.util import lzxpress_huffman
5
5
  from dissect.util.ts import wintimestamp
6
- from flow.record.fieldtypes import path
7
6
 
8
7
  from dissect.target.exceptions import UnsupportedPluginError
9
8
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -212,7 +211,7 @@ class Prefetch:
212
211
  self.fn.filename_strings_offset + entry.filename_string_offset,
213
212
  entry.filename_string_number_of_characters,
214
213
  )
215
- metrics.append(path.from_windows(filename.decode("utf-16-le")))
214
+ metrics.append(filename.decode("utf-16-le"))
216
215
  return metrics
217
216
 
218
217
  def read_filename(self, off, size):
@@ -290,15 +289,15 @@ class PrefetchPlugin(Plugin):
290
289
  self.target.log.warning("Failed to parse prefetch file: %s", entry, exc_info=e)
291
290
  continue
292
291
 
293
- filename = path.from_windows(scca.header.name.decode("utf-16-le", errors="ignore").split("\x00")[0])
294
- entry_name = path.from_windows(entry.name)
292
+ filename = self.target.fs.path(scca.header.name.decode("utf-16-le", errors="ignore").split("\x00")[0])
293
+ entry_name = self.target.fs.path(entry.name)
295
294
 
296
295
  if grouped:
297
296
  yield GroupedPrefetchRecord(
298
297
  ts=scca.latest_timestamp,
299
298
  filename=filename,
300
299
  prefetch=entry_name,
301
- linkedfiles=list(map(path.from_windows, scca.metrics)),
300
+ linkedfiles=list(map(self.target.fs.path, scca.metrics)),
302
301
  runcount=scca.fn.run_count,
303
302
  previousruns=scca.previous_timestamps,
304
303
  _target=self.target,
@@ -311,7 +310,7 @@ class PrefetchPlugin(Plugin):
311
310
  ts=date,
312
311
  filename=filename,
313
312
  prefetch=entry_name,
314
- linkedfile=path.from_windows(linked_file),
313
+ linkedfile=self.target.fs.path(linked_file),
315
314
  runcount=scca.fn.run_count,
316
315
  _target=self.target,
317
316
  )
@@ -2,7 +2,6 @@ from typing import Generator
2
2
 
3
3
  from dissect import cstruct
4
4
  from dissect.util.ts import wintimestamp
5
- from flow.record.fieldtypes import path
6
5
 
7
6
  from dissect.target import Target
8
7
  from dissect.target.exceptions import UnsupportedPluginError
@@ -115,10 +114,10 @@ class RecyclebinPlugin(Plugin):
115
114
 
116
115
  return RecycleBinRecord(
117
116
  ts=wintimestamp(entry.timestamp),
118
- path=path.from_windows(entry.filename.rstrip("\x00")),
119
- source=path.from_windows(source_path),
117
+ path=self.target.fs.path(entry.filename.rstrip("\x00")),
118
+ source=self.target.fs.path(source_path),
120
119
  filesize=entry.file_size,
121
- deleted_path=path.from_windows(deleted_path),
120
+ deleted_path=self.target.fs.path(deleted_path),
122
121
  _target=self.target,
123
122
  _user=user,
124
123
  )
@@ -1,5 +1,3 @@
1
- from flow.record.fieldtypes import path
2
-
3
1
  from dissect.target.exceptions import RegistryError, UnsupportedPluginError
4
2
  from dissect.target.helpers.record import TargetRecordDescriptor
5
3
  from dissect.target.plugin import Plugin, export
@@ -66,7 +64,7 @@ class SevenZipPlugin(Plugin):
66
64
 
67
65
  yield record(
68
66
  ts=subkey.ts,
69
- path=path.from_windows(file_path),
67
+ path=self.target.fs.path(file_path),
70
68
  _target=self.target,
71
69
  )
72
70
  except RegistryError:
@@ -90,7 +88,7 @@ class SevenZipPlugin(Plugin):
90
88
  value = subkey.value("PanelPath0").value
91
89
  yield PanelPathRecord(
92
90
  ts=subkey.ts,
93
- path=path.from_windows(value),
91
+ path=self.target.fs.path(value),
94
92
  _target=self.target,
95
93
  )
96
94
  except RegistryError:
@@ -1,6 +1,5 @@
1
1
  from dissect.cstruct import cstruct
2
2
  from dissect.util.ts import wintimestamp
3
- from flow.record.fieldtypes import path
4
3
 
5
4
  from dissect.target.exceptions import UnsupportedPluginError
6
5
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -57,6 +56,6 @@ class BamDamPlugin(Plugin):
57
56
  data = c_bam.entry(entry.value)
58
57
  yield BamDamRecord(
59
58
  ts=wintimestamp(data.ts),
60
- path=path.from_windows(entry.name),
59
+ path=self.target.fs.path(entry.name),
61
60
  _target=self.target,
62
61
  )
@@ -11,7 +11,6 @@ from io import BytesIO
11
11
  from dissect.cstruct import cstruct
12
12
  from dissect.util.compression import lznt1
13
13
  from dissect.util.ts import wintimestamp
14
- from flow.record.fieldtypes import path
15
14
 
16
15
  from dissect.target.exceptions import RegistryValueNotFoundError, UnsupportedPluginError
17
16
  from dissect.target.helpers.descriptor_extensions import UserRecordDescriptorExtension
@@ -735,7 +734,7 @@ class CITPlugin(Plugin):
735
734
  start_time=local_wintimestamp(self.target, cit.header.StartTimeLocal),
736
735
  current_time=local_wintimestamp(self.target, cit.header.CurrentTimeLocal),
737
736
  aggregation_period_in_s=cit.header.AggregationPeriodInS,
738
- path=path.from_windows(entry.file_path),
737
+ path=self.target.fs.path(entry.file_path),
739
738
  command_line=entry.command_line,
740
739
  pe_timedatestamp=program_data.PeTimeDateStamp,
741
740
  pe_checksum=program_data.PeCheckSum,
@@ -895,7 +894,7 @@ class CITPlugin(Plugin):
895
894
  yield CITTelemetryRecord(
896
895
  regf_mtime=version_key.ts,
897
896
  version=version_key.name,
898
- path=path.from_windows(value.name),
897
+ path=self.target.fs.path(value.name),
899
898
  value=str(c_cit.TELEMETRY_ANSWERS(value.value)).split(".")[1],
900
899
  _target=self.target,
901
900
  )
@@ -941,8 +940,8 @@ class CITPlugin(Plugin):
941
940
  yield CITModuleRecord(
942
941
  last_loaded=wintimestamp(value.value),
943
942
  regf_mtime=monitored_dll.ts,
944
- tracked_module=path.from_windows(monitored_dll.name),
945
- executable=path.from_windows(value.name),
943
+ tracked_module=self.target.fs.path(monitored_dll.name),
944
+ executable=self.target.fs.path(value.name),
946
945
  # These are actually specific for the tracked module, but just include them in every record
947
946
  overflow_quota=overflow_quota,
948
947
  overflow_value=overflow_value,
@@ -322,13 +322,17 @@ class MRUPlugin(Plugin):
322
322
 
323
323
  def parse_mru_key(target, key, record):
324
324
  user = target.registry.get_user(key)
325
- mrulist = key.value("MRUList").value
325
+
326
+ try:
327
+ mrulist = key.value("MRUList").value
328
+ except RegistryError:
329
+ mrulist = None
326
330
 
327
331
  for value in key.values():
328
332
  if value.name == "MRUList":
329
333
  continue
330
334
 
331
- entry_index = mrulist.index(value.name)
335
+ entry_index = mrulist.index(value.name) if mrulist else None
332
336
  entry_value = value.value
333
337
 
334
338
  yield record(
@@ -1,7 +1,5 @@
1
1
  from typing import Generator
2
2
 
3
- from flow.record.fieldtypes import path
4
-
5
3
  from dissect.target.exceptions import UnsupportedPluginError
6
4
  from dissect.target.helpers.descriptor_extensions import (
7
5
  RegistryRecordDescriptorExtension,
@@ -84,7 +82,7 @@ class MuiCachePlugin(Plugin):
84
82
  index=index,
85
83
  name=name,
86
84
  value=entry.value,
87
- path=path.from_windows(entry_path),
85
+ path=self.target.fs.path(entry_path),
88
86
  _target=self.target,
89
87
  _key=key,
90
88
  _user=user,
@@ -1,5 +1,4 @@
1
1
  from dissect import cstruct
2
- from flow.record.fieldtypes import path
3
2
 
4
3
  from dissect.target.exceptions import UnsupportedPluginError
5
4
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -59,7 +58,7 @@ class RecentFileCachePlugin(Plugin):
59
58
  entry.path = entry.path.rstrip("\x00")
60
59
 
61
60
  yield RecentFileCacheRecord(
62
- path=path.from_windows(entry.path),
61
+ path=self.target.fs.path(entry.path),
63
62
  _target=self.target,
64
63
  )
65
64
  except EOFError:
@@ -6,7 +6,6 @@ from typing import Callable, Generator, Optional, Tuple, Union
6
6
 
7
7
  from dissect.cstruct import Structure, cstruct
8
8
  from dissect.util.ts import wintimestamp
9
- from flow.record.fieldtypes import path
10
9
 
11
10
  from dissect.target.exceptions import Error, RegistryError, UnsupportedPluginError
12
11
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -358,6 +357,6 @@ class ShimcachePlugin(Plugin):
358
357
  last_modified=ts,
359
358
  name=name,
360
359
  index=index,
361
- path=path.from_windows(self.target.resolve(file_path)),
360
+ path=self.target.fs.path(self.target.resolve(file_path)),
362
361
  _target=self.target,
363
362
  )
@@ -73,7 +73,7 @@ class TrustedDocumentsPlugin(Plugin):
73
73
  ts=key.ts,
74
74
  type=value.type,
75
75
  application=application,
76
- document_path=self.target.resolve(value.name),
76
+ document_path=self.target.fs.path(self.target.resolve(value.name)),
77
77
  value=value.value,
78
78
  _key=key,
79
79
  _user=user,
@@ -2,7 +2,6 @@ import codecs
2
2
 
3
3
  from dissect import cstruct
4
4
  from dissect.util.ts import wintimestamp
5
- from flow.record.fieldtypes import path
6
5
 
7
6
  from dissect.target.exceptions import RegistryValueNotFoundError, UnsupportedPluginError
8
7
  from dissect.target.helpers.descriptor_extensions import (
@@ -128,7 +127,7 @@ class UserAssistPlugin(Plugin):
128
127
 
129
128
  yield UserAssistRecord(
130
129
  ts=wintimestamp(timestamp),
131
- path=path.from_windows(value),
130
+ path=self.target.fs.path(value),
132
131
  number_of_executions=number_of_executions,
133
132
  application_focus_count=application_focus_count,
134
133
  application_focus_duration=application_focus_duration,
@@ -1,7 +1,5 @@
1
1
  import re
2
2
 
3
- from flow.record.fieldtypes import path
4
-
5
3
  from dissect.target.exceptions import (
6
4
  RegistryError,
7
5
  RegistryValueNotFoundError,
@@ -100,7 +98,7 @@ class ServicesPlugin(Plugin):
100
98
 
101
99
  try:
102
100
  servicedll = key.subkey("Parameters").value("ServiceDll").value
103
- servicedll = path.from_windows(servicedll)
101
+ servicedll = self.target.fs.path(servicedll)
104
102
  except RegistryError:
105
103
  pass
106
104
 
@@ -138,7 +136,7 @@ class ServicesPlugin(Plugin):
138
136
  image_path = image_path[: m.end(0)].strip()
139
137
  else:
140
138
  pass
141
- image_path = path.from_windows(image_path)
139
+ image_path = self.target.fs.path(image_path)
142
140
  except RegistryError:
143
141
  pass
144
142
 
@@ -1,6 +1,5 @@
1
1
  from dissect.esedb.exceptions import Error
2
2
  from dissect.esedb.tools import sru
3
- from flow.record.fieldtypes import path
4
3
 
5
4
  from dissect.target.exceptions import UnsupportedPluginError
6
5
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -329,7 +328,6 @@ def transform_app_id(value):
329
328
  value = value.decode()
330
329
  else:
331
330
  value = str(value)
332
- value = path.from_windows(value)
333
331
  return value
334
332
 
335
333
 
@@ -355,7 +353,7 @@ class SRUPlugin(Plugin):
355
353
  super().__init__(target)
356
354
  self._sru = None
357
355
 
358
- srupath = self.target.fs.path("sysvol/Windows/System32/sru/SRUDB.dat")
356
+ srupath = target.fs.path("sysvol/Windows/System32/sru/SRUDB.dat")
359
357
  if srupath.exists():
360
358
  try:
361
359
  self._sru = sru.SRU(srupath.open())
@@ -382,7 +380,9 @@ class SRUPlugin(Plugin):
382
380
 
383
381
  record_values = {}
384
382
  for column, value in column_values:
385
- new_value = TRANSFORMS[column](value) if column in TRANSFORMS else value
383
+ new_value = value
384
+ if new_value and (transform := TRANSFORMS.get(column)):
385
+ new_value = self.target.fs.path(transform(new_value))
386
386
  new_column = FIELD_MAPPINGS.get(column, column)
387
387
  record_values[new_column] = new_value
388
388
 
@@ -1,7 +1,6 @@
1
1
  import datetime
2
2
 
3
3
  from defusedxml import ElementTree
4
- from flow.record.fieldtypes import path
5
4
 
6
5
  from dissect.target.exceptions import UnsupportedPluginError
7
6
  from dissect.target.helpers.record import TargetRecordDescriptor
@@ -65,8 +64,8 @@ class StartupInfoPlugin(Plugin):
65
64
  References:
66
65
  - https://www.trustedsec.com/blog/who-left-the-backdoor-open-using-startupinfo-for-the-win/
67
66
  """
68
- for file in self._files:
69
- fh = file.open("rb")
67
+ for path in self._files:
68
+ fh = path.open("rb")
70
69
 
71
70
  try:
72
71
  root = ElementTree.fromstring(fh.read().decode("utf-16-le"), forbid_dtd=True)
@@ -76,12 +75,12 @@ class StartupInfoPlugin(Plugin):
76
75
 
77
76
  yield StartupInfoRecord(
78
77
  ts=parse_ts(start_time),
79
- path=path.from_windows(process.get("Name")),
80
- commandline=path.from_windows(process.findtext("CommandLine")),
78
+ path=self.target.fs.path(process.get("Name")),
79
+ commandline=self.target.fs.path(process.findtext("CommandLine")),
81
80
  pid=process.get("PID"),
82
81
  parent_pid=process.findtext("ParentPID"),
83
82
  parent_start_time=parse_ts(parent_start_time),
84
- parent_name=path.from_windows(process.findtext("ParentName")),
83
+ parent_name=self.target.fs.path(process.findtext("ParentName")),
85
84
  disk_usage=process.findtext("DiskUsage"),
86
85
  cpu_usage=process.findtext("CpuUsage"),
87
86
  _target=self.target,
@@ -1,5 +1,4 @@
1
1
  from dissect.ntfs import ntfs
2
- from flow.record.fieldtypes import path
3
2
 
4
3
  from dissect.target.exceptions import RegistryValueNotFoundError, UnsupportedPluginError
5
4
  from dissect.target.helpers import regutil
@@ -48,7 +47,7 @@ class SyscachePlugin(Plugin):
48
47
  # Try to get the system volume
49
48
  mft = None
50
49
  sysvol = self.target.fs.mounts["sysvol"]
51
- if sysvol.__fstype__ == "ntfs" or hasattr(sysvol, "ntfs"): # Nasty TarLoader hack
50
+ if sysvol.__type__ == "ntfs" or hasattr(sysvol, "ntfs"): # Nasty TarLoader hack
52
51
  mft = sysvol.ntfs.mft
53
52
 
54
53
  # There's some other stuff here like an IndexTable and LruList
@@ -76,7 +75,7 @@ class SyscachePlugin(Plugin):
76
75
  full_path = None
77
76
  if mft:
78
77
  try:
79
- full_path = path.from_windows("\\".join(["sysvol", mft.mft(file_segment).fullpath()]))
78
+ full_path = self.target.fs.path("\\".join(["sysvol", mft.mft(file_segment).fullpath()]))
80
79
  except ntfs.Error:
81
80
  pass
82
81