Raise Msf::NoCompatiblePayloadError if generate_payload_exe fails

Most exploits don't check nil for generate_payload_exe, they just
assume they will always have a payload. If the method returns nil,
it ends up making debugging more difficult. Instead of checking nil
one by one, we just raise.
This commit is contained in:
wchen-r7
2015-12-08 21:13:23 -06:00
parent 5b27d3a99c
commit 11c1eb6c78
16 changed files with 33 additions and 87 deletions
@@ -138,13 +138,8 @@ class Metasploit3 < Msf::Exploit::Remote
# NOTE: The EXE mixin automagically handles detection of arch/platform
data = generate_payload_exe
if data
print_status("Generated executable to drop (#{data.length} bytes)." )
data = Rex::Text.to_hex( data, prefix="" )
else
print_error("Failed to generate the executable." )
return
end
print_status("Generated executable to drop (#{data.length} bytes)." )
data = Rex::Text.to_hex( data, prefix="" )
end