Skip to content

Commit

Permalink
fix: fixed verbose option added clearer help
Browse files Browse the repository at this point in the history
  • Loading branch information
SIMLUKE committed Aug 14, 2024
1 parent 9ddafb7 commit bf1711d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ func Parse_cli_args() (models.Forcing_params, error) {
ThreadsError := errors.New("Wrong number of threads given")
WordListError := errors.New("No wordlist given")

// forkptr := flag.Bool("v", false, "Verbose program")
forkptr := flag.Bool("v", false, "Verbose program")
statusPtr := flag.String("status-codes", "200,401,403,404,429,500", "Comma-separated list of status codes to match")
headerPtr := flag.String("header", "", "Header to match, formatted as \"key: value\"")
bodyPtr := flag.String("body", "", "String to match in response body")
wordlistPtr := flag.String("wordlist", "", "Wordlist to bruteforce url with")
flag.IntVar(&params.Workers, "threads", 1, "Number of threads to be used")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: bruteforce [options] <url>\n")
fmt.Fprintf(os.Stderr, "Usage: bruteforce [options] --wordlist=[./path/to/wordlist] <url>\n")
fmt.Fprintf(os.Stderr, "Options:\n")
flag.PrintDefaults()
}

flag.Parse()

if params.Workers < 1 {
return params, ThreadsError
}
fmt.Print(flag.Args())
if len(flag.Args()) < 1 {
return params, UrlError
}

params.Url = flag.Args()[0]
// params.BoolFlags.Verbose = *forkptr
params.Criteria = matcher.MatchParser(*statusPtr, *headerPtr, *bodyPtr)
params.BoolFlags.Verbose = *forkptr
params.Wordlist = *wordlistPtr
params.Criteria = matcher.MatchParser(*statusPtr, *headerPtr, *bodyPtr)

if params.Workers < 1 {
return params, ThreadsError
}
if params.Wordlist == "" {
return params, WordListError
}
Expand Down
2 changes: 1 addition & 1 deletion src/query/callWorker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func executeQueryFromFile(wg *sync.WaitGroup, params *models.Forcing_params, currentPath chan string) {
defer wg.Done()
for taskData := range currentPath {
QueryExecute(params, taskData, "POST")
QueryExecute(params, taskData, "GET")
}
}

Expand Down

0 comments on commit bf1711d

Please sign in to comment.