Remove responsibility for Attack methods to declare no attack success as an error

This commit is contained in:
Brendan Le Glaunec
2018-03-12 14:15:07 +01:00
parent 20daf73371
commit 08fcfcdac8
2 changed files with 20 additions and 38 deletions
-10
View File
@@ -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
}