From 10118b8cb3f15095290a5ab0dd7cc6470258708f Mon Sep 17 00:00:00 2001 From: nodauf Date: Sat, 5 Feb 2022 13:19:34 +0400 Subject: [PATCH] Fix issue when enumerating users with all modes --- src/modules/smtp/userEnum.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/smtp/userEnum.go b/src/modules/smtp/userEnum.go index d0eccda..e26dd4d 100644 --- a/src/modules/smtp/userEnum.go +++ b/src/modules/smtp/userEnum.go @@ -88,30 +88,32 @@ func UserEnum(optionsInterface *interface{}, username string) bool { } } case "": + + optionsCopy := *options options.connectionsPool <- smtpConnection // Execute the 3 enumeration methods - options.all = true + optionsCopy.all = true // RCPT request options.Log.Debug("No enumeration method specify. Executing enumeration with RCPT, VRFY and EXPN") options.Log.Debug("Enumerate with RCPT") - options.Mode = "rcpt" - newOptionsInterface := reflect.ValueOf(options).Interface() + optionsCopy.Mode = "rcpt" + newOptionsInterface := reflect.ValueOf(&optionsCopy).Interface() valid = UserEnum(&newOptionsInterface, username) if valid { return true } // VRFY options.Log.Debug("Enumerate with VRFY") - options.Mode = "vrfy" - newOptionsInterface = reflect.ValueOf(options).Interface() + optionsCopy.Mode = "vrfy" + newOptionsInterface = reflect.ValueOf(&optionsCopy).Interface() valid = UserEnum(&newOptionsInterface, username) if valid { return true } // EXPN options.Log.Debug("Enumerate with EXPN") - options.Mode = "expn" - newOptionsInterface = reflect.ValueOf(options).Interface() + optionsCopy.Mode = "expn" + newOptionsInterface = reflect.ValueOf(&optionsCopy).Interface() valid = UserEnum(&newOptionsInterface, username) return valid default: