InQuest / iocextract

Defanged Indicator of Compromise (IOC) Extractor.
https://inquest.readthedocs.io/projects/iocextract/
GNU General Public License v2.0
505 stars 91 forks source link

Enable to output in JSON format #33

Closed ninoseki closed 4 years ago

ninoseki commented 5 years ago

Outputting results in JSON format would be helpful when:

This PR will add --json option to output results in JSON format.

$ echo "1.1.1.1 8.8.8.8" | iocextract
1.1.1.1
8.8.8.8

$ echo "1.1.1.1 8.8.8.8" | iocextract --json
{
    "emails": [],
    "hashes": [],
    "ipv4s": [
        "1.1.1.1",
        "8.8.8.8"
    ],
    "ipv6s": [],
    "urls": [],
    "yara_rules": []
}
ninoseki commented 4 years ago

@cmmorrow I'm not sure the status of this PR. What should I do next?

cmmorrow commented 4 years ago

One of the tests is failing. We should rerun the tests to make sure it isn't repeatable. If the fail goes away, I can merge. Otherwise, we need to find the bug causing the fail and fix it before moving forward.

ninoseki commented 4 years ago

@cmmorrow it looks like there was an issue in TravisCI. https://travis-ci.org/github/InQuest/python-iocextract/jobs/567822232 The tests in Python 3.3 failed because the default TravisCI build env for Python doesn't support Python 3.3 now. (ref. https://github.com/travis-ci/travis-ci/issues/9133#issuecomment-506303002)

Should we support Python 3.3? Then we need a hack to use Python 3.3 in TravsiCI.

ninoseki commented 4 years ago

Oops, Python 3.3 has reached EOL. https://www.python.org/dev/peps/pep-0398/#x-end-of-life So dropping Python 3.3. is a good move IMO.

cmmorrow commented 4 years ago

Hello @ninoseki, I merged the PR with the py3.3 test removed. Please merge master to make sure the tests pass.

ninoseki commented 4 years ago

@cmmorrow passed. :D https://travis-ci.org/github/InQuest/python-iocextract/builds/689651244