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

[FEATURE] Template option to limit redirects only to the same protocol #5887

Open
JaneX8 opened this issue Dec 5, 2024 · 2 comments
Open
Labels
Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@JaneX8
Copy link
Contributor

JaneX8 commented Dec 5, 2024

Describe your feature request

I would like an option in nuclei-templates to restrict redirects to the protocol it was initialized with. I have a situation where I want to follow redirects (x times) but not when its switching to another protocol.

How can I ensure that redirects are only on the same protocol (eg http or https) and not switching protocols?

Right now I use something like:

requests:
  - method: GET
    path:
      - "http://{{Hostname}}/something"
      - "https://{{Hostname}}/something"

To ensure I test both, both can redirect but only within their own protocol.

Describe the use case of the feature

Generic, many use cases thinkable.

Describe alternatives you've considered

requests:
  - method: GET
    path:
      - "https://{{Hostname}}/something"
  - method: GET
    path:
      - "http://{{Hostname}}/something"

But still no way to limit redirects to their own protocol.

Additional context

In addition to the existing redirect controles like:

    redirects: true
    host-redirects: true
    max-redirects: 3

I propose:

    redirects: true
    host-redirects: true
    max-redirects: 3
    protocol-redirects: true # < Default true to stay backwards compatible

Then by using protocol-redirects: false this behavior could be disabled.

@JaneX8 JaneX8 added the Type: Enhancement Most issues will probably ask for additions or changes. label Dec 5, 2024
@GeorginaReeder
Copy link

Thanks for your feature request @JaneX8 , we'll take a look into this! :)

@JaneX8
Copy link
Contributor Author

JaneX8 commented Dec 6, 2024

I'm also wondering what the behavior of for example this would be:

      - "{{Hostname}}:443/ui"
      - "{{Hostname}}:80/ui"

Is this a way to stick on the same protocol, perhaps despite redirect and host-redirects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

No branches or pull requests

2 participants