mirror of https://github.com/MISP/misp-modules
commit
6c0e905737
|
@ -53,6 +53,7 @@ for module in os.listdir(modulesdir):
|
||||||
mhandlers[modulename] = importlib.import_module('modules.expansion.' + modulename)
|
mhandlers[modulename] = importlib.import_module('modules.expansion.' + modulename)
|
||||||
mhandlers['type:' + modulename] = moduletype
|
mhandlers['type:' + modulename] = moduletype
|
||||||
|
|
||||||
|
|
||||||
class ListModules(tornado.web.RequestHandler):
|
class ListModules(tornado.web.RequestHandler):
|
||||||
def get(self):
|
def get(self):
|
||||||
ret = []
|
ret = []
|
||||||
|
@ -66,6 +67,7 @@ class ListModules(tornado.web.RequestHandler):
|
||||||
log.debug('MISP ListModules request')
|
log.debug('MISP ListModules request')
|
||||||
self.write(json.dumps(ret))
|
self.write(json.dumps(ret))
|
||||||
|
|
||||||
|
|
||||||
class QueryModule(tornado.web.RequestHandler):
|
class QueryModule(tornado.web.RequestHandler):
|
||||||
def post(self):
|
def post(self):
|
||||||
jsonpayload = self.request.body.decode('utf-8')
|
jsonpayload = self.request.body.decode('utf-8')
|
||||||
|
|
|
@ -4,6 +4,7 @@ import dns.resolver
|
||||||
mispattributes = {'input': ['hostname', 'domain'], 'output': ['ip-src', 'ip-dst']}
|
mispattributes = {'input': ['hostname', 'domain'], 'output': ['ip-src', 'ip-dst']}
|
||||||
moduleinfo = "0.1"
|
moduleinfo = "0.1"
|
||||||
|
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
if q is False:
|
if q is False:
|
||||||
return False
|
return False
|
||||||
|
@ -25,8 +26,10 @@ def handler(q=False):
|
||||||
r = {'results': [{'types': mispattributes['output'], 'values':[str(answer[0])]}]}
|
r = {'results': [{'types': mispattributes['output'], 'values':[str(answer[0])]}]}
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def introspection():
|
|
||||||
|
|
||||||
|
def introspection():
|
||||||
return mispattributes
|
return mispattributes
|
||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
return moduleinfo
|
return moduleinfo
|
||||||
|
|
Loading…
Reference in New Issue