File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
lib/metasploit/framework/login_scanner Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,30 @@ def self.login_status_for_kerberos_error(krb_err)
7878 case error_code
7979 when Rex ::Proto ::Kerberos ::Model ::Error ::ErrorCodes ::KDC_ERR_KEY_EXPIRED , Rex ::Proto ::Kerberos ::Model ::Error ::ErrorCodes ::KRB_AP_ERR_SKEW
8080 # Correct password, but either password needs resetting or clock is skewed
81- Metasploit ::Model ::Login ::Status ::SUCCESSFUL
81+ begin
82+ pa_data_entry = krb_err . res . e_data_as_pa_data . find do |pa_data |
83+ pa_data . type == Rex ::Proto ::Kerberos ::Model ::PreAuthType ::PA_PW_SALT
84+ end
85+
86+ if pa_data_entry
87+ pw_salt = pa_data_entry . decoded_value
88+ if pw_salt . nt_status
89+ case pw_salt . nt_status . value
90+ when ::WindowsError ::NTStatus ::STATUS_PASSWORD_EXPIRED
91+ # Windows Server 2019 Build 17763 (possibly others) replies with STATUS_PASSWORD_EXPIRED even when the password is incorrect
92+ Metasploit ::Model ::Login ::Status ::INCORRECT
93+ else
94+ Metasploit ::Model ::Login ::Status ::SUCCESSFUL
95+ end
96+ else
97+ Metasploit ::Model ::Login ::Status ::SUCCESSFUL
98+ end
99+ else
100+ Metasploit ::Model ::Login ::Status ::SUCCESSFUL
101+ end
102+ rescue Rex ::Proto ::Kerberos ::Model ::Error ::KerberosDecodingError
103+ Metasploit ::Model ::Login ::Status ::SUCCESSFUL
104+ end
82105 when Rex ::Proto ::Kerberos ::Model ::Error ::ErrorCodes ::KDC_ERR_C_PRINCIPAL_UNKNOWN
83106 # The username doesn't exist
84107 Metasploit ::Model ::Login ::Status ::INVALID_PUBLIC_PART
You can’t perform that action at this time.
0 commit comments