First module to test the freetext import functionality

pull/7/head
Alexandre Dulaunoy 2016-03-25 13:52:10 +01:00
parent bb558c5a39
commit 69801a4fc3
1 changed files with 4 additions and 3 deletions

View File

@ -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