Metadata-Version: 2.4
Name: nebbia
Version: 1.0.0
Summary: LDAP filter obfuscation tool
Author: Fasertio
License: MIT
Keywords: ldap,obfuscation,ast,security,active-directory
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"

# nebbia

LDAP filter obfuscation tool.  
Analyze the filter using **Abstract Syntax Tree**, applies structural transformation and return an equivalent query.
Useful for sneaky query to the Domain Controller or edit tools that queries against the domain (like Certipy).

---

## Installation

```bash
pip install nebbia
```

dev:

```bash
git clone https://github.com/Fasertio/nebbia
cd nebbia
pip install -e ".[dev]"
```

---

## Library usage

```python
from nebbia import obfuscate, parse, serialize

query  = "(&(objectClass=person)(uid=jdoe)(!(locked=true)))"
result = obfuscate(query)
print(result)
# es: (&((!(!(\75Id=\6A\64\6F\65))))(oBjEcTcLaSs=\70\65\72son)(!(loCkeD=true)))

r1 = obfuscate(query, seed=42)
r2 = obfuscate(query, seed=42)
assert r1 == r2

from nebbia import parse, serialize, NodeType

ast = parse("(sAMAccountName=krbtgt)")
print(ast)
# ASTNode(FILTER, 'sAMAccountName'='krbtgt')

ast.value = "administrator"
print(serialize(ast))
# (sAMAccountName=administrator)
```

---

## CLI

```bash

#single query
nebbia "(uid=jdoe)"

#multiple
nebbia "(&(uid=admin)(objectClass=person))" --count 3

#deterministic output
nebbia "(cn=krbtgt)" --seed 42

#disable ANSI color
nebbia "(uid=test)" --no-color

#stdin
echo "(uid=admin)" | nebbia

#python module
python -m nebbia "(uid=jdoe)" --count 2
```

---

## License

MIT
