Skip to content

Commit

Permalink
Merge branch 'main' into 16-feature-flag-to-include-data-when-http-me…
Browse files Browse the repository at this point in the history
…thod-post-for-posting-data
  • Loading branch information
pierrelissope authored Oct 1, 2024
2 parents b61c53c + 13acde2 commit 36667a8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bruteforce
bruteforce
default-wordlist.txt
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ re: fclean all
install_program:
echo "source $(pwd)/autocompletion/bash/_bruteforce" >> ~/.bashrc
echo "source $(pwd)/autocompletion/zsh/_bruteforce" >> ~/.zshrc
echo -n "Do you want to download a default wordlist ?? [y/N] " && read ans && if [ $${ans:-'N'} = 'y' ]; then curl https://raw.githubusercontent.com/drtychai/wordlists/master/dirbuster/directory-list-2.3-medium.txt > default-wordlist.txt; fi

.PHONY: all clean fclean re install_program
3 changes: 1 addition & 2 deletions src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ func ParseCliArgs() (models.ForcingParams, error) {
wordlistPtr := flag.String("wordlist", "", "Wordlist to bruteforce url with")
methodPtr := flag.String("method", "POST", "Method to bruteforce with")
postDataptr := flag.String("data", "", "JSON Data to inlude in body when bruteforcing")

flag.IntVar(&params.Workers, "threads", 1, "Number of threads to be used")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: bruteforce [options] --wordlist=[./path/to/wordlist] <url>\n")
fmt.Fprintf(os.Stderr, "Usage: bruteforce [options] <url>\n")
fmt.Fprintf(os.Stderr, "Options:\n")
flag.PrintDefaults()
}
Expand Down
2 changes: 0 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bruteforce/src/cli"
"bruteforce/src/query"
"fmt"
)

func main() {
Expand All @@ -13,7 +12,6 @@ func main() {
if err != nil {
panic(err)
}
fmt.Println(forcingParams)

query.MainRequest(&forcingParams)
}
5 changes: 3 additions & 2 deletions src/query/callWorker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ func MainRequest(params *models.ForcingParams) {
}

for i := 0; i < len(wordArray); i++ {
channel <- wordArray[i]
if len(wordArray[i]) > 0 && wordArray[i][0] != '#' {
channel <- wordArray[i]
}
}

close(channel)
wg.Wait()
}

0 comments on commit 36667a8

Please sign in to comment.