Land #11217, fix syntax and logic errors in badpdf module

GSoC/Meterpreter_Web_Console
Brent Cook 2019-01-10 12:52:08 -06:00
commit 86850e7062
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 2 additions and 2 deletions

View File

@ -39,14 +39,14 @@ class MetasploitModule < Msf::Auxiliary
end end
def run def run
if datastore['PDFINJECT'].to_s.end_with?('.pdf') && datastore['FILENAME'].to_s.end_with?('.pdf') if datastore['PDFINJECT'].nil? && datastore['FILENAME'].nil?
print_error 'Please configure either FILENAME or PDFINJECT' print_error 'Please configure either FILENAME or PDFINJECT'
elsif !datastore['PDFINJECT'].nil? && datastore['PDFINJECT'].to_s.end_with?('.pdf') elsif !datastore['PDFINJECT'].nil? && datastore['PDFINJECT'].to_s.end_with?('.pdf')
injectpdf injectpdf
elsif !datastore['FILENAME'].nil? && datastore['FILENAME'].to_s.end_with?('.pdf') elsif !datastore['FILENAME'].nil? && datastore['FILENAME'].to_s.end_with?('.pdf')
createpdf createpdf
else else
print_error 'FILENAME or PDFINJECT must end with '.pdf' file extension' print_error "FILENAME or PDFINJECT must end with '.pdf' file extension"
end end
end end