Check template file extension name
parent
ee13195760
commit
04a701dba5
|
@ -265,6 +265,11 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
|
||||
def exploit
|
||||
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}")
|
||||
@docx = unpack_docx(template_path)
|
||||
|
||||
|
@ -277,7 +282,6 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
print_status("Finalizing docm: #{datastore['FILENAME']}")
|
||||
docm = pack_docm
|
||||
file_create(docm)
|
||||
super
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue