Skip to content

Instantly share code, notes, and snippets.

@D00MFist
Created April 10, 2020 18:39
Show Gist options
  • Save D00MFist/ed4de45eaa300f8cc601ee469eb6735f to your computer and use it in GitHub Desktop.
Save D00MFist/ed4de45eaa300f8cc601ee469eb6735f to your computer and use it in GitHub Desktop.
ETW log for Microsoft-Windows-Kernel-Process
'''
Original Author: In Ming Loh
Requirements:
1. Python 3
2. pip install pywintrace
4. Windows machine
'''
import time
import etw
def showetwData(x):
_etwData = x[1]
print (_etwData)
def main_function():
# define capture provider info
providers = [etw.ProviderInfo('Microsoft-Windows-Kernel-Process', etw.GUID("{22FB2CD6-0E7B-422B-A0C7-2FAD1FD0E716}"))]
# create instance of ETW class
job = etw.ETW(providers=providers, event_callback=lambda x: showetwData(x), task_name_filters="PROCESSSTART")
# start capture
job.start()
print(job)
try:
while True:
pass
except(KeyboardInterrupt):
job.stop()
print("ETW monitoring stopped.")
if __name__ == '__main__':
main_function()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment