diff --git a/modules/exploits/windows/fileformat/adobe_pdf_embedded_exe.rb b/modules/exploits/windows/fileformat/adobe_pdf_embedded_exe.rb index 5019a71703..97b43e79e9 100644 --- a/modules/exploits/windows/fileformat/adobe_pdf_embedded_exe.rb +++ b/modules/exploits/windows/fileformat/adobe_pdf_embedded_exe.rb @@ -79,10 +79,14 @@ class Metasploit3 < Msf::Exploit::Remote startxrefs = pdf_objects[2] root_obj = pdf_objects[3] - output = basic_social_engineering_exploit(xref_trailers,root_obj,stream,trailers,file_name,exe_name,startxrefs.last) + begin + output = basic_social_engineering_exploit(xref_trailers,root_obj,stream,trailers,file_name,exe_name,startxrefs.last) - print_status("Creating '#{datastore['FILENAME']}' file...") - file_create(output) + print_status("Creating '#{datastore['FILENAME']}' file...") + file_create(output) + rescue KeyError => e + print_error("Incompatible PDF structure: #{e.message}. Please try a different PDF.") + end end