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

Check for auth bypass via X-Fowarded-For and X-Real-IP #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

libnex
Copy link

@libnex libnex commented Mar 12, 2018

Whenever webborer encounter an access denied code (eg: 401,403 etc), attempt to set X-Forwarded-For and X-Real-IP to 127.0.0.1 in an attempt to check for auth bypass.

Copy link
Owner

@Matir Matir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run 'gofmt' on the file as well -- it does quite a nice job of autoformatting.

resp_temp, err := c.Client.Do(req)
if (err == nil) && (resp_temp.StatusCode>=200) && (resp_temp.StatusCode<400){

logging.Logf(logging.LogWarning,"Pontential AUTH BYPASS in " + u.String() + " via X-Forwarded-For/X-Real-IP: 127.0.0.1")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential.

@@ -58,6 +58,23 @@ func (c *httpClient) RequestURL(u *url.URL) (*http.Response, error) {
if err != nil {
return resp, err
}
// Check if we can bypass auth checks via X-Forwarded-For & X-Real-IP
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add a flag to enable/disable this, as it could greatly increase number of requests.

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.

2 participants