dissect.target 3.20.2.dev15__py3-none-any.whl → 3.20.2.dev17__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.
@@ -31,9 +31,11 @@ class EnvironmentFilePlugin(Plugin):
31
31
 
32
32
  if not env_path:
33
33
  self.target.log.error("No ``--path`` provided!")
34
+ return
34
35
 
35
36
  if not (path := self.target.fs.path(env_path)).exists():
36
37
  self.target.log.error("Provided path %s does not exist!", path)
38
+ return
37
39
 
38
40
  for file in path.glob("**/*." + extension):
39
41
  if not file.is_file():
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import warnings
2
4
  from typing import Iterator, Optional
3
5
  from xml.etree.ElementTree import Element
@@ -157,8 +159,8 @@ class XmlTask:
157
159
  return data
158
160
 
159
161
  def get_element(
160
- self, xml_path: str, xml_data: Optional[Element] = None, attribute: Optional[str] = None
161
- ) -> Optional[str]:
162
+ self, xml_path: str, xml_data: Element | None = None, attribute: Optional[str] = None
163
+ ) -> str | None:
162
164
  """Get the value of the specified XML element.
163
165
 
164
166
  Args:
@@ -179,7 +181,7 @@ class XmlTask:
179
181
 
180
182
  return data.text
181
183
 
182
- def get_raw(self, xml_path: Optional[str] = None) -> str:
184
+ def get_raw(self, xml_path: str | None = None) -> str:
183
185
  """Get the raw XML data of the specified element.
184
186
 
185
187
  Args:
@@ -1,21 +1,16 @@
1
1
  from __future__ import annotations
2
2
 
3
- import logging
4
- import warnings
5
- from typing import Iterator, Union
3
+ from typing import Iterator
6
4
 
7
5
  from flow.record import GroupedRecord
8
6
 
9
7
  from dissect.target import Target
10
- from dissect.target.exceptions import UnsupportedPluginError
8
+ from dissect.target.exceptions import InvalidTaskError, UnsupportedPluginError
11
9
  from dissect.target.helpers.record import DynamicDescriptor, TargetRecordDescriptor
12
10
  from dissect.target.plugin import Plugin, export
13
11
  from dissect.target.plugins.os.windows.task_helpers.tasks_job import AtTask
14
12
  from dissect.target.plugins.os.windows.task_helpers.tasks_xml import ScheduledTasks
15
13
 
16
- warnings.simplefilter(action="ignore", category=FutureWarning)
17
- log = logging.getLogger(__name__)
18
-
19
14
  TaskRecord = TargetRecordDescriptor(
20
15
  "filesystem/windows/task",
21
16
  [
@@ -118,7 +113,7 @@ class TasksPlugin(Plugin):
118
113
  raise UnsupportedPluginError("No task files")
119
114
 
120
115
  @export(record=DynamicDescriptor(["path", "datetime"]))
121
- def tasks(self) -> Iterator[Union[TaskRecord, GroupedRecord]]:
116
+ def tasks(self) -> Iterator[TaskRecord | GroupedRecord]:
122
117
  """Return all scheduled tasks on a Windows system.
123
118
 
124
119
  On a Windows system, a scheduled task is a program or script that is executed on a specific time or at specific
@@ -132,7 +127,12 @@ class TasksPlugin(Plugin):
132
127
  """
133
128
  for task_file in self.task_files:
134
129
  if not task_file.suffix or task_file.suffix == ".xml":
135
- task_objects = ScheduledTasks(task_file).tasks
130
+ try:
131
+ task_objects = ScheduledTasks(task_file).tasks
132
+ except InvalidTaskError as e:
133
+ self.target.log.warning("Invalid task file encountered: %s", task_file)
134
+ self.target.log.debug("", exc_info=e)
135
+ continue
136
136
  else:
137
137
  task_objects = [AtTask(task_file, self.target)]
138
138
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: dissect.target
3
- Version: 3.20.2.dev15
3
+ Version: 3.20.2.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
@@ -133,7 +133,7 @@ dissect/target/plugins/apps/editor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
133
133
  dissect/target/plugins/apps/editor/editor.py,sha256=yJctXY0XTfwW3GKy6XLO2WaWFQLssdBck9ZOcZSyf80,495
134
134
  dissect/target/plugins/apps/editor/windowsnotepad.py,sha256=A9cfFrqbU2zjHRrzYsCnXr-uxKAIsVIKdXXJPYMt6MU,15068
135
135
  dissect/target/plugins/apps/other/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
- dissect/target/plugins/apps/other/env.py,sha256=_I12S_wjyT18WlUJ5cWOy5OTI140AheH6tq743iiyys,1874
136
+ dissect/target/plugins/apps/other/env.py,sha256=cPPxsrTh1h4v3qZa0XBwblWBZyPGAboZ-lZrrrenDoA,1912
137
137
  dissect/target/plugins/apps/remoteaccess/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  dissect/target/plugins/apps/remoteaccess/anydesk.py,sha256=IdijK3F6ppaB_IgKL-xDljlEbb8l9S2U0xSWKqK9xRs,4294
139
139
  dissect/target/plugins/apps/remoteaccess/remoteaccess.py,sha256=DWXkRDVUpFr1icK2fYwSXdZD204Xz0yRuO7rcJOwIwc,825
@@ -300,7 +300,7 @@ dissect/target/plugins/os/windows/services.py,sha256=Q3_ZNYvWBXHVsNYwNAaiV93oHI0
300
300
  dissect/target/plugins/os/windows/sru.py,sha256=sOM7CyMkW8XIXzI75GL69WoqUrSK2X99TFIfdQR2D64,17767
301
301
  dissect/target/plugins/os/windows/startupinfo.py,sha256=LarIAfB-sB6rzmh1rzxhiGWqy3VupKMpWLUpN1azB2I,3574
302
302
  dissect/target/plugins/os/windows/syscache.py,sha256=kR3Pc-Irtz6Ob2pv2CkKCWrL17LENxplNoer9VaOa2s,3540
303
- dissect/target/plugins/os/windows/tasks.py,sha256=Bpy3tosncnFuGRqomEtB1jwJCVehZq4suhUznjtq4wo,5718
303
+ dissect/target/plugins/os/windows/tasks.py,sha256=Pm_PhRbFEBvYxFmKgvXi01RjDW6l9Kh4LpptqCU8Frc,5844
304
304
  dissect/target/plugins/os/windows/thumbcache.py,sha256=jAceapDdP9bNLGZchJ1l1okm7_7xiYHRbI2hVGAzMPk,4249
305
305
  dissect/target/plugins/os/windows/ual.py,sha256=S43ltndKKrs2SqeDLgZv4dzdqtJD8c3Y0Z8FK-Y9IOA,10076
306
306
  dissect/target/plugins/os/windows/wer.py,sha256=y4ZU6Yai53UsZ4VLr0V9_uLhZJZ_UEtdPuNzxKbGoEY,9269
@@ -356,7 +356,7 @@ dissect/target/plugins/os/windows/regf/userassist.py,sha256=E9Iwel4-BO9M-6BZ8fro
356
356
  dissect/target/plugins/os/windows/task_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
357
357
  dissect/target/plugins/os/windows/task_helpers/tasks_job.py,sha256=7w3UGOiTAUQkP3xQ3sj4X3MTgHUJmmfdgiEadWmYquI,21197
358
358
  dissect/target/plugins/os/windows/task_helpers/tasks_records.py,sha256=vpCyKqLQSzI5ymD1h5P6RncLEE47YtmjDFwKA16dVZ4,4046
359
- dissect/target/plugins/os/windows/task_helpers/tasks_xml.py,sha256=fKwh9jtOP_gzWC_QTyuNScAvjJzWJphSz436aPknXzQ,15280
359
+ dissect/target/plugins/os/windows/task_helpers/tasks_xml.py,sha256=3D30BIuWGHuZtnvRmV53XgFDFuXSYEUqrMiKJJrWH8Q,15307
360
360
  dissect/target/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
361
361
  dissect/target/tools/build_pluginlist.py,sha256=5fomcuMwsVzcnYx5Htf5f9lSwsLeUUvomLUXNA4t7m4,849
362
362
  dissect/target/tools/dd.py,sha256=rTM-lgXxrYBpVAtJqFqAatDz45bLoD8-mFt_59Q3Lio,1928
@@ -383,10 +383,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
383
383
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
384
384
  dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
385
385
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
386
- dissect.target-3.20.2.dev15.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
387
- dissect.target-3.20.2.dev15.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
388
- dissect.target-3.20.2.dev15.dist-info/METADATA,sha256=FH0zPNArdOL1Cw_baWdBdKn4_nFjYVKolpY_iHD1iQM,13184
389
- dissect.target-3.20.2.dev15.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
390
- dissect.target-3.20.2.dev15.dist-info/entry_points.txt,sha256=yQwLCWUuzHgS6-sfCcRk66gAfoCfqXdCjqKjvhnQW8o,537
391
- dissect.target-3.20.2.dev15.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
392
- dissect.target-3.20.2.dev15.dist-info/RECORD,,
386
+ dissect.target-3.20.2.dev17.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
387
+ dissect.target-3.20.2.dev17.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
388
+ dissect.target-3.20.2.dev17.dist-info/METADATA,sha256=3Zv71EoGm3Np-VOObIAcfDmZYOheFzB1Qtne5bvskj8,13184
389
+ dissect.target-3.20.2.dev17.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
390
+ dissect.target-3.20.2.dev17.dist-info/entry_points.txt,sha256=yQwLCWUuzHgS6-sfCcRk66gAfoCfqXdCjqKjvhnQW8o,537
391
+ dissect.target-3.20.2.dev17.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
392
+ dissect.target-3.20.2.dev17.dist-info/RECORD,,