Skip to content

Commit

Permalink
Merge branch 'main' of github.com:MISP/misp-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisr3d committed Dec 18, 2024
2 parents 6d29742 + 9f1efde commit 9c83fa1
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 9c83fa1

Please sign in to comment.