fox-it/dissect.target

Windows plugins datetime fields

Zawadidone opened this issue · 3 comments

The *_date fields use the type string.

("string", "first_insert_date"),
("string", "first_instal_date"),
("string", "last_insert_date"),
("string", "last_removal_date"),

But the docstring states that these fields use the type datetime.

first_insert_date (datetime): First insertion date of USB storage device
first_instal_date (datetime): First instalation date of USB storage device
last_insert_date (datetime): Most recent insertion (arrival) date of USB storage device
last_removal_date (datetime): Most recent removal (unplug) date of USB storage device

Is this intended or should the type of these fields be adjusted to datetime?

The same applies for

At least the USB ones look like a bug. There's also a type with instal it looks like. Feel free to fix in a PR.

As for the task one, looks like that comes from the RegistrationInfo/Date field in the task XML. I don't know the purpose of this field by heart, but if it's indeed a timestamp then it makes sense to also start parsing that as a datetime.

Microsoft states that it is a date element.

When reading or writing XML for a task, the registration date is specified using the Date element of the Task Scheduler schema. - https://learn.microsoft.com/en-us/windows/win32/taskschd/registrationinfo-date, https://learn.microsoft.com/en-us/windows/win32/taskschd/taskschedulerschema-date-registrationinfotype-element

Closed in #187