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.4.tar.gz (10.5 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.4-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nebbia-1.1.4.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nebbia-1.1.4.tar.gz
Algorithm Hash digest
SHA256 4c1519cb4abb256b94842008435c6ef381205f51e38476ec2d4ed127eb568f3a
MD5 d9911410fb9ed41e529cba8def4cfe7f
BLAKE2b-256 5a13645b8c4f3a1e3bc5b1b12d35c655893a6e29a09b3cbefd9aefbc03331c24

See more details on using hashes here.

Provenance

The following attestation bundles were made for nebbia-1.1.4.tar.gz:

Publisher: workflow.yml on Fasertio/nebbia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: nebbia-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nebbia-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 42b6fd7564e32fe22506a141a0f7972da216f90fd626ebad0aeac12038cd29af
MD5 e0a4040aad215e0b0071c39a2788ef11
BLAKE2b-256 1eb83fa7a02ff1e81eae28309476d6dc0de11f39ffe63930aebd0229c8e4bb7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nebbia-1.1.4-py3-none-any.whl:

Publisher: workflow.yml on Fasertio/nebbia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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