mirror of https://github.com/MISP/misp-modules
First module to test the freetext import functionality
parent
bb558c5a39
commit
69801a4fc3
|
@ -2,7 +2,7 @@ import json
|
||||||
import pypdns
|
import pypdns
|
||||||
|
|
||||||
misperrors = {'error' : 'Error'}
|
misperrors = {'error' : 'Error'}
|
||||||
mispattributes = {'input': ['hostname', 'domain','ip-src','ip-dst'], 'output': ['ip-src', 'ip-dst', 'hostname', 'domain']}
|
mispattributes = {'input': ['hostname', 'domain','ip-src','ip-dst'], 'output': ['freetext']}
|
||||||
moduleinfo = {'version': '0.1', 'author': 'Alexandre Dulaunoy', 'description': 'Module to access CIRCL Passive DNS', 'module-type': ['expansion','hover']}
|
moduleinfo = {'version': '0.1', 'author': 'Alexandre Dulaunoy', 'description': 'Module to access CIRCL Passive DNS', 'module-type': ['expansion','hover']}
|
||||||
moduleconfig = ['username', 'password']
|
moduleconfig = ['username', 'password']
|
||||||
|
|
||||||
|
@ -30,9 +30,10 @@ def handler(q=False):
|
||||||
|
|
||||||
x = pypdns.PyPDNS(basic_auth=(request['config']['username'], request['config']['password']))
|
x = pypdns.PyPDNS(basic_auth=(request['config']['username'], request['config']['password']))
|
||||||
res = x.query(toquery)
|
res = x.query(toquery)
|
||||||
out = []
|
out = ''
|
||||||
for v in res:
|
for v in res:
|
||||||
out.append("{} ".format(v['rdata']))
|
out = out + "{} ".format(v['rdata'])
|
||||||
|
|
||||||
r = {'results': [{'types': mispattributes['output'], 'values': out }]}
|
r = {'results': [{'types': mispattributes['output'], 'values': out }]}
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue