Check template file extension name

bug/bundler_fix
wchen-r7 2017-05-26 07:31:34 -05:00
parent ee13195760
commit 04a701dba5
1 changed files with 5 additions and 1 deletions

View File

@ -265,6 +265,11 @@ class MetasploitModule < Msf::Exploit::Remote
def exploit def exploit
template_path = get_template_path template_path = get_template_path
unless File.extname(template_path).match(/\.docx$/i)
fail_with(Failure::BadConfig, 'Template is not a docx file.')
end
print_status("Using template: #{template_path}") print_status("Using template: #{template_path}")
@docx = unpack_docx(template_path) @docx = unpack_docx(template_path)
@ -277,7 +282,6 @@ class MetasploitModule < Msf::Exploit::Remote
print_status("Finalizing docm: #{datastore['FILENAME']}") print_status("Finalizing docm: #{datastore['FILENAME']}")
docm = pack_docm docm = pack_docm
file_create(docm) file_create(docm)
super
end end
end end