Python bindings for https://github.com/omerbenamram/evtx
Project description
pyevtx-rs
Python bindings for https://github.com/omerbenamram/evtx/
.
Installation
Available on PyPi - https://pypi.org/project/evtx/.
To install from PyPi - pip install evtx
Wheels
Wheels are currently automatically built for Python 3.7+ using abi3 tag (which means they are compatible with all version from 3.7 onwards).
Supported platforms are:
- Linux x86_64
- macOS x86_64
- macOS arm64 (m1)
- Windows x86_64
Installation from sources
Installation is possible for other platforms by installing from sources.
This requires a Rust compiler and a recent enough Setuptools and Pip.
Run pip install -e .
Usage
The API surface is currently fairly limited (only yields events as XML/JSON documents), but is planned to be expanded in the future.
This will print each record as an XML string.
from evtx import PyEvtxParser
def main():
parser = PyEvtxParser("./samples/Security_short_selected.evtx")
for record in parser.records():
print(f'Event Record ID: {record["event_record_id"]}')
print(f'Event Timestamp: {record["timestamp"]}')
print(record['data'])
print(f'------------------------------------------')
And this will print each record as a JSON string.
from evtx.parser import PyEvtxParser
def main():
parser = PyEvtxParser("./samples/Security_short_selected.evtx")
for record in parser.records_json():
print(f'Event Record ID: {record["event_record_id"]}')
print(f'Event Timestamp: {record["timestamp"]}')
print(record['data'])
print(f'------------------------------------------')
File-like objects are also supported.
from evtx.parser import PyEvtxParser
def main():
a = open("./samples/Security_short_selected.evtx", 'rb')
# io.BytesIO is also supported.
parser = PyEvtxParser(a)
for record in parser.records_json():
print(f'Event Record ID: {record["event_record_id"]}')
print(f'Event Timestamp: {record["timestamp"]}')
print(record['data'])
print(f'------------------------------------------')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for evtx-0.8.3-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b8d192e910a2152c110331ed64074b3cb25ca977bde7f2d25b2a9d76fa61ede |
|
MD5 | c3abadb5c1bbf9795ed763c36bf3ec0e |
|
BLAKE2b-256 | e4e51b64f9c9447431a43046cfcc4a1706a8eb01c540a17bf5d2c51ee154ca5e |
Hashes for evtx-0.8.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89be4c4b185fa00ef34a4e67859ef673e9719812f474f18c6a7130e8f4b6993a |
|
MD5 | 08e41d2fb07029b0bd95adb517cf400d |
|
BLAKE2b-256 | ec5d1383e37825606ce37e6b874926bb06966e56f7a6ea3fc892e92685c7139a |
Hashes for evtx-0.8.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b8e14d9a1c78799623eac0d41838457320f11f4d652be8c6917946fbb5902a7 |
|
MD5 | 54fc746384f15940fd7fffd1e10d8139 |
|
BLAKE2b-256 | 0361230fc0003360f4ef927673d2a45033718026f0ed4e22992628b600505991 |
Hashes for evtx-0.8.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616ea0fd0a819c4b11d50f0d8e6108069f57aaeab5fd16f8e890cb353aa76c79 |
|
MD5 | 690f6c03c70c628a317213429ad658bb |
|
BLAKE2b-256 | 19840fa03b7d4ad738f420419a85fd583b7aa7f0ee18dec112f27b842796fdf7 |
Hashes for evtx-0.8.3-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f16325ceeb0a56fb146ff632e5ab17b100abdb55734cab09a4683d3e4b648b32 |
|
MD5 | 66ee362ddd6813736f05905c0d3bf9b7 |
|
BLAKE2b-256 | f21cab560092ed11bc97052266c2240be91e9d916463c316f61d03e6438f6824 |