Land #11699, fix Failure scoping for psexec

4.x
Brent Cook 2019-04-08 10:29:02 -05:00 committed by Metasploit
parent f1946b080b
commit fc8bbc2e36
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
2 changed files with 2 additions and 2 deletions

View File

@ -265,7 +265,7 @@ module Exploit::Remote::SMB::Client::Psexec
begin
psexec(command)
rescue StandardError => exec_command_error
fail_with(Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
fail_with(Msf::Exploit::Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
end
end

View File

@ -607,7 +607,7 @@ class Msftidy
end
if ln =~ /^\s*fail_with\(/
unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
unless ln =~ /^\s*fail_with\(.*Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
end
end