Return to site

Convert Evtx File To Text

broken image


File typeMicrosoft Windows Vista, Windows 7, Windows 8 Event Log Format
DeveloperMicrosoft
Ads
  1. How To Read Evtx Files
  2. Convert Evtx File To Text File
  3. Convert Evtx File To Text Citation
  4. Convert Evtx File To Text Messages
  5. Evtx File Viewer

In short, you can add these files as inputs, but be sure that these files are not being written to while splunk reads it. Also, unlike other log files, using the upload function will not work with these files. Splunk will recognize the file by the file extension.evt or.evtx. It is possible that while opening unknown files (e.g. EVTX) with a simple text editor like Windows Notepad will allow us to see some of the data encoded in the file. This method allows you to preview the contents of many files, but probably not in such a structure as a program dedicated to support them. # Given a Windows even log.evtx file, export a csv. # ALL fields in the XML will be processed, so there will be a column for every unique field, # not just the main fields in the message. I'm looking to export a large quantity of saved Security log files (.evtx) to text or CSV format. I found wevtutil but that only seems to be able to convert.evt to.evtx when dealing with saved log files: wevtutil epl c: logs seclog.evtx c: logs seclog.txt /lf:true The file is created as seclog.txt but it is in.evtx format.

How to open EVTX files

How To Read Evtx Files

If you cannot open the EVTX file on your computer - there may be several reasons. The first and most important reason (the most common) is the lack of a suitable software that supports EVTX among those that are installed on your device.

A very simple way to solve this problem is to find and download the appropriate application. The first part of the task has already been done – the software supporting the EVTX file can be found in the table. Now just download and install the appropriate application.

Program(s) that can open the .EVTX file

Convert Evtx File To Text File

Windows

Possible problems with the EVTX format files

The inability to open and operate the EVTX file does not necessarily mean that you do not have an appropriate software installed on your computer. There may be other problems that also block our ability to operate the Microsoft Windows Vista, Windows 7, Windows 8 Event Log Format file. Below is a list of possible problems.

  • Corruption of a EVTX file which is being opened
  • Incorrect links to the EVTX file in registry entries.
  • Accidental deletion of the description of the EVTX from the Windows registry
  • Incomplete installation of an application that supports the EVTX format
  • The EVTX file which is being opened is infected with an undesirable malware.
  • The computer does not have enough hardware resources to cope with the opening of the EVTX file.
  • Drivers of equipment used by the computer to open a EVTX file are out of date.

If you are sure that all of these reasons do not exist in your case (or have already been eliminated), the EVTX file should operate with your programs without any problem. If the problem with the EVTX file has not been solved, it may be due to the fact that in this case there is also another rare problem with the EVTX file. In this case, the only you can do is to ask for assistance of a professional staff.

Similar extensions

.admAdministrator Policy Template Format
.admlMicrosoft Administrative Language-specific XML Template Format
.admxMicrosoft Administrative XML Template Format
.amlMicrosoft Assistance Markup Language
.aniAnimated Cursor
.annMicrosoft Windows Help Annotation Format
.aosArchos Signed Encrypted Data Format
.asecGoogle Android Encrypted Application Package Format
How to associate the file with an installed software?

Convert Evtx File To Text Citation

Evtx

If you want to associate a file with a new program (e.g. my-file.EVTX) you have two ways to do it. The first and the easiest one is to right-click on the selected EVTX file. From the drop-down menu select 'Choose default program', then click 'Browse' and find the desired program. The whole operation must be confirmed by clicking OK. The second and more difficult to do is associate the EVTX file extension to the corresponding software in the Windows Registry.

Is there one way to open unknown files?

Many files contain only simple text data. It is possible that while opening unknown files (e.g. EVTX) with a simple text editor like Windows Notepad will allow us to see some of the data encoded in the file. This method allows you to preview the contents of many files, but probably not in such a structure as a program dedicated to support them.

I've been doing IR for a long time and I can't believe I have only now discovered the power of LogParser. Perhaps I was too spoiled by Splunk to actually be forced to learn this awesome tool. But now that I have gotten familiar with it, I see why it is so beloved. It's powerful and SQL-friendly command line capabilities give it a ton of flexibility and provide lots of opportunity for automation. While getting acquainted with it, and wanting to document my learning, I decided to create some batch files which capture syntax and intent.

Convert
Convert Evtx File To Text

If you want to associate a file with a new program (e.g. my-file.EVTX) you have two ways to do it. The first and the easiest one is to right-click on the selected EVTX file. From the drop-down menu select 'Choose default program', then click 'Browse' and find the desired program. The whole operation must be confirmed by clicking OK. The second and more difficult to do is associate the EVTX file extension to the corresponding software in the Windows Registry.

Is there one way to open unknown files?

Many files contain only simple text data. It is possible that while opening unknown files (e.g. EVTX) with a simple text editor like Windows Notepad will allow us to see some of the data encoded in the file. This method allows you to preview the contents of many files, but probably not in such a structure as a program dedicated to support them.

I've been doing IR for a long time and I can't believe I have only now discovered the power of LogParser. Perhaps I was too spoiled by Splunk to actually be forced to learn this awesome tool. But now that I have gotten familiar with it, I see why it is so beloved. It's powerful and SQL-friendly command line capabilities give it a ton of flexibility and provide lots of opportunity for automation. While getting acquainted with it, and wanting to document my learning, I decided to create some batch files which capture syntax and intent.

Background

LogParser.exe has been around a long time. Version 2.2 was released around 2006 and there are a few GUI front-ends available (e.g. LogParser Lizard and Log Parser Studio). A quick google search suggests it is more popular among IIS log searchers than EVT(X) uses.

Goal 1. Converting EVTX to CSV

I am often handed a set of IR triage artifacts that includes a file system containing event log files in EVTX format. This binary format is truly unfriendly and neither Excel, nor Splunk can work with it. However, LogParser can! If this were all it could do, it woudn't be worth mentioning since there are Powershell options to do this as well:

get-winevent -path .filescwindowssystem32winevtlogs*.evtx| export-csv FileName.csv -useculture

To quote on Redditor ('13cubed'): 'While you can certainly obtain logs with Get-WinEvent, Log Parser can query just about any text-based data source, not just logs. It is more scalable, and allows for fast searches of massive amounts of data allowing you to filter on a wide variety of things, such as event ID's, usernames, IP addresses, and more.'

Since I wanted to learn LogParser anyway, I figured it would be helpful to figure this out for starters.

LogParser doesn't work well with pipes (e.g. logparser.exe > eventlog.csv). Instead, since it uses SQL-like syntax. You have to 'INSERT INTO' the location you want to export to. The following syntax works well for 'point and shoot' batch-file double-clicking at the root of a mounted directory of artifacts.

logparser.exe 'select * INTO Security.csv from ‘.cwindowssystem32winevtlogsSecurity.evtx'' -i:EVT -headers:ON

A batch file to pull only to the log files mentioned in the SANS poster and JP Cert paper (see Goal 3) can be found here.

Now that I have CSVs I can use grep, Splunk, ELK or Excel to do further analysis. But I want to be able to do blue-team work even when my fancy analytics tools aren't available.

Goal 2. Push Button Event Log Triage

We are all busy. Even if we have the appetite to trawl through thousands of logs manually, if we can speed up the identification of weird/suspicious events, we can apply our brain power elsewhere and be more efficient. I wanted a quick way to summarize certain kinds of information in the logs such that an analyst could look at the output and more quickly identify things which may warrant a closer look.

Since LogParser seems to think in T-SQL, it is a great command line option for some simple data stacking (aka frequency analysis and anomaly detection). I created a set of queries which stack things like users, processes, services, scheduled tasks, domains, remote machines. I found a great resource with many examples of these commands at this github page and borrowed a lot of it making small tweaks here and there.

Since 'pipes' don't work, I had to figure out how to export/append the results to a single file for quick review by an analyst. Adding 'INTO exportfile.txt' before 'FROM' in the SQL gets the export done, but the append operation also requires ' -filemode:0″ at the end of each query. I chose to name my export file 'WELDS.txt' as a corny acronym for 'Windows Event Log Data Summaries.'

These queries dump numerous histogram-like count summaries of interesting data elements. It may be helpful to search at the lower end of the frequency table to fin things which are relatively rare.

My favorite part of this script is the summary of process execution events where I have paired the parent process with the child process. Typically, Proc2 is the parent and Proc1 is the child.

LogParser.exe -stats:OFF -i:EVT 'SELECT COUNT(*) AS CNT, EXTRACT_TOKEN(Strings, 5, ‘|') AS Proc1, extract_token(strings, 13, ‘|') as Proc2 INTO WELDS.txt FROM ‘.filescwindowssystem32winevtlogsSecurity.evtx' WHERE EventID = 4688 AND (Proc1 LIKE ‘%.%' AND Proc2 LIKE ‘%.%') GROUP BY Proc1, Proc2 ORDER BY CNT ASC'

The results are found near the end of the WELDS.txt file. In the absence of EDR or a memory capture, this can be very helpful in determining strange processes relationships (e.g. we would not want to see cmd.exe starting iexplore.exe).

Goal 3. Know Normal, Find Evil

Convert Evtx File To Text Messages

While there are seemingly endless ways to 'find evil' SANS has provided us with a 'greatest hits' of suspicious event IDs to pay close attention to in the form of the 2018 'Know Normal – Find Evil' poster. This is a quick reference for event logs, registry entries, and prefetch artifacts which incident responders can use to focus their first review of a suspect endpoint.

The Japanese CERT has also provided a wonderful paper on detecting lateral movement with similar artifacts.

The third batch file seeks to capture each of these pearls of wisdom in a 'push-button' friendly way to cull the massive number of events in the evtx files down to only those which are highlighted in these two documents as likely to reveal suspicious activity. I made an attempt to ECHO helpful comments about what each query is doing. This script output is very verbose and most likely needs additional tuning to make it worth while. However, it's a handy quick reference you can copy/paste from to target specific EventIDs of interest when responding to a suspected compromise.

My final batch file was inspired by the SANS DFIR Summit presentation on AppCompatProcessor. Among many other promising things (e.g. advance statistical anomaly detection), this tool uses a list of 'recon' strings to identify clusters of commands which are more likely to be indicative of an adversary performing recon on the machine or network in search of additional opportunities. Commands such as net.exe, whoami.exe, ping.exe, etc are collected and displayed in timeline format.

That's all for now. Hopefully, this shows you the power of LogParser and gives some ideas on how it can be used to quickly triage evidence in incident response.

Evtx File Viewer

P.S. this is a small taste of the kind of information I'll be teaching at the SANS FOR508 Class starting in Richmond, VA on March 6th. Details here: https://www.linkedin.com/feed/update/urn:li:activity:6483781362825392128/





broken image