Skip to content

Commit

Permalink
Fix issue when enumerating users with all modes
Browse files Browse the repository at this point in the history
  • Loading branch information
nodauf committed Feb 5, 2022
1 parent 0181ef6 commit 10118b8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/modules/smtp/userEnum.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 10118b8

Please sign in to comment.