Skip to content

Commit

Permalink
Add support for gpo tasks that are wrapped in other tasks (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecinestpasunepipe authored Jul 5, 2023
1 parent 73213e1 commit 51a8107
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dissect/target/plugins/os/windows/adpolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ def _xmltasks(self, policy_dir):
task_file_stat = task_file.stat()
xml = task_file.read_text()
tree = ElementTree.fromstring(xml)
for task in tree.findall("Task"):
properties = task.find("Properties")
for task in tree.findall(".//{*}Task"):
properties = task.find("Properties") or task
task_data = ElementTree.tostring(task)
yield ADPolicyRecord(
last_modification_time=task_file_stat.st_mtime,
last_access_time=task_file_stat.st_atime,
creation_time=task_file_stat.st_ctime,
guid=task.attrib.get("uid"),
key="XML",
value=properties.attrib.get("appName"),
value=properties.attrib.get("appName", None),
size=len(task_data),
data=task_data,
path=task_file,
Expand Down

0 comments on commit 51a8107

Please sign in to comment.