Properly handle a no-payload-selected scenario
parent
08c6b94460
commit
3f58aff979
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue