Skip to content

Commit

Permalink
fix: [reversedns] add the ip attribute type
Browse files Browse the repository at this point in the history
  • Loading branch information
adulau committed Dec 17, 2024
1 parent f829c75 commit 9f1efde
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions misp_modules/modules/expansion/reversedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def handler(q=False):
toquery = request['ip-dst']
elif request.get('ip-src'):
toquery = request['ip-src']
elif request.get('ip'):
toquery = request['ip']
elif request.get('domain|ip'):
toquery = request['domain|ip'].split('|')[1]
else:
return False

# reverse lookup for ip
revname = reversename.from_address(toquery)

r = resolver.Resolver()
r.timeout = 2
r.lifetime = 2

if request.get('config'):
if request['config'].get('nameserver'):
nameservers = []
Expand All @@ -63,8 +63,7 @@ def handler(q=False):
misperrors['error'] = "DNS resolving error"
return misperrors

r = {'results': [{'types': mispattributes['output'],
'values':[str(answer[0])]}]}
r = {'results': [{'types': mispattributes['output'],'values':[str(answer[0])]}]}
return r


Expand Down

0 comments on commit 9f1efde

Please sign in to comment.