Add scan interval option (#245)

* Add scan interval option

* Update tests for scan interval

* Handle missing target properly

* Update documentation to reflect that durations are not in milliseconds
This commit is contained in:
Brendan Le Glaunec
2019-11-11 21:42:38 +01:00
committed by GitHub
parent cb47aef7e4
commit 4aabf47a5d
7 changed files with 50 additions and 22 deletions
+14 -4
View File
@@ -25,7 +25,8 @@ type Scanner struct {
ports []string
debug bool
verbose bool
speed int
scanSpeed int
attackInterval time.Duration
timeout time.Duration
credentialDictionaryPath string
routeDictionaryPath string
@@ -134,11 +135,20 @@ func WithCustomRoutes(dictionaryPath string) func(s *Scanner) {
}
}
// WithSpeed specifies the speed at which the scan should be executed. Faster
// WithScanSpeed specifies the speed at which the scan should be executed. Faster
// means easier to detect, slower has bigger timeout values and is more silent.
func WithSpeed(speed int) func(s *Scanner) {
func WithScanSpeed(speed int) func(s *Scanner) {
return func(s *Scanner) {
s.speed = speed
s.scanSpeed = speed
}
}
// WithAttackInterval specifies the interval of time during which Cameradar
// should wait between each attack attempt during bruteforcing.
// Setting a high value for this obviously makes attacks much slower.
func WithAttackInterval(interval time.Duration) func(s *Scanner) {
return func(s *Scanner) {
s.attackInterval = interval
}
}