-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#212 WIP update PE and add PDFiD submodule
- Loading branch information
1 parent
decd7d8
commit 2ab6ec9
Showing
6 changed files
with
124 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
cortexutils | ||
python-magic | ||
ssdeep | ||
git+https://github.com/AnyMaster/pehashng | ||
git+https://github.com/Rafiot/pdfid.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
from .submodule_metadata import MetadataSubmodule | ||
from .submodule_gzip import GZIPSubmodule | ||
from .submodule_pe import PESubmodule | ||
# from .submodule_metadata import MetadataSubmodule | ||
# from .submodule_gzip import GZIPSubmodule | ||
# from .submodule_pe import PESubmodule | ||
|
||
from .submodule_metadata import * | ||
from .submodule_gzip import * | ||
from .submodule_pe import * | ||
from .submodule_pdfid import * | ||
|
||
|
||
AVAILABLE_SUBMODULES = [MetadataSubmodule(), | ||
GZIPSubmodule(), | ||
PESubmodule(), | ||
PDFIDSubmodule()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from pdfid.pdfid import * | ||
import optparse | ||
import json | ||
|
||
from .submodule_base import SubmoduleBaseclass | ||
|
||
class PDFIDSubmodule(SubmoduleBaseclass): | ||
def __init__(self): | ||
SubmoduleBaseclass.__init__(self) | ||
self.name = 'PDF Information' | ||
|
||
def check_file(self, **kwargs): | ||
""" | ||
PE submodule will analyze every PE like EXE, DLL or DRIVER, therefore it will always return true. | ||
:return: True | ||
""" | ||
if kwargs.get('filetype') in ['PDF']: | ||
return True | ||
|
||
def pdfid_cmd(self, path): | ||
try: | ||
j = json.loads( | ||
PDFiD2JSON(PDFiD(path, allNames=True, extraData=True, disarm=True, force=True), force=True)) | ||
print(j) | ||
except Exception as e: | ||
print(e) | ||
|
||
def analyze_file(self, path): | ||
self.add_result_subsection('pdfid', self.pdfid_cmd(path)) | ||
return self.results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters