armbues / ioc_parser

Tool to extract indicators of compromise from security reports in PDF format
MIT License
428 stars 171 forks source link

Added a data storing output handler #15

Closed ttufts closed 9 years ago

ttufts commented 9 years ago

Allows data to be stored in a dict and retrieved with get_iocs().

iocp = IOC_Parser(args.patterns_file, output_format='data')

iocs = iocp.handler.get_iocs()

ttufts commented 9 years ago

Also fixing a minor coding issue in whitelist.py. Using 'with' instead of open automatically closes. Previously this wasn't closing whitelist files.

ttufts commented 9 years ago

Armin, do you not like the data output handler?

armbues commented 9 years ago

No need to add this to the core, the feature of specifying a custom output handler was exactly meant for what you're trying to do, but it only makes sense when used as a library. Now when someone uses IOC parser as a library they can specify their own handler in the source.