* Create a debug version of the Lobsters nuspec. * Create UsingMessageAnalyzerToFindETWSources.md * Add guide for using Message Analyzer Signed-off-by: Zac Brown <zac@zacbrown.io> * Update links to images. Signed-off-by: Zac Brown <zac@zacbrown.io> * Add link to Message Analyzer howto in README. * Force usage of TDH to get property size of array types. Should this prove to be a performance penalty in the longterm, we will revisit optimizing for heuristic sizing. Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com> * More general solution for handling when property Flags are set on EVENT_PROPERTY_INFO. 1) If flags are not set, try to get the length from the property 'length' field. Otherwise, try the heuristic. 2) if we couldn't get a length, fall back to calling TDH. Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com> * Add support for EndsWith/IEndsWith in property value matching. Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com> * Fix broken test in GitHub build. Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com> * Add tests for ends_with/iends_with. Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com>
Overview
Krabs is a C++ library that simplifies interacting with ETW. It allows for any number of traces and providers to be enabled and for client code to register for event notifications from these traces.
Krabs also provides code to simplify parsing generic event data into strongly typed data types.
O365.Security.Native.ETW is a C++ CLI (.NET) wrapper around Krabs. It provides the same functionality as Krabs to .NET applications and is used in production by the ODSP Security team. It's affectionately referred to as Lobsters.
Examples & Documentation
- An ETW Primer.
- Simple examples can be found in the
examplesfolder. - Please refer to KrabsExample.md and LobstersExample.md for detailed examples.
- SampleKrabsCSharpExe is a non-trivial example demonstrating how to manage the trace objects.
- Using Message Analyzer to find new ETW event sources.
Important Notes
krabsetwandO365.Security.Native.ETWonly support x64. No effort has been made to support x86.krabsetwandO365.Security.Native.ETWare only supported on Windows 7 or Windows 2008R2 machines and above.- Throwing exceptions in the event handler callback or krabsetw or O365.Security.Native.ETW will cause the trace to stop processing events.
- The call to "start" on the trace object is blocking so thread management may be necessary.
- The Visual Studio solution is krabs\krabs.sln.
- When building a native code binary using the
krabsetwpackage, please refer to the compilation readme for notes about the TYPEASSERT and NDEBUG compilation flags.
NuGet Packages
NuGet packages are available both for the krabsetw C++ headers and the O365.Security.Native.ETW .NET library:
- https://www.nuget.org/packages/O365.Security.Native.ETW/
- https://www.nuget.org/packages/O365.Security.Native.ETW.Debug/ (for development - provides type asserts)
- https://www.nuget.org/packages/krabsetw/
For verifying the .NET binaries, you can use the following command:
sn -T O365.Security.Native.ETW.dll
The expected output is:
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
Public key token is bc3a2e4ba4c5fbd5
Community & Contact
Please feel free to file issues through GitHub for bugs and feature requests and we'll respond to them as quickly as we're able.