Skip to main content

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


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.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nebbia-1.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file nebbia-1.1.0.tar.gz.

File metadata

  • Download URL: nebbia-1.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for nebbia-1.1.0.tar.gz
Algorithm Hash digest
SHA256 af700ccf1f04910dcd8403b265efe7da05fbb6a03cfb8c63d06d3b3dc66bd525
MD5 867714d740f028f3a910c65dbdaf7215
BLAKE2b-256 e089c8989a9993370a3c4a29648a20e146af8a8b2c7e43c76fa9415e871d4e79

See more details on using hashes here.

File details

Details for the file nebbia-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: nebbia-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for nebbia-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ca15348d14ce17fe541b14e5e7dc100dcc20126d9dad9df455a0d0c6544eeb0
MD5 c4838b554e330fb73e4cd1b9bd7227c7
BLAKE2b-256 0be8f2c636bae0cb7955e0e9b6c540c07126e147bd91b95d1d0f630304d7fb16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page