-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path003_change_timestamp.py
31 lines (26 loc) · 1.62 KB
/
003_change_timestamp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from Workflow.ModifyStep import ModifyTimestampStep, IncrementTimestampStep
from Workflow.Workflow import *
def main(src, dest, eventrecordid, days, hours, minutes, seconds, microseconds):
# initialize Workflow
workflow = Workflow()
# create eventrecordid filter
filter_subj = WorkflowStepFilter()
filter_subj.add_system_filter("EventRecordID", eventrecordid)
# create and add step to workflow
step = IncrementTimestampStep(filter_subj, days=days, hours=hours, minutes=minutes, seconds=seconds, microseconds=microseconds)
workflow.add_step(step)
# start workflow
workflow.run(src, dest)
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description="Changes the time generated of a given record")
parser.add_argument("src", type=str, help="Path to the source Windows EVTX event log file")
parser.add_argument("dest", type=str, help="Path to the destination Windows EVTX event log file")
parser.add_argument("eventrecordid", type=str, help="Event record id")
parser.add_argument("--days", type=int, default=0, help="Increment/Decrement days")
parser.add_argument("--hours", type=int, default=0, help="Increment/Decrement days")
parser.add_argument("--minutes", type=int, default=0, help="Increment/Decrement days")
parser.add_argument("--seconds", type=int, default=0, help="Increment/Decrement days")
parser.add_argument("--microseconds", type=int, default=0, help="Increment/Decrement days")
args = parser.parse_args()
main(args.src, args.dest, args.eventrecordid, args.days, args.hours, args.minutes, args.seconds, args.microseconds)