Skip to content

Commit

Permalink
read combos from stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
ropnop committed May 11, 2019
1 parent 9a23298 commit 2ba21ae
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cmd/bruteforce.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,23 @@ func bruteForceCombos(cmd *cobra.Command, args []string) {

var wg sync.WaitGroup
wg.Add(threads)
file, err := os.Open(combolist)
if err != nil {
logger.Log.Error(err.Error())
return

var scanner *bufio.Scanner
if combolist != "-" {
file, err := os.Open(combolist)
if err != nil {
logger.Log.Error(err.Error())
return
}
defer file.Close()
scanner = bufio.NewScanner(file)
} else {
scanner = bufio.NewScanner(os.Stdin)
}
defer file.Close()

for i := 0; i < threads; i++ {
go makeBruteComboWorker(ctx, combosChan, &wg)
}
scanner := bufio.NewScanner(file)

start := time.Now()

Expand Down

0 comments on commit 2ba21ae

Please sign in to comment.