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

modules/http: Add option to suppress errors when max redirects exceeded #253

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

codyprime
Copy link
Member

If the --max-redirects value is exceeded, we return SCAN_APPLICATION_ERROR with "Too many redirect" as the error message.

Add an option (--redirects-succeed) to suppress this error, and return success even if we exceed the maximum specified number of redirects.

How to Test

echo google.com | zgrab2 http --max-redirects=0

This should show a failure status:

      "timestamp": "2020-02-26T16:54:20-05:00",
      "error": "Too many redirects"
    }
{"statuses":{"http":{"successes":0,"failures":1}},"start":"2020-02-26T16:55:53-05:00","end":"2020-02-26T16:55:53-05:00","duration":"78.194261ms"}

With the new flag, it should succeed:
echo google.com | zgrab2 http --max-redirects=0 --redirects-succeed

      },
      "timestamp": "2020-02-26T16:55:12-05:00"
    }
{"statuses":{"http":{"successes":1,"failures":0}},"start":"2020-02-26T16:55:28-05:00","end":"2020-02-26T16:55:28-05:00","duration":"69.901353ms"}

If the --max-redirects value is exceeded, we return
SCAN_APPLICATION_ERROR with "Too many redirect" as the error message.

Add an option to suppress this error, and return success even if we
exceed the maximum specified number of redirects.
@dadrian dadrian merged commit 0bd36c5 into master Feb 28, 2020
@dadrian dadrian deleted the jcody/http-redirect-success branch February 28, 2020 18:56
AnthraX1 pushed a commit to AnthraX1/zgrab2 that referenced this pull request Jul 21, 2020
…ed (zmap#253)

If the --max-redirects value is exceeded, we return
SCAN_APPLICATION_ERROR with "Too many redirect" as the error message.

Add an option to suppress this error, and return success even if we
exceed the maximum specified number of redirects.
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.

3 participants