From 13022ca1ad5f6e57d87555cd0a31d0780f306e11 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 10 Jan 2019 12:52:08 -0600 Subject: [PATCH] Land #11217, fix syntax and logic errors in badpdf module --- modules/auxiliary/fileformat/badpdf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auxiliary/fileformat/badpdf.rb b/modules/auxiliary/fileformat/badpdf.rb index da877c66c8..89c8cbad4b 100644 --- a/modules/auxiliary/fileformat/badpdf.rb +++ b/modules/auxiliary/fileformat/badpdf.rb @@ -39,14 +39,14 @@ class MetasploitModule < Msf::Auxiliary end 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' elsif !datastore['PDFINJECT'].nil? && datastore['PDFINJECT'].to_s.end_with?('.pdf') injectpdf elsif !datastore['FILENAME'].nil? && datastore['FILENAME'].to_s.end_with?('.pdf') createpdf 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