mirror of https://github.com/MISP/misp-modules
Update to the DNS module to support domain|ip
parent
c3a3d68e43
commit
6116c017c1
|
@ -2,8 +2,8 @@ import json
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'input': ['hostname', 'domain'], 'output': ['ip-src',
|
mispattributes = {'input': ['hostname', 'domain', 'domain|ip'], 'output': ['ip-src',
|
||||||
'ip-dst']}
|
'ip-dst']}
|
||||||
moduleinfo = {'version': '0.2', 'author': 'Alexandre Dulaunoy',
|
moduleinfo = {'version': '0.2', 'author': 'Alexandre Dulaunoy',
|
||||||
'description': 'Simple DNS expansion service to resolve IP address from MISP attributes',
|
'description': 'Simple DNS expansion service to resolve IP address from MISP attributes',
|
||||||
'module-type': ['expansion', 'hover']}
|
'module-type': ['expansion', 'hover']}
|
||||||
|
@ -19,6 +19,8 @@ def handler(q=False):
|
||||||
toquery = request['hostname']
|
toquery = request['hostname']
|
||||||
elif request.get('domain'):
|
elif request.get('domain'):
|
||||||
toquery = request['domain']
|
toquery = request['domain']
|
||||||
|
elif request.get('domain|ip'):
|
||||||
|
toquery = request['domain|ip'].split('|')[0]
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
r = dns.resolver.Resolver()
|
r = dns.resolver.Resolver()
|
||||||
|
|
Loading…
Reference in New Issue