diff --git a/scripts/resource/autoexploit.rc b/scripts/resource/autoexploit.rc index 660468ce9e..624be86f2a 100644 --- a/scripts/resource/autoexploit.rc +++ b/scripts/resource/autoexploit.rc @@ -94,7 +94,7 @@ def select_payload(exploit) else # WTF? This exploit supports NONE of our favorite payloads? # What kinda BS is this? - return payload + return nil end end @@ -128,7 +128,12 @@ def auto_exploit(module_path) get_payload = select_payload(exploit) lhost = Rex::Socket.source_address('50.50.50.50') - print_status("Payload selected: #{get_payload} (lhost=#{lhost})") + + if get_payload.nil? + raise RuntimeError, "No payload selected for this exploit" + else + print_status("Payload selected: #{get_payload} (lhost=#{lhost})") + end framework.db.workspace.vulns.each do |vuln| next if not ref_has_match(vuln.refs, exploit_refs)