Skip to content

Commit c797bb3

Browse files
Update !!!!README.md
1 parent c9cf123 commit c797bb3

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

evtx/Maps/!!!!README.md

+32-34
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Event log maps
1+
# EvtxECmd Maps
22

33
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.
44

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.
66

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:
88

99
```
1010
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
6464

6565
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.
6666

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.
6868

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.
7070

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.
7272

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.
7474

7575
The Channel is a useful identifier for a given log type. It can be seen in the `<Channel>` element ("Security" in the example above).
7676

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.
7878

79-
For example, consider the first map, for `UserName`, below.
79+
For example, consider the first Map, for `UserName`, below.
8080

8181
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%`
8282

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).
8484

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.
8686

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!
8888

89-
NOTE! The filenames for maps should be in the following format:
89+
NOTE! The filenames for Maps should be in the following format:
9090

91-
Channel-Name_Provider-Name_EventID.map
91+
`Channel-Name_Provider-Name_EventID.Map`
9292

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.
9494

9595
Only underscores should separate each element (Channel Name, Provider Name, EventID). Hyphens separates words. Underscores separate elements.
9696

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:
9898

99-
`Microsoft-Windows-TaskScheduler-Operational_Microsoft-Windows-TaskScheduler_201.map`
99+
`Microsoft-Windows-TaskScheduler-Operational_Microsoft-Windows-TaskScheduler_201.Map`
100100

101101
`Provider` is now mandatory. Provider is used at the header level and looks like this:
102102

103103
`Provider: "Microsoft-Windows-Power-Troubleshooter"`
104104

105-
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.
106106

107107
As of v06 or so, you can also add optional properties such as `Lookups`.
108108

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`:
110110

111111
Lookups:
112112
```
@@ -133,7 +133,7 @@ The name of the lookup table determines when it will be used and should match th
133133
Value: "/Event/EventData/Data[@Name=\"WakeSourceType\"]"
134134
```
135135

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:
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:
137137
```
138138
-
139139
Property: PayloadData2
@@ -147,7 +147,7 @@ Here, when the map is applied, the numerical value for WakeSourceType is filtere
147147
Value: "/Event/EventData/Data[@Name=\"WakeSourceType\"]"
148148
```
149149

150-
here is another example of a map:
150+
here is another example of a Map:
151151

152152
---- START MAP HERE ----
153153
```
@@ -192,32 +192,30 @@ Maps:
192192
```
193193
---- END MAP HERE ----
194194

195+
Map files are read in order, alphabetically. This means you can create your own alternative Maps to the default by doing the following:
195196

196-
Map files are read in order, alphabetically. This means you can create your own alternative maps to the default by doing the following:
197-
198-
1. make a copy of the map you want to modify
199-
2. name it the same as the map you are interested in, but prepend 1_ to the front of the filename.
200-
3. edit the new map to meet your needs
197+
1. make a copy of the Map you want to modify
198+
2. name it the same as the Map you are interested in, but prepend 1_ to the front of the filename.
199+
3. edit the new Map to meet your needs
201200

202201
Example:
203202

204-
Security_4624.map is copied and renamed to:
203+
`Security_Microsoft-Windows-Security-Auditing_4624.Map` is copied and renamed to:
205204

206-
1_Security_4624.map
205+
`1_Security_Microsoft-Windows-Security-Auditing_4624.Map`
207206

208-
Edit 1_Security_4624.map and make your changes
207+
Edit `1_Security_Microsoft-Windows-Security-Auditing_4624.Map` and make your changes
209208

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.
211210

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.
213212

214213
TIPS:
215214

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.
217216

218217
UPDATE: As of December 2020, Provider is now mandatory to avoid the above issue!
219218

220219
# Updating Documentation
221220

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

Comments
 (0)