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.2-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d972caa710108740992dadd97802e4df78aea62682c52eab0aa0fde38a2d79d |
|
MD5 | d6305f44d311a7c92d33b13008b746b7 |
|
BLAKE2b-256 | 4b8743ed298961e0f7b8f86b26b347e6f9ea6821c6e3b5f2a2281695830606c5 |
Hashes for evtx-0.8.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97fed5510864da9c7d9e171ae6468db3ccbb08b3a53b113fdb3e3a5746abaf59 |
|
MD5 | ec4a5af7cb2368b7bffb917c44c37b22 |
|
BLAKE2b-256 | 2c4e966fc8ad6bdd6f8e2b7e38bab0e55b07b08c0cbc9a2085f147d8afdc1c88 |
Hashes for evtx-0.8.2-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99ea6b6bb1041d30d390e48ae48bedf8aa2aa5d8aadfac405cf9fce7fb1747ca |
|
MD5 | ac58b896900f7aa68041a8842557f9b5 |
|
BLAKE2b-256 | 959f331e3361dd17fcd8ca5d8fb99c1e0e35c96e6fe90ddb399dbbcb20144f1e |
Hashes for evtx-0.8.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e4b71cd33f8b652b61bb47fe6398387a76f1acd5a51b8e4abb8a30ccb95c903 |
|
MD5 | 2443e0f92f0885b63be9b9ac8c9162fc |
|
BLAKE2b-256 | 76eaef2d11f6589d1980e14883bb9f29b88b13c3bfd31a1132f16b7b4617fc54 |