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

Templates with multiple DNS requests fail when the input is in "host:port" format #5425

Closed
mhmdiaa opened this issue Jul 21, 2024 · 1 comment · Fixed by #5426
Closed

Templates with multiple DNS requests fail when the input is in "host:port" format #5425

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

Comments

@mhmdiaa
Copy link
Contributor

mhmdiaa commented Jul 21, 2024

Nuclei version:

3.3.0

Current Behavior:

While executing a DNS template with multiple requests with a host:port input(s), the FQDN variable includes the port that causes the DNS requests to fail.

Expected Behavior:

The FQDN variable should not include a port regardless of the input format or the template protocol.

Steps To Reproduce:

  1. Write the following template to test-multi-request-input-handling.yaml
    id: test-multi-request-input-handling
    
    info:
      name: Test Single Protocol Input Handling
      author: mhmdiaa
      severity: info
    
    dns:
      - name: "{{FQDN}}"
        type: A
      - name: "{{FQDN}}"
        type: A
    
  2. Run nuclei -debug -u example.com:443 -t test-multi-request-input-handling.yaml
  3. The debug output will show the sent DNS requests which include the port.
    ;; QUESTION SECTION:
    ;example.com:443.  IN  A
    

Anything else:

The FQDN is parsed correctly when the template has a single request, uses another protocol, or when the input is a full URL.

$ cat test-single-request-input-handling.yaml
id: test-single-request-input-handling

info:
  name: Test Single Request Input Handling
  author: mhmdiaa
  severity: info

dns:
  - name: "{{FQDN}}"
    type: A

$ nuclei -debug -u example.com:443 -t test-single-request-input-handling.yaml
...
;; QUESTION SECTION:
;example.com.  IN  A
...
;; ANSWER SECTION:
example.com.  1009  IN  A  93.184.215.14
@mhmdiaa mhmdiaa added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 21, 2024
@ehsandeep
Copy link
Member

@mhmdiaa thanks for creating an issue and fix for it.

possible related issue - projectdiscovery/nuclei-templates#10349

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.

3 participants