Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ group :test do
# stub and set expectations on HTTP requests
gem 'webmock', '~> 3.18'
end

gem 'windows_error', git: 'https://github.com/zeroSteiner/windows_error', branch: 'feat/win32-hresults'
9 changes: 8 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ GIT
with_env (= 1.1.0)
xml-simple (~> 1.1.9)

GIT
remote: https://github.com/zeroSteiner/windows_error
revision: 214a57467d90d364dca2adafaad6f2ada7be52b6
branch: feat/win32-hresults
specs:
windows_error (0.1.6)

PATH
remote: .
specs:
Expand Down Expand Up @@ -682,7 +689,6 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
win32api (0.1.0)
windows_error (0.1.5)
winrm (2.3.9)
builder (>= 2.1.2)
erubi (~> 1.8)
Expand Down Expand Up @@ -727,6 +733,7 @@ DEPENDENCIES
test-prof
timecop
webmock (~> 3.18)
windows_error!
yard

BUNDLED WITH
Expand Down
8 changes: 7 additions & 1 deletion lib/msf/core/exploit/remote/ms_icpr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ def do_request_cert(icpr, opts, csr, attributes)
when ::WindowsError::HResult::CERTSRV_E_UNSUPPORTED_CERT_TYPE
raise MsIcprNotFoundError.new(hresult.description)
else
raise MsIcprUnknownError.new(hresult.description)
if response[:disposition]
message = "Unknown HRESULT 0x#{response[:disposition].to_s(16).rjust(8, '0')}"
else
message = "Unknown error, no disposition code"
end

raise MsIcprUnknownError.new(message)
end
end

Expand Down
Loading