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

fix issue with ldap search func #5356

Merged
merged 2 commits into from
Jul 3, 2024
Merged

fix issue with ldap search func #5356

merged 2 commits into from
Jul 3, 2024

Conversation

tarunKoyalwar
Copy link
Member

@tarunKoyalwar tarunKoyalwar commented Jul 3, 2024

Proposed Changes

  • fix minor issue with params in ldap search function
id: ldap-metadata

info:
  name: LDAP - Enumeration
  author: pussycat0x
  severity: info
  description: |
    Attempts to list the supported capabilities in a SMBv2 server for each enabled dialect.
  reference:
    - https://docs.projectdiscovery.io/templates/protocols/javascript/modules/ldap.Client
  metadata:
    max-request: 1
    shodan-query: ldap
  tags: js,network,ldap,anonymous

javascript:
  - code: |
      const ldap = require('nuclei/ldap');
      const cfg = new ldap.Config();
      cfg.Upgrade = true;
      const client = new ldap.Client(Host, Ldap, Port, cfg);
      const dcs = client.Search('(objectClass=*)', 'cn', 'mail');
      Export(to_json(dcs));

    args:
      Host: "ldap://{{Host}}"
      Ldap: "{{Host}}"
      Port: 389
      
    extractors:  
      - type: json
        json:
          - '.'
          - '"DistinguishedName: " + .DistinguishedName'
          - '"SAMAccountName: " + .SAMAccountName'
          - '"PWDLastSet: "+ .PWDLastSet'
          - '"MemberOf: "+ .MemberOf'
          - '"ServicePrincipalName: " + .ServicePrincipalName'

Before

$  nuclei -u x.x.x.x:3268 -t a.yaml        

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.9

		projectdiscovery.io

[INF] Current nuclei version: v3.2.9 (latest)
[INF] Current nuclei-templates version: v9.9.0 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 164
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[INF] No results found. Better luck next time!

Now

$ ./nuclei -u x.x.x.x:3268 -t a.yaml        

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.9

		projectdiscovery.io

[INF] Current nuclei version: v3.2.9 (latest)
[INF] Current nuclei-templates version: v9.9.0 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 164
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[ldap-metadata] [javascript] [info] x.x.x.x:3268 ["[]"]

@tarunKoyalwar tarunKoyalwar self-assigned this Jul 3, 2024
@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review July 3, 2024 13:04
@tarunKoyalwar tarunKoyalwar merged commit e905544 into dev Jul 3, 2024
9 of 12 checks passed
@tarunKoyalwar tarunKoyalwar deleted the fix-ldap-search branch July 3, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant