python-evtx
===========
Introduction
------------
python-evtx is a pure Python parser for recent Windows Event Log files (those with the file extension ".evtx"). The module provides programmatic access to the File and Chunk headers, record templates, and event entries. For example, you can use python-evtx to review the event logs of Windows 7 systems from a Mac or Linux workstation. The structure definitions and parsing strategies were heavily inspired by the work of Andreas Schuster and his Perl implementation "Parse-Evtx".
Background
----------
With the release of Windows Vista, Microsoft introduced an updated event log file format. The format used in Windows XP was a circular buffer of record structures that each contained a list of strings. A viewer resolved templates hosted in system library files and inserted the strings into appropriate positions. The newer event log format is proprietary binary XML. Unpacking chunks from an event log file from Windows 7 results in a complete XML document with a variable schema. The changes helped Microsoft tune the file format to real-world uses of event logs, such as long running logs with hundreds of megabytes of data, and system independent template resolution.
Related Work
------------
Andreas Schuster released the first public description of the .evtx file format in 2007. He is the author of the thorough document "Introducing the Microsoft Vista event log file format" that describes the motivation and details of the format. Mr. Schuster also maintains the Perl implementation of a parser called "Parse-Evtx". I referred to the source code of this library extensively during the development of python-evtx.
Joachim Metz also released a cross-platform, LGPL licensed C++ based parser in 2011. His document "Windows XML Event Log (EVTX): Analysis of EVTX" provides a detailed description of the structures and context of newer event log files.
Dependencies
------------
python-evtx is a pure Python 3 module, so it works equally well across platforms like Windows, macOS, and Linux.
python-evtx operates on event log files from Windows operating systems newer than Windows Vista. These files typically have the file extension .evtx. Version 5.09 of the `file` utility identifies such a file as "MS Vista Windows Event Log". To manual confirm the file type, look for the ASCII string "ElfFile" in the first seven bytes:
willi/evtx » xxd -l 32 Security.evtx
0000000: 456c 6646 696c 6500 0000 0000 0000 0000 ElfFile.........
0000010: d300 0000 0000 0000 375e 0000 0000 0000 ........7^......
Examples
--------
Provided with the parsing module `Evtx` are four scripts that mimic the tools distributed with Parse-Evtx. `evtx_info.py` prints metadata about the event log and verifies the checksums of each chunk. `evtx_templates.py` builds and prints the templates used throughout the event log. `evtx_dump.py` parses the event log and transforms the binary XML into a human readable ASCII XML format. Finally, `evtx_dump_json.py` parses event logs, similar to `evtx_dump.py` and transforms the binary XML into JSON with the added capability to output the JSON array to a file.
Note the length of the `evtx_dump.py` script: its only 20 lines. Now, review the contents and notice the complete implementation of the logic:
print(e_views.XML_HEADER)
print('<Events>')
for record in log.records:
print(record.xml())
print('</Events>')
Working with python-evtx is really easy!
Installation
------------
Updates to python-evtx are pushed to PyPi, so you can install the module using `pip`. For example:
pip install python-evtx
The source code for python-evtx is hosted at Github, and you may download, fork, and review it from this repository (http://www.github.com/williballenthin/python-evtx). Please report issues or feature requests through Github's bug tracker associated with the project.
Development
-----------
For formatting, use isort:
isort --length-sort --profile black --line-length=120 Evtx/ scripts/ tests/
and black:
black --line-length=120 Evtx/ scripts/ tests/
For linting, use ruff:
ruff check Evtx/ scripts/ tests/
License
-------
python-evtx is licensed under the Apache License, Version 2.0. This means it is freely available for use and modification in a personal and professional capacity.
没有合适的资源?快使用搜索试试~ 我知道了~
Windows 事件日志文件 (.evtx) 的纯 Python 解析器.zip
共42个文件
py:27个
evtx:6个
yml:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 173 浏览量
2024-11-24
14:20:11
上传
评论
收藏 447KB ZIP 举报
温馨提示
python-evtx介绍python-evtx 是一个纯 Python 解析器,用于解析最新的 Windows 事件日志文件(文件扩展名为“.evtx”的文件)。该模块提供对文件和块标头、记录模板和事件条目的编程访问。例如,您可以使用 python-evtx 从 Mac 或 Linux 工作站查看 Windows 7 系统的事件日志。结构定义和解析策略深受 Andreas Schuster 及其 Perl 实现“Parse-Evtx”的启发。背景随着 Windows Vista 的发布,Microsoft 引入了更新的事件日志文件格式。Windows XP 中使用的格式是记录结构的循环缓冲区,每个记录结构都包含一个字符串列表。查看器解析系统库文件中托管的模板并将字符串插入适当的位置。较新的事件日志格式是专有的二进制 XML。从 Windows 7 的事件日志文件中解压块会生成具有可变架构的完整 XML 文档。这些变化帮助 Microsoft 将文件格式调整为事件日志的实际用途,例如具有数百兆字节数据的长期运行日志和独立于系统的模板解析。相关工作Andreas S
资源推荐
资源详情
资源评论
收起资源包目录
Windows 事件日志文件 (.evtx) 的纯 Python 解析器.zip (42个子文件)
Evtx
__init__.py 812B
Evtx.py 17KB
BinaryParser.py 19KB
Views.py 10KB
Nodes.py 46KB
.travis.yml 390B
setup.py 2KB
.github
workflows
publish.yml 865B
test.yml 673B
标签.txt 40B
tests
test_chunks.py 5KB
fixtures.py 2KB
test_issue_37.py 2KB
test_issue_39.py 1KB
data
dns_log_malformed.evtx 68KB
issue_43.evtx 2.07MB
system.evtx 1.07MB
readme.md 622B
issue_39.evtx 1MB
issue_38.evtx 68KB
security.evtx 2.07MB
test_issue_43.py 592B
test_records.py 26KB
test_header.py 1KB
conftest.py 927B
test_issue_38.py 979B
资源内容.txt 1KB
LICENSE.TXT 11KB
.gitignore 365B
README.md 4KB
scripts
evtx_eid_record_numbers.py 860B
evtx_dump_json.py 3KB
evtx_record_structure.py 3KB
evtx_extract_record.py 1KB
evtx_dates.py 2KB
evtx_dump_chunk_slack.py 2KB
evtx_dump.py 1KB
evtx_structure.py 6KB
evtx_templates.py 1KB
evtx_record_template.py 679B
evtx_info.py 4KB
evtx_filter_records.py 2KB
共 42 条
- 1
资源评论
徐浪老师
- 粉丝: 8154
- 资源: 8383
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- formatted-task010-mctaco-answer-generation-event-ordering.json
- springboot农用车4S店管理系统答辩PPT
- Spring 框架之WebTestClient.pdf
- formatted-task009-mctaco-question-generation-event-ordering.json
- formatted-task008-mctaco-wrong-answer-generation-transient-stationary.json
- formatted-task007-mctaco-answer-generation-transient-stationary
- formatted-task006-mctaco-question-generation-transient-stationary
- Natural-Instructions mctaco-wrong-answer-generation-event-duration 指令微调数据
- 中国汽车金融报告 汽车金融:市场分析与发展趋势
- mmexport1732758164810.mp4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功