Add tag script

pull/21/head
Raphaël Vinot 2016-06-13 19:15:04 +09:00
parent 1da7660934
commit 234de2f4d1
2 changed files with 30 additions and 0 deletions

0
examples/sighting.py Normal file → Executable file
View File

30
examples/tags.py Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import misp_url, misp_key
import argparse
import json
# Usage for pipe masters: ./last.py -l 5h | jq .
def init(url, key):
return PyMISP(url, key, True, 'json', True)
def get_tags(m):
result = m.get_all_tags(True)
r = result
print(json.dumps(r) + '\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Get tags from MISP instance.')
args = parser.parse_args()
misp = init(misp_url, misp_key)
get_tags(misp)