mirror of https://github.com/MISP/misp-modules
fix: Updated rbl module result format
- More readable as str than dumped jsonpull/266/head
parent
547985b8ce
commit
627420ca43
|
@ -89,19 +89,17 @@ def handler(q=False):
|
||||||
return misperrors
|
return misperrors
|
||||||
listed = []
|
listed = []
|
||||||
info = []
|
info = []
|
||||||
for rbl in rbls:
|
|
||||||
ipRev = '.'.join(ip.split('.')[::-1])
|
ipRev = '.'.join(ip.split('.')[::-1])
|
||||||
|
for rbl in rbls:
|
||||||
query = '{}.{}'.format(ipRev, rbl)
|
query = '{}.{}'.format(ipRev, rbl)
|
||||||
try:
|
try:
|
||||||
txt = resolver.query(query,'TXT')
|
txt = resolver.query(query,'TXT')
|
||||||
listed.append(query)
|
listed.append(query)
|
||||||
info.append(str(txt[0]))
|
info.append([str(t) for t in txt])
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
result = {}
|
result = "\n".join(["{}: {}".format(l, " - ".join(i)) for l, i in zip(listed, info)])
|
||||||
for l, i in zip(listed, info):
|
return {'results': [{'types': mispattributes.get('output'), 'values': result}]}
|
||||||
result[l] = i
|
|
||||||
return {'results': [{'types': mispattributes.get('output'), 'values': json.dumps(result)}]}
|
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
return mispattributes
|
return mispattributes
|
||||||
|
|
Loading…
Reference in New Issue