Files
nuclei-templates/javascript/enumeration/ldap/ldap-metadata.yaml
2024-12-01 13:57:55 +00:00

45 lines
1.4 KiB
YAML

id: ldap-metadata
info:
name: LDAP Metadata - Enumeration
author: pussycat0x
severity: info
description: |
LDAP metadata refers to the data that describes the structure, schema, and attributes of the LDAP directory
reference:
- https://docs.projectdiscovery.io/templates/protocols/javascript/modules/ldap.Metadata
metadata:
max-request: 1
shodan-query: ldap
tags: js,network,ldap
javascript:
- pre-condition: |
isPortOpen(Host,Port);
code: |
const ldap = require('nuclei/ldap');
const cfg = new ldap.Config();
cfg.Upgrade = true;
const client = new ldap.Client(Host, Port, cfg);
const metadata = client.CollectMetadata();
Export(metadata)
args:
Host: "ldap://{{Host}}"
Port: 389
matchers:
- type: dsl
dsl:
- "success == true"
extractors:
- type: json
json:
- '"BaseDN: " + .BaseDN'
- '"DnsHostName: " + .DnsHostName '
- '"DefaultNamingContext: "+ .DefaultNamingContext'
- '"DomainFunctionality: "+ .DomainFunctionality'
- '"ForestFunctionality: " + .ForestFunctionality'
- '"DomainControllerFunctionality: "+ .DomainControllerFunctionality'
# digest: 4a0a0047304502200886e92d03a4fb94f9b303b470a526d5931c685f7cabd80d1963fbfd664ff7ed022100d63f0b5f6fe2e9787b92a561964cf3c962603b680451879745b244a1735fd7b5:922c64590222798bb761d5b6d8e72950