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

Input handling for network templates #3902

Closed
ehsandeep opened this issue Jul 3, 2023 · 2 comments · Fixed by #4123
Closed

Input handling for network templates #3902

ehsandeep opened this issue Jul 3, 2023 · 2 comments · Fixed by #4123
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Milestone

Comments

@ehsandeep
Copy link
Member

ehsandeep commented Jul 3, 2023

Please describe your feature request:

Current Template:

tcp:
  - inputs:
      - data: "Docker:\nVersion:\n"

    host:
      - "{{Host}}:2375"
      - "{{Hostname}}"
echo http://127.0.0.1 | nuclei -t test.yaml

[VER] Sent TCP request to example.com:2375
[VER] Sent TCP request to example.com:80

Expected Template:

tcp:
  - inputs:
      - data: "Docker:\nVersion:\n"

    host:
      - "{{Hostname}}:2375"
echo http://127.0.0.1 | nuclei -t test.yaml

[VER] Sent TCP request to example.com:2375
echo http://127.0.0.1:8080 | nuclei -t test.yaml

[VER] Sent TCP request to example.com:8080

Current format:

  • both {{Host}} and {{Hostname}} is specified to support both pre-defined port + as other port with user input.
  • keeping both format result into increased scan time, as one request from both is going to be timed out.

After update:

  • As default ports will be hard coded into the network template, which will be used as the default
  • Input with the port will overwrite the hardcoded port from the template

Describe the use case of this feature:

  • This will avoid needing to define host with port and hostname to ensure hardcoded port and user-defined input is getting respected.
  • This will reduce scan time (network templates) as, for now, one request will always result in a timeout.
@ehsandeep ehsandeep added Type: Enhancement Most issues will probably ask for additions or changes. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. labels Jul 3, 2023
@Mzack9999
Copy link
Member

I can't entirely agree with the proposal. There is a consistent difference between {{host}} and {{hostname}}, and I don't think we should make any implicit reduction that might cause missing target scanning (both placeholders are within a template for a specific reason: cover user defined target:port and also cover the ports that are most likely to expose the service). In my opinion, #3821 already covers this case by applying a runtime duplicate target detection with the final connecting address if target:port turns out to be the same.

Generally, template definition should be declarative and explicit, and implicit behaviors should always be reduced to the bare minimum to maximize scanning coverage. It's up to the template writer to define the scope of the template (hardcoded port vs. hardcoded + user-defined)

@Mzack9999
Copy link
Member

Superseded by #3954

@Mzack9999 Mzack9999 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
@Mzack9999 Mzack9999 added Status: Abandoned This issue is no longer important to the requestor and no one else has shown an interest in it. and removed Type: Enhancement Most issues will probably ask for additions or changes. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. labels Jul 19, 2023
@tarunKoyalwar tarunKoyalwar linked a pull request Sep 4, 2023 that will close this issue
@tarunKoyalwar tarunKoyalwar reopened this Sep 11, 2023
@tarunKoyalwar tarunKoyalwar self-assigned this Sep 11, 2023
@tarunKoyalwar tarunKoyalwar added Type: Enhancement Most issues will probably ask for additions or changes. and removed Status: Abandoned This issue is no longer important to the requestor and no one else has shown an interest in it. labels Sep 11, 2023
@ehsandeep ehsandeep added this to the v2.9.15 milestone Sep 11, 2023
@ehsandeep ehsandeep added Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Type: Enhancement Most issues will probably ask for additions or changes. labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants