Merge pull request #589 from amuehlem/master

added ip-dst|port and ip-src|port to request
pull/633/head
Alexandre Dulaunoy 2022-10-21 23:22:43 +02:00 committed by GitHub
commit 1c963d3482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst', 'domain|ip'], 'output': ['hostname']}
# possible module-types: 'expansion', 'hover' or both
moduleinfo = {'version': '0.1', 'author': 'Andreas Muehlemann',
moduleinfo = {'version': '0.2', 'author': 'Andreas Muehlemann',
'description': 'Simple Reverse DNS expansion service to resolve reverse DNS from MISP attributes',
'module-type': ['expansion', 'hover']}
@ -23,6 +23,10 @@ def handler(q=False):
toquery = request['ip-src']
elif request.get('domain|ip'):
toquery = request['domain|ip'].split('|')[1]
elif request.get('ip-src|port'):
toquery = request['ip-src|port'].split('|')[0]
elif request.get('ip-dst|port'):
toquery = request['ip-dst|port'].split('|')[0]
else:
return False