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.4-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f770070836311e85e9fd5aebc29c457e871ef548ad23165d7684cf5e45e7b1c |
|
MD5 | 6ff12a640b1c5b77292732dd85ad4c61 |
|
BLAKE2b-256 | 32eaf88ec668ea53ad1f3befb021e1aac189b20cc0ad446b0bd76240ee470afd |
Hashes for evtx-0.8.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af529a3c0a727eb2ebeec6f47880dfcad0b508c0cfbe86e0b256415e7b6a9d83 |
|
MD5 | a97fd5a0ef4bfd09f34a38365bcc9e4b |
|
BLAKE2b-256 | f2486bee0ec15d9adf5df958a29310151ed321c68753bb8b12e5e5d0ee06e8b6 |
Hashes for evtx-0.8.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23efdfaeb7bdf719e5962ed4bdc93fbd2a749dd4d9313cdf1505d34fae099838 |
|
MD5 | c14664ed0f262e1370030bf9f8f80e98 |
|
BLAKE2b-256 | 47504da6662a948c4ed710cf3480eafa7273a67be32f6185d3878fd2d8650804 |
Hashes for evtx-0.8.4-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7849c9939a696db510737d0f2d5fa122b5395099886b298b264490b7ea0f59b5 |
|
MD5 | 0ede092a53ee20022bb9cc5960d613bc |
|
BLAKE2b-256 | 9079106010172930743ac3396c6f29dade7cec4330c9f4dff7a5e294c761873d |
Hashes for evtx-0.8.4-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 214c215a4c2662adf304198c94f961818dc81cf35d4c9839ae3a17e4d97e7d70 |
|
MD5 | 7c177c219d1b3f0e5db5d10dfbfe0d7b |
|
BLAKE2b-256 | ca54b81759ecd7876c8b9f869e64fd2543867b2c47e303b96e7a8244c2949f99 |