From b77aed1c56f32807481dc5bd31e70a4eba08551d Mon Sep 17 00:00:00 2001 From: Meatballs Date: Mon, 16 Feb 2015 15:08:09 +0000 Subject: [PATCH] UPN is optional, should use sAMAccountName --- modules/post/windows/gather/enum_ad_users.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/post/windows/gather/enum_ad_users.rb b/modules/post/windows/gather/enum_ad_users.rb index 476b6e8129..9075a60fba 100644 --- a/modules/post/windows/gather/enum_ad_users.rb +++ b/modules/post/windows/gather/enum_ad_users.rb @@ -12,8 +12,8 @@ class Metasploit3 < Msf::Post include Msf::Post::Windows::Accounts UAC_DISABLED = 0x02 - USER_FIELDS = ['userPrincipalName', - 'sAMAccountName', + USER_FIELDS = ['sAMAccountName', + 'userPrincipalName', 'userAccountControl', 'lockoutTime', 'mail', @@ -113,7 +113,7 @@ class Metasploit3 < Msf::Post end end - username = result[USER_FIELDS.index('userPrincipalName')][:value] + username = result[USER_FIELDS.index('sAMAccountName')][:value] uac = result[USER_FIELDS.index('userAccountControl')][:value] lockout_time = result[USER_FIELDS.index('lockoutTime')][:value] store_username(username, uac, lockout_time, domain, domain_ip)