Changed the output format to include all matching attribute types

- changed the output format to give us a bit more flexibility
  - return an array of results
  - return the valid misp attribute types for each result
pull/1/head
Iglocska 2016-02-17 23:43:53 +01:00
parent ad87f947a5
commit 5082a835d8
1 changed files with 3 additions and 4 deletions

7
modules/expansion/dns.py Normal file → Executable file
View File

@ -1,7 +1,7 @@
import json
import dns.resolver
mispattributes = ['hostname', 'domain']
mispattributes = {'input':['hostname', 'domain'], 'output':['ip-src', 'ip-dst']}
def handler(q=False):
if q is False:
@ -21,10 +21,9 @@ def handler(q=False):
return False
except dns.exception.Timeout:
return False
r = {}
r["ip-dst"] = str(answer[0])
r = {'results':[{'types':mispattributes['output'], 'values':[str(answer[0])]}]}
return r
def introspection():
return mispattributes
return mispattributes['input']