mirror of https://github.com/MISP/misp-modules
commit
79a0b9e667
|
@ -1,7 +1,5 @@
|
||||||
language: python
|
language: python
|
||||||
|
|
||||||
cache: pip
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- redis-server
|
- redis-server
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ pyeupi
|
||||||
ipasn-redis
|
ipasn-redis
|
||||||
asnhistory
|
asnhistory
|
||||||
git+https://github.com/Rafiot/uwhoisd.git@testing#egg=uwhois&subdirectory=client
|
git+https://github.com/Rafiot/uwhoisd.git@testing#egg=uwhois&subdirectory=client
|
||||||
|
git+https://github.com/MISP/MISP-STIX-Converter.git#egg=misp_stix_converter
|
||||||
|
git+https://github.com/CIRCL/PyMISP.git#egg=pymisp
|
||||||
pillow
|
pillow
|
||||||
pytesseract
|
pytesseract
|
||||||
SPARQLWrapper
|
SPARQLWrapper
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import re
|
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
|
||||||
import tempfile
|
|
||||||
import os
|
|
||||||
|
|
||||||
from pymisp.tools import stix
|
from pymisp.tools import stix
|
||||||
|
|
||||||
|
@ -36,16 +32,11 @@ def handler(q=False):
|
||||||
if not package:
|
if not package:
|
||||||
return json.dumps({"success": 0})
|
return json.dumps({"success": 0})
|
||||||
|
|
||||||
tfile = tempfile.NamedTemporaryFile(mode="w", prefix="STIX", delete=False)
|
pkg = stix.load_stix(package)
|
||||||
tfile.write(package)
|
|
||||||
tfile.close()
|
|
||||||
|
|
||||||
pkg = stix.load_stix(tfile.name)
|
|
||||||
|
|
||||||
for attrib in pkg.attributes:
|
for attrib in pkg.attributes:
|
||||||
r["results"].append({ "values" : [attrib.value] , "types": [attrib.type], "categories": [attrib.category]})
|
r["results"].append({ "values" : [attrib.value] , "types": [attrib.type], "categories": [attrib.category]})
|
||||||
|
|
||||||
os.unlink(tfile.name)
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
|
|
Loading…
Reference in New Issue