Skip to content
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

panic: interface conversion: evtx.Element is *evtx.BinXMLEOF, not *evtx.Fragment #6

Open
phaag opened this issue Apr 3, 2018 · 2 comments

Comments

@phaag
Copy link

phaag commented Apr 3, 2018

While working with golang-evtx as a library I was faced with a panic:

panic: interface conversion: evtx.Element is *evtx.BinXMLEOF, not *evtx.Fragment

goroutine 824 [running]:
github.com/0xrawsec/golang-evtx/evtx.Event.GoEvtxMap(0xb3e8, 0x18800002a2a, 0x499, 0x1d2df942e928695, 0xc4202bd280, 0x1d2df942e928695, 0x0, 0x0)
        /opt/golang/src/github.com/0xrawsec/golang-evtx/evtx/event.go:77 +0x321
github.com/0xrawsec/golang-evtx/evtx.(*Chunk).Events.func1(0xc420284000, 0xc4202bd280)
        /opt/golang/src/github.com/0xrawsec/golang-evtx/evtx/chunk.go:249 +0x11d
created by github.com/0xrawsec/golang-evtx/evtx.(*Chunk).Events
        /opt/golang/src/github.com/0xrawsec/golang-evtx/evtx/chunk.go:244 +0x97

Input is an evtx file on a Win7 system: Microsoft-Windows-ReadyBoost%4Operational.evtx. Unfortunately I can not share the file for privacy reason.

Looking into the code, I see, that you deliberately panic if it's not a evtx.Fragment.
Is there a possibility to implement this element, as evtx.BinXMLEOF is already defined in structs.go.
Sure - I could use carve mode, but then I loose this content.

Many thanks for providing a parser for evtx files in Go.

@qjerome
Copy link
Contributor

qjerome commented Apr 5, 2018

Hi,

I have looked at your issue and it seems that it is located in a part of the code which is not very flexible to change. In fact, it is pretty unusual (and maybe invalid) to have a BinXMLEOF instead of a Fragment. Do you have reasons to think that your file is corrupted (live acquisition, damaged hard disk ...)? Actually, I don't want to patch if I am not sure that the issue is the code and not the file.

Cheers,

@phaag
Copy link
Author

phaag commented Apr 20, 2018

It was most likely a live acquisition, however, the question is, if it would be possible to cleanly handle this situation. LIve acquisitions are not uncommon, the file and the file is not damaged. Furthermore, if the code is integrated as a library, it crashes the whole application.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants