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

Automation? #63

Open
brandonstephens922 opened this issue Nov 12, 2019 · 7 comments
Open

Automation? #63

brandonstephens922 opened this issue Nov 12, 2019 · 7 comments

Comments

@brandonstephens922
Copy link

We are trying to get this process automated so this tool will always show yesterday's user activity. Is there a tested and proven method for retrieving event logs in XML. Anything we have tried results in an XML file that can't be read or parsed by LogonTracer.

@shu-tom
Copy link
Member

shu-tom commented Nov 12, 2019

We use Event viewer or PowerShell.

@brandonstephens922
Copy link
Author

brandonstephens922 commented Nov 12, 2019 via email

@shu-tom
Copy link
Member

shu-tom commented Nov 12, 2019

Please show a block example of your xml.

@shu-tom
Copy link
Member

shu-tom commented Nov 14, 2019

You can easily export using the wevtutil command.

> wevtutil qe Security /f:XML

@brandonstephens922
Copy link
Author

This is the error we continue to receive:

[] Script start. 2019/11/14 07:49:32
[
] Time zone is -4.
[!] This file is not XML format testing5.xml.

Here are the various methods I have tried:

wevtutil qe Security > test6.xml (Format error on upload)

wevtutil qe Security /f:XML > testing6.xml (Format error on upload)

wevtutil qe Security /f:RenderedXML > testing5.xml (Format error on upload)

wevtutil epl Security C:\Users\testing3.evtx (This method works but there is no option for XML)

@brandonstephens922
Copy link
Author

So in trying to upload via web ui one of the XML files retrieved this way, we receive the error EVTX parse Failed! Could you provide what version of Windows you may be successfully running the wevtutil command on? Very interested in how to successfully automate the XML export process successfully.

@denncraft
Copy link

denncraft commented Mar 9, 2022

I also ran into errors when trying to load XML files.
I will not describe my torment and search for a long time, but will immediately move on to the key points:

  1. The XML file must start with the string <?xml . This is strictly checked in the code.
  2. Technically, the XML file should have one main root element, and inside it there are already many of its descendants, for example: <Events><Event></Event><Event></Event></Events>, but this is not in the code checked.
  3. I don't know why, but the line of code: if xml.startswith("<System>"): didn't work as expected. and if so: if (xml.strip()).startswith('<System>'): then it works.

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

3 participants