-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing BinXML format #42
Comments
Hi @MrAnde7son This is an interesting use case, and one I hadn't considered before. I'm not very familiar with this remote interface. I'd be happy to take a look at a sample of your tool's output and see if it looks familiar. It would certainly be neat to parse this data source with minimal extra effort. |
Hi, Thanks for the quick reply!
And here's the actual connection and data collection, this code uses EvtRpcRegisterLogQuery function which returns a context handle, used to pull the actual events by using EvtRpcQueryNext function.
Then, as you can see, I'm iterating through the results and print hexdump of each event. My goal is to get the actual XML representation of the event. Thanks in advance!!! |
Wow, this looks really neat! Do you happen to have a sample of the output and binary data handy? Alternatively, I can install the the dependencies and get the above script working locally, but it'll take me a bit longer to get a quick triage back. |
Sure, no problem!
|
here's the raw data from an evtx event entry:
and the parsed structure:
and the rendered record:
|
looks like offset 0x14 from the RPC data matches offset 0x18 from the evtx file data, which is the start of the bxml root node. this is good news! let me see what happens when i try to blindly parse the RPC data using the evtx file parser. |
hi @MrAnde7son It looks like these two data sources use the same serialization format to encode the XML data. I think it will be possible to extend python-evtx to support the flags used by the RPC data. unfortunately, since i hadn't seen these flags before, the parser doesn't support them yet. i'll need to spend a bit of time to get everything working together. as a bit of background... the evtx file format allows records to share sub-structures and lets messages that re-use strings reference one another. i presume this helps with memory usage and file sizes. in the format used by the RPC service, the data is stored self-contained and in-line. i need to tweak the way the library tracks possibly shared resources such as sub-structure and strings to support this in-line mechanism. |
Awesome! Thanks @williballenthin . Looking forward.. |
I encountered with the same problem and didnt find any python library, wich can be helpful me. Can I expect a function to be implemented in your library? |
@MrAnde7son did you manage to use the library ? There is a ready-made solution |
If I can, I'd like to re-open this. My use case is slightly different, where I am using data lakes to carve event logs from super high fidelity storage in a memory efficient way. Currently I am able to map out all the chunks and records using all the available documentation on the event log specification, but the BinXML issue I am finding more challenging. Like @MrAnde7son, I have raw byte array, except mine has just been carved from the event log file. @spinenkoia, I have been looking at your script you linked interest, but the data I have doesn't match the specification. Although I pass the BinXML instantiation, I error out due to having an unknown template token. Any advice anyone can offer? |
Hi,
I'm using python to pull event logs from remote machine using ms-even6 interface (https://msdn.microsoft.com/en-us/library/cc231282.aspx).
I used EvtRpcRegisterLogQuery and EvtRpcQueryNext functions which produce a byte array that contains the BinXml data of the event. While having some issues with the parsing, I came through your project. From my understanding, Evtx also contains the event as BinXml format, however, my code does not produce any chunk nor record, but only the actual BinXml format, I can't seem to understand how exactly to use your code in order to parse it correctly.
So my questions are:
Thanks!
The text was updated successfully, but these errors were encountered: