Skip to content

Commit

Permalink
remove the wildcard switch from everything except DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed Feb 25, 2021
1 parent 2f636e7 commit a0b94ee
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ All funds that are donated to this project will be donated to charity. A full lo

- Use go 1.16
- use contexts in the correct way
- get rid of the wildcard flag (except in DNS mode)

## Changes in 3.1

Expand Down
8 changes: 1 addition & 7 deletions cli/cmd/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func runDir(cmd *cobra.Command, args []string) error {
if err := cli.Gobuster(mainContext, globalopts, plugin); err != nil {
var wErr *gobusterdir.ErrWildcard
if errors.As(err, &wErr) {
return fmt.Errorf("%w. To continue please exclude the status code, the length or use the --wildcard switch", wErr)
return fmt.Errorf("%w. To continue please exclude the status code or the length", wErr)
}
return fmt.Errorf("error on running gobuster: %w", err)
}
Expand Down Expand Up @@ -118,11 +118,6 @@ func parseDirOptions() (*libgobuster.Options, *gobusterdir.OptionsDir, error) {
return nil, nil, fmt.Errorf("invalid value for hide-length: %w", err)
}

plugin.WildcardForced, err = cmdDir.Flags().GetBool("wildcard")
if err != nil {
return nil, nil, fmt.Errorf("invalid value for wildcard: %w", err)
}

plugin.DiscoverBackup, err = cmdDir.Flags().GetBool("discover-backup")
if err != nil {
return nil, nil, fmt.Errorf("invalid value for discover-backup: %w", err)
Expand Down Expand Up @@ -154,7 +149,6 @@ func init() {
cmdDir.Flags().BoolP("no-status", "n", false, "Don't print status codes")
cmdDir.Flags().Bool("hide-length", false, "Hide the length of the body in the output")
cmdDir.Flags().BoolP("add-slash", "f", false, "Append / to each request")
cmdDir.Flags().Bool("wildcard", false, "Force continued operation when wildcard found")
cmdDir.Flags().BoolP("discover-backup", "d", false, "Upon finding a file search for backup files")
cmdDir.Flags().IntSlice("exclude-length", []int{}, "exclude the following content length (completely ignores the status). Supply multiple times to exclude multiple sizes.")

Expand Down
1 change: 0 additions & 1 deletion cli/cmd/dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func BenchmarkDirMode(b *testing.B) {
pluginopts := gobusterdir.NewOptionsDir()
pluginopts.URL = h.URL
pluginopts.Timeout = 10 * time.Second
pluginopts.WildcardForced = true

pluginopts.Extensions = ".php,.csv"
tmpExt, err := helper.ParseExtensions(pluginopts.Extensions)
Expand Down
8 changes: 1 addition & 7 deletions cli/cmd/fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func runFuzz(cmd *cobra.Command, args []string) error {
if err := cli.Gobuster(mainContext, globalopts, plugin); err != nil {
var wErr *gobusterfuzz.ErrWildcard
if errors.As(err, &wErr) {
return fmt.Errorf("%w. To force processing of Wildcard responses, specify the '--wildcard' switch", wErr)
return fmt.Errorf("%w. To continue please exclude the status code or the length", wErr)
}
return fmt.Errorf("error on running gobuster: %w", err)
}
Expand Down Expand Up @@ -74,11 +74,6 @@ func parseFuzzOptions() (*libgobuster.Options, *gobusterfuzz.OptionsFuzz, error)
plugin.ExcludedStatusCodesParsed = ret
}

plugin.WildcardForced, err = cmdFuzz.Flags().GetBool("wildcard")
if err != nil {
return nil, nil, fmt.Errorf("invalid value for wildcard: %w", err)
}

plugin.ExcludeLength, err = cmdFuzz.Flags().GetIntSlice("exclude-length")
if err != nil {
return nil, nil, fmt.Errorf("invalid value for excludelength: %w", err)
Expand All @@ -100,7 +95,6 @@ func init() {
}
cmdFuzz.Flags().StringP("excludestatuscodes", "b", "", "Negative status codes (will override statuscodes if set)")
cmdFuzz.Flags().IntSlice("exclude-length", []int{}, "exclude the following content length (completely ignores the status). Supply multiple times to exclude multiple sizes.")
cmdFuzz.Flags().BoolP("wildcard", "", false, "Force continued operation when wildcard found")

cmdFuzz.PersistentPreRun = func(cmd *cobra.Command, args []string) {
configureGlobalOptions()
Expand Down
4 changes: 2 additions & 2 deletions gobusterdir/gobusterdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ func (d *GobusterDir) PreRun(ctx context.Context) error {
}

if d.options.StatusCodesBlacklistParsed.Length() > 0 {
if !d.options.StatusCodesBlacklistParsed.Contains(*wildcardResp) && !d.options.WildcardForced {
if !d.options.StatusCodesBlacklistParsed.Contains(*wildcardResp) {
return &ErrWildcard{url: url, statusCode: *wildcardResp, length: wildcardLength}
}
} else if d.options.StatusCodesParsed.Length() > 0 {
if d.options.StatusCodesParsed.Contains(*wildcardResp) && !d.options.WildcardForced {
if d.options.StatusCodesParsed.Contains(*wildcardResp) {
return &ErrWildcard{url: url, statusCode: *wildcardResp, length: wildcardLength}
}
} else {
Expand Down
1 change: 0 additions & 1 deletion gobusterdir/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type OptionsDir struct {
StatusCodesBlacklist string
StatusCodesBlacklistParsed libgobuster.IntSet
UseSlash bool
WildcardForced bool
HideLength bool
Expanded bool
NoStatus bool
Expand Down
1 change: 0 additions & 1 deletion gobusterfuzz/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type OptionsFuzz struct {
libgobuster.HTTPOptions
ExcludedStatusCodes string
ExcludedStatusCodesParsed libgobuster.IntSet
WildcardForced bool
ExcludeLength []int
}

Expand Down
1 change: 0 additions & 1 deletion libgobuster/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type Options struct {
NoProgress bool
NoError bool
Quiet bool
WildcardForced bool
Verbose bool
Delay time.Duration
}
Expand Down

2 comments on commit a0b94ee

@EmreOvunc
Copy link

Choose a reason for hiding this comment

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

Hi,

When we get the following error, we will have to enter code or length manually, it is really bad for automation systems. Isn't there any other solution?

To continue please exclude the status code or the length

@lazenin
Copy link

@lazenin lazenin commented on a0b94ee Mar 3, 2022

Choose a reason for hiding this comment

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

how

Please sign in to comment.