def _pdf(self): """Process a PDF file.""" # LOG: processing_type property self.set_property('processing_type', 'pdf') xmlDoc = PDFiD(self.src_path) oPDFiD = cPDFiD(xmlDoc, True) # TODO: are there other characteristics which should be dangerous? if oPDFiD.encrypt.count > 0: self.make_dangerous('encrypted pdf') if oPDFiD.js.count > 0 or oPDFiD.javascript.count > 0: self.make_dangerous('pdf with javascript') if oPDFiD.aa.count > 0 or oPDFiD.openaction.count > 0: self.make_dangerous('openaction') if oPDFiD.richmedia.count > 0: self.make_dangerous('flash') if oPDFiD.launch.count > 0: self.make_dangerous('launch')
def _pdf(self): """Process a PDF file.""" xmlDoc = PDFiD(self.src_path) oPDFiD = cPDFiD(xmlDoc, True) if oPDFiD.encrypt.count > 0: self.make_dangerous('Encrypted pdf') if oPDFiD.js.count > 0 or oPDFiD.javascript.count > 0: self.make_dangerous('Pdf with embedded javascript') if oPDFiD.aa.count > 0 or oPDFiD.openaction.count > 0: self.make_dangerous('Pdf with openaction(s)') if oPDFiD.richmedia.count > 0: self.make_dangerous('Pdf containing flash') if oPDFiD.launch.count > 0: self.make_dangerous('Pdf with launch action(s)') if oPDFiD.xfa.count > 0: self.make_dangerous('Pdf with XFA structures') if oPDFiD.objstm.count > 0: self.make_dangerous('Pdf with ObjectStream structures') if not self.is_dangerous: self.add_description('Pdf file')
def _pdf(self): """Process a PDF file.""" xmlDoc = PDFiD(self.src_path) oPDFiD = cPDFiD(xmlDoc, True) if oPDFiD.encrypt.count > 0: self.make_dangerous('Encrypted pdf') if oPDFiD.js.count > 0 or oPDFiD.javascript.count > 0: self.make_dangerous('Pdf with embedded javascript') if oPDFiD.aa.count > 0 or oPDFiD.openaction.count > 0: self.make_dangerous('Pdf with openaction(s)') if oPDFiD.richmedia.count > 0: self.make_dangerous('Pdf containing flash') if oPDFiD.launch.count > 0: self.make_dangerous('Pdf with launch action(s)') if oPDFiD.xfa.count > 0: self.make_dangerous('Pdf with XFA structures') if oPDFiD.objstm.count > 0: self.make_dangerous('Pdf with ObjectStream structures') if not self.is_dangerous: self.add_description('Pdf file')
def _pdf(self): """Way to process PDF file""" self.cur_file.add_log_details("processing_type", "pdf") xmlDoc = PDFiD(self.cur_file.src_path) oPDFiD = cPDFiD(xmlDoc, True) # TODO: other keywords? if oPDFiD.encrypt > 0: self.cur_file.add_log_details("encrypted", True) self.cur_file.make_dangerous() if oPDFiD.js > 0 or oPDFiD.javascript > 0: self.cur_file.add_log_details("javascript", True) self.cur_file.make_dangerous() if oPDFiD.aa > 0 or oPDFiD.openaction > 0: self.cur_file.add_log_details("openaction", True) self.cur_file.make_dangerous() if oPDFiD.richmedia > 0: self.cur_file.add_log_details("flash", True) self.cur_file.make_dangerous() if oPDFiD.launch > 0: self.cur_file.add_log_details("launch", True) self.cur_file.make_dangerous()
def _pdf(self): """Processes a PDF file.""" self.cur_file.add_log_details('processing_type', 'pdf') xmlDoc = PDFiD(self.cur_file.src_path) oPDFiD = cPDFiD(xmlDoc, True) # TODO: other keywords? if oPDFiD.encrypt.count > 0: self.cur_file.add_log_details('encrypted', True) self.cur_file.make_dangerous() if oPDFiD.js.count > 0 or oPDFiD.javascript.count > 0: self.cur_file.add_log_details('javascript', True) self.cur_file.make_dangerous() if oPDFiD.aa.count > 0 or oPDFiD.openaction.count > 0: self.cur_file.add_log_details('openaction', True) self.cur_file.make_dangerous() if oPDFiD.richmedia.count > 0: self.cur_file.add_log_details('flash', True) self.cur_file.make_dangerous() if oPDFiD.launch.count > 0: self.cur_file.add_log_details('launch', True) self.cur_file.make_dangerous()
def _pdf(self): '''Way to process PDF file''' self.cur_file.add_log_details('processing_type', 'pdf') xmlDoc = PDFiD(self.cur_file.src_path) oPDFiD = cPDFiD(xmlDoc, True) # TODO: other keywords? if oPDFiD.encrypt > 0: self.cur_file.add_log_details('encrypted', True) self.cur_file.make_dangerous() if oPDFiD.js > 0 or oPDFiD.javascript > 0: self.cur_file.add_log_details('javascript', True) self.cur_file.make_dangerous() if oPDFiD.aa > 0 or oPDFiD.openaction > 0: self.cur_file.add_log_details('openaction', True) self.cur_file.make_dangerous() if oPDFiD.richmedia > 0: self.cur_file.add_log_details('flash', True) self.cur_file.make_dangerous() if oPDFiD.launch > 0: self.cur_file.add_log_details('launch', True) self.cur_file.make_dangerous()