You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: evtx/Maps/!!!!README.md
+32-34
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Event log maps
1
+
# EvtxECmd Maps
2
2
3
3
Map files are used to convert the EventData (the unique part of an event) to a more standardized format. Map files are specific to a certain type of event log, such as Security, Application, etc.
4
4
5
-
Because different event logs may reuse Event IDs, maps need to be specific to a certain kind of log. This specificity is done by using a unique identifier for a given event log, the Channel. We will see more about this in a moment.
5
+
Because different event logs may reuse Event IDs, Maps need to be specific to a certain kind of log. This specificity is done by using a unique identifier for a given event log, the Channel. We will see more about this in a moment.
6
6
7
-
Once you know what event log and Event ID you want to make a map for, the first thing to do is dump the log's records to XML, using EvtxECmd.exe as follows:
7
+
Once you know what event log and Event ID you want to make a Map for, the first thing to do is dump the log's records to XML, using EvtxECmd.exe as follows:
8
8
9
9
```
10
10
EvtxECmd.exe -f <your eventlog> --xml c:\temp\xml
@@ -64,49 +64,49 @@ When the command finishes, open the generated xml file in c:\temp\ and find your
64
64
65
65
Just about everything in the `<System>` element is normalized by default, but if you want to include anything from there you can do so using the techniques we will see below.
66
66
67
-
In most cases, the data in the <EventData> block is what you want to process. This is where xpath queries come into play.
67
+
In most cases, the data in the `<EventData>` block is what you want to process. This is where xpath queries come into play.
68
68
69
-
So let's take a look at a map to make things a bit more clear.
69
+
So let's take a look at a Map to make things a bit more clear.
70
70
71
-
In the example below, there are four header properties that describe the map: who wrote it, what its for, the Channel, and the Event ID the map corresponds to.
71
+
In the example below, there are four header properties that describe the Map: who wrote it, what its for, the Channel, and the Event ID the Map corresponds to.
72
72
73
-
The Channel and Event ID property are what make a map unique, not the name of the file. As long as the map ends with '.map' it will be processed.
73
+
The Channel and Event ID property are what make a Map unique, not the name of the file. As long as the Map ends with '.Map' it will be processed.
74
74
75
75
The Channel is a useful identifier for a given log type. It can be seen in the `<Channel>` element ("Security" in the example above).
76
76
77
-
The Maps collection contains configurations for how to look for data in an events EventData and extract out particular properties into variables. These variables are then combined and mapped to the event record's first class properties.
77
+
The Maps collection contains configurations for how to look for data in an events EventData and extract out particular properties into variables. These variables are then combined and Mapped to the event record's first class properties.
78
78
79
-
For example, consider the first map, for `UserName`, below.
79
+
For example, consider the first Map, for `UserName`, below.
80
80
81
81
The `PropertyValue` defines the pattern that will be used to build the final value that will be assigned to the UserName field in the CSV. Variables in patterns are surrounded by % on both sides, so we see two variables defined: `%domain%` and `%user%`
82
82
83
-
In the map entries `Values` collection, we actually populate these variables by giving the value a name (domain in the first case) and an xpath query that will be used to set the value for the variable (`"/Event/EventData/Data[@Name=\"SubjectDomainName\"]"` in the first case).
83
+
In the Map entries `Values` collection, we actually populate these variables by giving the value a name (domain in the first case) and an xpath query that will be used to set the value for the variable (`"/Event/EventData/Data[@Name=\"SubjectDomainName\"]"` in the first case).
84
84
85
-
When a map is processed, each map entry has its `Values` items processed so the variables are populated with data. Then the `PropertyValue` is updated and the variables are replaced with the actual values. This final PropertyValue is then updated in the event record which then ends up in the CSV/JSON, etc.
85
+
When a Map is processed, each Map entry has its `Values` items processed so the variables are populated with data. Then the `PropertyValue` is updated and the variables are replaced with the actual values. This final PropertyValue is then updated in the event record which then ends up in the CSV/JSON, etc.
86
86
87
-
It is that simple! Be sure to surround things in double quotes and/or escape quotes as in the examples. When in doubt, test your map against real data!
87
+
It is that simple! Be sure to surround things in double quotes and/or escape quotes as in the examples. When in doubt, test your Map against real data!
88
88
89
-
NOTE! The filenames for maps should be in the following format:
89
+
NOTE! The filenames for Maps should be in the following format:
90
90
91
-
Channel-Name_Provider-Name_EventID.map
91
+
`Channel-Name_Provider-Name_EventID.Map`
92
92
93
-
Where Channel is EXACTLY what is in the XML <Channel> element with any '/' characters, hyphens, or spaces replaced with a hyphen. Hyphens are the catch all for each element of the map filename.
93
+
Where Channel is EXACTLY what is in the XML `<Channel>` element with any '/' characters, hyphens, or spaces replaced with a hyphen. Hyphens are the catch all for each element of the Map filename.
94
94
95
95
Only underscores should separate each element (Channel Name, Provider Name, EventID). Hyphens separates words. Underscores separate elements.
96
96
97
-
For example, for Event ID '201' and Channel 'Microsoft-Windows-TaskScheduler/Operational' the file should be named:
97
+
For example, for Event ID `201` and Channel `Microsoft-Windows-TaskScheduler/Operational` the file should be named:
This lets you further narrow down when a map will be used. Every map will have a working example of this now.
105
+
This lets you further narrow down when a Map will be used. Every Map will have a working example of this now.
106
106
107
107
As of v06 or so, you can also add optional properties such as `Lookups`.
108
108
109
-
Lookups allow you to define lookup tables that match one value and replace them with another. Here is an example, also from System_1.map:
109
+
Lookups allow you to define lookup tables that match one value and replace them with another. Here is an example, also from `System_Microsoft-Windows-Kernel-General_1.Map`:
110
110
111
111
Lookups:
112
112
```
@@ -133,7 +133,7 @@ The name of the lookup table determines when it will be used and should match th
Here, when the map is applied, the numerical value for WakeSourceType is filtered through the Lookup with the same name, and the value is updated to reflect the more human readable version. If you want BOTH the original value and the lookup value, simply reference the original using a different Name under Values, then reference that adjusted name as a variable, like this:
136
+
Here, when the Map is applied, the numerical value for WakeSourceType is filtered through the Lookup with the same name, and the value is updated to reflect the more human readable version. If you want BOTH the original value and the lookup value, simply reference the original using a different Name under Values, then reference that adjusted name as a variable, like this:
137
137
```
138
138
-
139
139
Property: PayloadData2
@@ -147,7 +147,7 @@ Here, when the map is applied, the numerical value for WakeSourceType is filtere
Edit `1_Security_Microsoft-Windows-Security-Auditing_4624.Map` and make your changes
209
208
210
-
When the maps are loaded, since 1_Security_4624.map comes before 4624.map, only the one with your changes will be loaded.
209
+
When the Maps are loaded, since `1_Security_Microsoft-Windows-Security-Auditing_4624.Map` comes before `Security_Microsoft-Windows-Security-Auditing_4624.Map`, only the one with your changes will be loaded.
211
210
212
-
This also allows you to update default maps without having your customizations blown away every time there is an update.
211
+
This also allows you to update default Maps without having your customizations blown away every time there is an update.
213
212
214
213
TIPS:
215
214
216
-
If you are looking to make an Application.evtx map, please include a Provider as they are many instances where the same event ID number is used for multiple providers. I've personally observed 4 Providers use Event ID 1 which without a Provider being listed for that map it made all 4 events, regardless of Provider, be mapped incorrectly. When in doubt, add a Provider to your map. Follow a template from a previously created map to ensure it's made correctly.
215
+
If you are looking to make an Application.evtx Map, please include a Provider as they are many instances where the same event ID number is used for multiple providers. I've personally observed 4 Providers use Event ID 1 which without a Provider being listed for that Map it made all 4 events, regardless of Provider, be Mapped incorrectly. When in doubt, add a Provider to your Map. Follow a template from a previously created Map to ensure it's made correctly.
217
216
218
217
UPDATE: As of December 2020, Provider is now mandatory to avoid the above issue!
219
218
220
219
# Updating Documentation
221
220
222
-
If you are looking for a way to contribute without making a map, search across the contents of all maps for "N/A" and try to find documentation for any of the maps in the repository. Ideally, each map will have as much documentation as possible that exists for that specific event. This can serve as a good reference for anyone using the tool as well as a learning tool for students and those new to the field.
223
-
221
+
If you are looking for a way to contribute without making a Map, search across the contents of all Maps for "N/A" and try to find documentation for any of the Maps in the repository. Ideally, each Map will have as much documentation as possible that exists for that specific event. This can serve as a good reference for anyone using the tool as well as a learning tool for students and those new to the field.
0 commit comments