Metadata-Version: 2.1
Name: ntfs_sds_parser
Version: 0.1.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Summary: Python bindings for https://github.com/AbdulRhmanAlfaifi/SDSParser-rs
Keywords: DFIR,forensics,$sds,ntfs
Home-Page: https://github.com/AbdulRhmanAlfaifi/SDSParser-py
Author: AbdulRhman Alfaifi
Author-email: aalfaifi@u0041.co
License: MIT or Apache-2.0
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/AbdulRhmanAlfaifi/SDSParser-py

# SDSParser-py
This project is Python3 bindings for [Rust](https://github.com/AbdulRhmanAlfaifi/SDSParser-rs) version. SDSParser-py is NTFS Security Descriptor Stream ($Secure:$SDS) parser.
# Download and Compilation
## Download from PyPi
```bash
python3 -m pip install ntfs_sds_parser
```

## Download wheels
You can also download wheels files from release section and install it using `python3 -m pip install <WHEEL_FILE>`

## Compile from Source
1. Install [Rustlang](https://www.rust-lang.org/tools/install)
2. Install [Python (>=3.7)](https://www.python.org/)
3. Install `maturin`: ```python3 -m pip install maturin```
4. Compile and Install this library:
```bash
git clone https://github.com/AbdulRhmanAlfaifi/SDSParser-py
cd SDSParser-py
python3 -m pip install .
``` 
## Usage
This is a simple script to parse `samples/sds_sample_record`:
```python
from ntfs_sds_parser import PySDSParser
import os

try:
    parser = PySDSParser(f"{os.path.dirname(__file__)}/../samples/sds_sample_record")

    for entry in parser:
        if not entry.is_error:
            print("="*50)
            print(f"Hash        : {entry.get_hash()}")
            print(f"ID          : {entry.get_security_id()}")
            print(f"Owner SID   : {entry.get_owner_sid()}")
            print(f"group SID   : {entry.get_group_sid()}")

except Exception as e:
    print(f"ERROR: {e}")
```

Refer to the `examples` directory in this repository for more examples.
