Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldap Module CollectMetadata() - not working. #5446

Closed
pussycat0x opened this issue Jul 25, 2024 · 1 comment · Fixed by #5683
Closed

Ldap Module CollectMetadata() - not working. #5446

pussycat0x opened this issue Jul 25, 2024 · 1 comment · Fixed by #5683
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@pussycat0x
Copy link

Nuclei version:

v3.3.0

Current Behavior:

CollectMetadata() and another functions are not returning anydata in response.

Expected Behavior:

Steps To Reproduce:

javascript:
  - code: |
      const ldap = require('nuclei/ldap');
      const cfg = new ldap.Config();
      cfg.Upgrade = true;
      const client = new ldap.Client(Host, Port);
      const metadata = client.CollectMetadata();
      log(json_to(metadata))

    args:
      Host: "ldap://{{Host}}"
      Port: 389 

Anything else:

DebugData


[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.3.0 (latest)
[INF] Current nuclei-templates version: v9.9.1 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 75
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[DBG] Javascript Protocol request variables: 
        1. DN => 211
        2. FQDN => 127.0.0.1
        3. Host => 127.0.0.1
        4. Hostname => 177.129.211.170:389
        5. Port => 389
        6. RDN => 127.0.0.1
        7. SD => 127.0.0.1
        8. TLD => 170

[VER] [ldap-metadata] Sent Javascript request to 127.0.0.1:389
[DBG] Javascript Protocol response variables: 
        1. DN => 211
        2. FQDN => 127.0.0.1
        3. Host =>127.0.0.1
        4. Hostname => 127.0.0.1:389
        5. Port => 389
        6. RDN =>127.0.0.1
        7. SD => 127.0.0.1
        8. TLD => 170
        9. host => 127.0.0.1:389
        10. interactsh-server => 
        11. ip => 127.0.0.1
        12. matched => 127.0.0.1:389
        13. request => const ldap = require('nuc .... ); log(json_to(metadata))
        14. template-id => ldap-metadata
        15. template-info => {LDAP Metadata - Enumerat .... hodan-query:ldap] <nil> }
        16. template-path =>/Documents/ .... c/ldap/ldap-metadata.yaml
        17. type => javascript

[INF] No results found. Better luck next time!
@pussycat0x pussycat0x added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 25, 2024
@zrquan
Copy link
Contributor

zrquan commented Aug 9, 2024

Steps To Reproduce:

javascript:
  - code: |
      const ldap = require('nuclei/ldap');
      const cfg = new ldap.Config();
      cfg.Upgrade = true;
      const client = new ldap.Client(Host, Port);
      const metadata = client.CollectMetadata();
      log(json_to(metadata))

    args:
      Host: "ldap://{{Host}}"
      Port: 389 

The parameters passed to ldap.Client in ldap-metadata.yaml seem to be incorrect. You might want to try modifying them to:

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(Url, Realm, cfg);
      const metadata = client.CollectMetadata();
      log(json_to(metadata))

    args:
      Url: "ldap://{{Host}}:{{Port}}"
      Realm: ldap.example
      Host: "{{Host}}"
      Port: 389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants