Remove responsibility for Attack methods to declare no attack success as an error
This commit is contained in:
@@ -166,16 +166,11 @@ func AttackCredentials(c Curler, targets []Stream, credentials Credentials, time
|
||||
attackResults = append(attackResults, <-attacks)
|
||||
}
|
||||
|
||||
found := 0
|
||||
for _, result := range attackResults {
|
||||
if result.CredentialsFound == true {
|
||||
targets = replace(targets, result)
|
||||
found++
|
||||
}
|
||||
}
|
||||
if found == 0 {
|
||||
return targets, errors.New("no credentials found")
|
||||
}
|
||||
|
||||
return targets, nil
|
||||
}
|
||||
@@ -201,16 +196,11 @@ func AttackRoute(c Curler, targets []Stream, routes Routes, timeout time.Duratio
|
||||
attackResults = append(attackResults, <-attacks)
|
||||
}
|
||||
|
||||
found := 0
|
||||
for _, result := range attackResults {
|
||||
if result.RouteFound == true {
|
||||
targets = replace(targets, result)
|
||||
found++
|
||||
}
|
||||
}
|
||||
if found == 0 {
|
||||
return targets, errors.New("no routes found")
|
||||
}
|
||||
|
||||
return targets, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user