diff --git a/cmd/bruteforce.go b/cmd/bruteforce.go index 89aa094..123fc45 100644 --- a/cmd/bruteforce.go +++ b/cmd/bruteforce.go @@ -6,6 +6,7 @@ import ( "sync" "sync/atomic" "time" + "math/rand/v2" "github.com/ropnop/kerbrute/util" "github.com/spf13/cobra" @@ -72,7 +73,7 @@ Scan: logger.Log.Debug("[!] Skipping: %q - %v", comboline, err.Error()) continue } - time.Sleep(time.Duration(delay) * time.Millisecond) + time.Sleep(time.Duration(delay + rand.IntN(jitter)) * time.Millisecond) combosChan <- [2]string{username, password} } } diff --git a/cmd/bruteuser.go b/cmd/bruteuser.go index ad7bb7e..18a9e48 100644 --- a/cmd/bruteuser.go +++ b/cmd/bruteuser.go @@ -6,6 +6,7 @@ import ( "sync" "sync/atomic" "time" + "math/rand/v2" "github.com/ropnop/kerbrute/util" @@ -72,7 +73,7 @@ Scan: break Scan default: password = scanner.Text() - time.Sleep(time.Duration(delay) * time.Millisecond) + time.Sleep(time.Duration(delay + rand.IntN(jitter)) * time.Millisecond) passwordsChan <- password } } diff --git a/cmd/kerbrute.go b/cmd/kerbrute.go index cc7683b..e24b13a 100644 --- a/cmd/kerbrute.go +++ b/cmd/kerbrute.go @@ -30,6 +30,7 @@ func init() { rootCmd.PersistentFlags().BoolVar(&safe, "safe", false, "Safe mode. Will abort if any user comes back as locked out. Default: FALSE") rootCmd.PersistentFlags().IntVarP(&threads, "threads", "t", 10, "Threads to use") rootCmd.PersistentFlags().IntVarP(&delay, "delay", "", 0, "Delay in millisecond between each attempt. Will always use single thread if set") + rootCmd.PersistentFlags().IntVarP(&jitter, "jitter", "", 1, "Delay jitter in millisecond between each attempt. Ignored if delay is not set") rootCmd.PersistentFlags().BoolVar(&downgrade, "downgrade", false, "Force downgraded encryption type (arcfour-hmac-md5)") rootCmd.PersistentFlags().StringVar(&hashFileName, "hash-file", "", "File to save AS-REP hashes to (if any captured), otherwise just logged") if delay != 0 { diff --git a/cmd/passwordspray.go b/cmd/passwordspray.go index b016abb..17afa45 100644 --- a/cmd/passwordspray.go +++ b/cmd/passwordspray.go @@ -6,6 +6,7 @@ import ( "sync" "sync/atomic" "time" + "math/rand/v2" "github.com/ropnop/kerbrute/util" @@ -88,7 +89,7 @@ Scan: logger.Log.Debugf("[!] %q - %v", usernameline, err.Error()) continue } - time.Sleep(time.Duration(delay) * time.Millisecond) + time.Sleep(time.Duration(delay + rand.IntN(jitter)) * time.Millisecond) usersChan <- username } } diff --git a/cmd/setup.go b/cmd/setup.go index 85c8f51..b4521cf 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -16,6 +16,7 @@ var ( verbose bool safe bool delay int + jitter int threads int stopOnSuccess bool userAsPass = false @@ -54,6 +55,6 @@ func setupSession(cmd *cobra.Command, args []string) { logger.Log.Infof("\t%s\n", v) } if delay != 0 { - logger.Log.Infof("Delay set. Using single thread and delaying %dms between attempts\n", delay) + logger.Log.Infof("Delay set. Using single thread and delaying %dms (%dms jitter) between attempts\n", delay, jitter) } } diff --git a/cmd/userenum.go b/cmd/userenum.go index ee6eb30..bdd5384 100644 --- a/cmd/userenum.go +++ b/cmd/userenum.go @@ -6,6 +6,7 @@ import ( "sync" "sync/atomic" "time" + "math/rand/v2" "github.com/ropnop/kerbrute/util" "github.com/spf13/cobra" @@ -66,7 +67,7 @@ Scan: logger.Log.Debugf("[!] %q - %v", usernameline, err.Error()) continue } - time.Sleep(time.Duration(delay) * time.Millisecond) + time.Sleep(time.Duration(delay + rand.IntN(jitter)) * time.Millisecond) usersChan <- username } }