LDAP filter obfuscation tool
Project description
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
pip install nebbia
dev:
git clone https://github.com/Fasertio/nebbia
cd nebbia
pip install -e ".[dev]"
Library usage
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
#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
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 Distribution
nebbia-1.0.0.tar.gz
(6.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nebbia-1.0.0.tar.gz.
File metadata
- Download URL: nebbia-1.0.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7702e080a9b22a319c644601e7ad68485c92e79e8e1347a199c542a91ceefa16
|
|
| MD5 |
3654de5a734f1bdbd4335559a238c899
|
|
| BLAKE2b-256 |
cfd19dc01861b46aa01282611ca39e19604d3cc0e504acb00461976a72dc4446
|
File details
Details for the file nebbia-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nebbia-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906de7a7fccdc336c7b66877b11ba3962c225ebf604bf1bd203819ba67a6e82c
|
|
| MD5 |
8700765d6866928ede64e43e30d513cc
|
|
| BLAKE2b-256 |
4ecd382db1ef3354571dfdfaabfbd2c9320b5358bed4c6e4096731682b035c68
|