-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added negative status code option #73
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some thoughts/notes inline.
fmt.Println("[-] Wildcard response found:", fmt.Sprintf("%s%s", s.Url, guid), "=>", *wildcardResp) | ||
if !s.WildcardForced { | ||
fmt.Println("[-] To force processing of Wildcard responses, specify the '-fw' switch.") | ||
if s.NegStatusCodes.Stringify() == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be better to use len
?
@@ -156,34 +168,68 @@ func PrintDirResult(s *State, r *Result) { | |||
|
|||
// Prefix if we're in verbose mode | |||
if s.Verbose { | |||
if s.StatusCodes.Contains(r.Status) { | |||
output = "Found : " | |||
if s.NegStatusCodes.Stringify() == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -59,7 +59,11 @@ func ShowConfig(s *State) { | |||
} | |||
|
|||
if s.Mode == "dir" { | |||
fmt.Printf("[+] Status codes : %s\n", s.StatusCodes.Stringify()) | |||
if s.NegStatusCodes.Stringify() == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -86,7 +88,7 @@ func ValidateState( | |||
} | |||
|
|||
if s.Mode == "dir" { | |||
if err := ValidateDirModeState(s, extensions, codes, proxy, errorList); err.ErrorOrNil() != nil { | |||
if err := ValidateDirModeState(s, extensions, codes, negcodes, proxy, errorList); err.ErrorOrNil() != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given they are mutually exclusive, can we just pass in 'codes' and then the state of the -s
or -S
(possibly passed as a bool somewhere) determines whether we treat them as 'positive' or 'negative' code? Feels cleaner.
Apologies for the delay on this, can I please request that you rebase your changes on 2.0.0 now that I've finally landed #79? Thank you so much. |
Hey @dave-au, you still keen for this? v3.0-working is our new working branch, would love to see you get your PR rebased onto that so we can move ahead. Cheers, and apologies for the delay. |
I hope @dave-au adds this - I was just looking for this option and would love to see it included |
We now have this feature in v3:
|
I've added "-S" to define negative status codes (instead of "-s").
There are no defaults for "-S".
If "-S" is specified, the values provided will overwrite the "-s" defaults (or any values specified by the user for "-s").
Example would be...
gobuster -m dir -w words -u http://host/ -S 404
fingers crossed This is literally my first pull request ever. I hope it is OK.