Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zerologon error handling to output invalid computer name details #16858

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.rb
Expand Up @@ -3,6 +3,8 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'windows_error'

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::DCERPC
Expand Down Expand Up @@ -33,7 +35,10 @@ def initialize(info = {})
'Dirk-jan Mollema' # password restoration technique
],
'Notes' => {
'AKA' => [ 'Zerologon' ]
'AKA' => ['Zerologon'],
'Stability' => [CRASH_SAFE],
'Reliability' => [],
'SideEffects' => [CONFIG_CHANGES, IOC_IN_LOGS]
},
'License' => MSF_LICENSE,
'Actions' => [
Expand Down Expand Up @@ -86,6 +91,12 @@ def check
response = netr_server_authenticate3

break if (status = response.error_status) == 0

windows_error = ::WindowsError::NTStatus.find_by_retval(response.error_status.to_i).first
# Try again if the Failure is STATUS_ACCESS_DENIED, otherwise something has gone wrong
next if windows_error == ::WindowsError::NTStatus::STATUS_ACCESS_DENIED

fail_with(Failure::UnexpectedReply, windows_error)
end

return CheckCode::Detected unless status == 0
Expand Down