dissect.target 3.19.dev16__py3-none-any.whl → 3.19.dev17__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,9 +45,9 @@ class LnkPlugin(Plugin):
45
45
  return None
46
46
  raise UnsupportedPluginError("No folders containing link files found")
47
47
 
48
- @arg("--directory", "-d", dest="directory", default=None, help="Path to .lnk file in target")
48
+ @arg("--path", "-p", dest="path", default=None, help="Path to directory or .lnk file in target")
49
49
  @export(record=LnkRecord)
50
- def lnk(self, directory: Optional[str] = None) -> Iterator[LnkRecord]:
50
+ def lnk(self, path: Optional[str] = None) -> Iterator[LnkRecord]:
51
51
  """Parse all .lnk files in /ProgramData, /Users, and /Windows or from a specified path in record format.
52
52
 
53
53
  Yields a LnkRecord record with the following fields:
@@ -77,7 +77,7 @@ class LnkPlugin(Plugin):
77
77
  # we need to get the active codepage from the system to properly decode some values
78
78
  codepage = self.target.codepage or "ascii"
79
79
 
80
- for entry in self.lnk_entries(directory):
80
+ for entry in self.lnk_entries(path):
81
81
  lnk_file = Lnk(entry.open())
82
82
  lnk_net_name = lnk_device_name = None
83
83
 
@@ -168,7 +168,15 @@ class LnkPlugin(Plugin):
168
168
 
169
169
  def lnk_entries(self, path: Optional[str] = None) -> Iterator[TargetPath]:
170
170
  if path:
171
- yield self.target.fs.path(path)
171
+ target_path = self.target.fs.path(path)
172
+ if not target_path.exists():
173
+ self.target.log.error("Provided path %s does not exist on target", target_path)
174
+ return
175
+
176
+ if target_path.is_file():
177
+ yield target_path
178
+ else:
179
+ yield from target_path.rglob("*.lnk")
172
180
  else:
173
181
  for folder in self.folders:
174
182
  yield from self.target.fs.path("sysvol").joinpath(folder).rglob("*.lnk")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.19.dev16
3
+ Version: 3.19.dev17
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
@@ -266,7 +266,7 @@ dissect/target/plugins/os/windows/datetime.py,sha256=YKHUZU6lkKJocq15y0yCwvIIOb1
266
266
  dissect/target/plugins/os/windows/defender.py,sha256=zh3brEvJmknD5ef0PGuLZ1G95Fgdh-dlgi-ZEbADKXo,32716
267
267
  dissect/target/plugins/os/windows/env.py,sha256=-u9F9xWy6PUbQmu5Tv_MDoVmy6YB-7CbHokIK_T3S44,13891
268
268
  dissect/target/plugins/os/windows/generic.py,sha256=BSvDPfB9faU0uquMj0guw5tnR_97Nn0XAEE4k05BFSQ,22273
269
- dissect/target/plugins/os/windows/lnk.py,sha256=On1k0PODYggQM1j514qFepBACCV2Z2u61Q4Ba6e3Y2c,8179
269
+ dissect/target/plugins/os/windows/lnk.py,sha256=2zpzpPbxL1qrxdbiZfhOGWKNujcj9tMy75_KrBXB1QE,8485
270
270
  dissect/target/plugins/os/windows/locale.py,sha256=yXVdclpUqss9h8Nq7N4kg3OHwWGDfjdfiLiUZR3wqv8,2324
271
271
  dissect/target/plugins/os/windows/notifications.py,sha256=T1CIvQgpW__qDR0Rq5zpeWmRWwjNDpvdMnvJJ_6tZXs,17378
272
272
  dissect/target/plugins/os/windows/prefetch.py,sha256=v4OgSKMwcihz0SOuA0o0Ec8wsAKuiuEmJolqZmHFgJA,10491
@@ -344,10 +344,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
344
344
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
345
345
  dissect/target/volumes/md.py,sha256=j1K1iKmspl0C_OJFc7-Q1BMWN2OCC5EVANIgVlJ_fIE,1673
346
346
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
347
- dissect.target-3.19.dev16.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
348
- dissect.target-3.19.dev16.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
349
- dissect.target-3.19.dev16.dist-info/METADATA,sha256=1FP5TC7cQxQzrnIsKcUESZJZigSYAQFFwvZgrbl60TY,12719
350
- dissect.target-3.19.dev16.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
351
- dissect.target-3.19.dev16.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
352
- dissect.target-3.19.dev16.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
353
- dissect.target-3.19.dev16.dist-info/RECORD,,
347
+ dissect.target-3.19.dev17.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
348
+ dissect.target-3.19.dev17.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
349
+ dissect.target-3.19.dev17.dist-info/METADATA,sha256=X8_Xig8_3plt8hHkWQbqILH5AFS3OjCmN1je1MyG1p8,12719
350
+ dissect.target-3.19.dev17.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
351
+ dissect.target-3.19.dev17.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
352
+ dissect.target-3.19.dev17.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
353
+ dissect.target-3.19.dev17.dist-info/RECORD,,