Skip to content

Commit 10118b8

Browse files
committed
Fix issue when enumerating users with all modes
1 parent 0181ef6 commit 10118b8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/modules/smtp/userEnum.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,32 @@ func UserEnum(optionsInterface *interface{}, username string) bool {
8888
}
8989
}
9090
case "":
91+
92+
optionsCopy := *options
9193
options.connectionsPool <- smtpConnection
9294
// Execute the 3 enumeration methods
93-
options.all = true
95+
optionsCopy.all = true
9496
// RCPT request
9597
options.Log.Debug("No enumeration method specify. Executing enumeration with RCPT, VRFY and EXPN")
9698
options.Log.Debug("Enumerate with RCPT")
97-
options.Mode = "rcpt"
98-
newOptionsInterface := reflect.ValueOf(options).Interface()
99+
optionsCopy.Mode = "rcpt"
100+
newOptionsInterface := reflect.ValueOf(&optionsCopy).Interface()
99101
valid = UserEnum(&newOptionsInterface, username)
100102
if valid {
101103
return true
102104
}
103105
// VRFY
104106
options.Log.Debug("Enumerate with VRFY")
105-
options.Mode = "vrfy"
106-
newOptionsInterface = reflect.ValueOf(options).Interface()
107+
optionsCopy.Mode = "vrfy"
108+
newOptionsInterface = reflect.ValueOf(&optionsCopy).Interface()
107109
valid = UserEnum(&newOptionsInterface, username)
108110
if valid {
109111
return true
110112
}
111113
// EXPN
112114
options.Log.Debug("Enumerate with EXPN")
113-
options.Mode = "expn"
114-
newOptionsInterface = reflect.ValueOf(options).Interface()
115+
optionsCopy.Mode = "expn"
116+
newOptionsInterface = reflect.ValueOf(&optionsCopy).Interface()
115117
valid = UserEnum(&newOptionsInterface, username)
116118
return valid
117119
default:

0 commit comments

Comments
 (0)