2017-05-29 14:03:21 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-10-14 19:26:03 +02:00
|
|
|
from keys import misp_url, misp_key, misp_verifycert
|
2017-05-29 14:03:21 +02:00
|
|
|
import argparse
|
|
|
|
from pymisp import PyMISP
|
|
|
|
|
|
|
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
|
|
|
try:
|
|
|
|
input = raw_input
|
|
|
|
except NameError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def init(url, key):
|
2018-10-14 19:26:03 +02:00
|
|
|
return PyMISP(url, key, misp_verifycert, 'json', debug=False)
|
2017-05-29 14:03:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='Fetch all events from a feed.')
|
|
|
|
parser.add_argument("-f", "--feed", required=True, help="feed's ID to be fetched.")
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
misp = init(misp_url, misp_key)
|
|
|
|
misp.fetch_feed(args.feed)
|