mirror of https://github.com/MISP/misp-modules
Merge pull request #649 from JakubOnderka/remove-deprecated
Resolve deprecation warningspull/650/head
commit
4e91d3fb4f
|
@ -27,7 +27,7 @@ def handler(q=False):
|
|||
btc = request['btc']
|
||||
query = f"{btc}.{url}"
|
||||
try:
|
||||
result = ' - '.join([str(r) for r in resolver.query(query, 'TXT')])[1:-1]
|
||||
result = ' - '.join([str(r) for r in resolver.resolve(query, 'TXT')])[1:-1]
|
||||
except NXDOMAIN:
|
||||
result = f"{btc} is not known as a scam address."
|
||||
except LabelTooLong:
|
||||
|
|
|
@ -50,7 +50,7 @@ def handler(q=False):
|
|||
return misperrors
|
||||
query = "{}.{}".format(requested_value, dbl)
|
||||
try:
|
||||
query_result = resolver.query(query, 'A')[0]
|
||||
query_result = resolver.resolve(query, 'A')[0]
|
||||
result = "{} - {}".format(requested_value, dbl_mapping[str(query_result)])
|
||||
except dns.resolver.NXDOMAIN as e:
|
||||
result = e.msg
|
||||
|
|
|
@ -36,7 +36,7 @@ def handler(q=False):
|
|||
r.nameservers = ['8.8.8.8']
|
||||
|
||||
try:
|
||||
answer = r.query(toquery, 'A')
|
||||
answer = r.resolve(toquery, 'A')
|
||||
except dns.resolver.NXDOMAIN:
|
||||
misperrors['error'] = "NXDOMAIN"
|
||||
return misperrors
|
||||
|
|
|
@ -27,7 +27,7 @@ def handler(q=False):
|
|||
q = json.loads(q)
|
||||
filename = q['attachment']
|
||||
try:
|
||||
img_array = np.fromstring(binascii.a2b_base64(q['data']), np.uint8)
|
||||
img_array = np.frombuffer(binascii.a2b_base64(q['data']), np.uint8)
|
||||
except Exception as e:
|
||||
err = "Couldn't fetch attachment (JSON 'data' is empty). Are you using the 'Query enrichment' action?"
|
||||
misperrors['error'] = err
|
||||
|
|
|
@ -42,7 +42,7 @@ def handler(q=False):
|
|||
r.nameservers = ['8.8.8.8']
|
||||
|
||||
try:
|
||||
answer = r.query(revname, 'PTR')
|
||||
answer = r.resolve(revname, 'PTR')
|
||||
except resolver.NXDOMAIN:
|
||||
misperrors['error'] = "NXDOMAIN"
|
||||
return misperrors
|
||||
|
|
|
@ -215,7 +215,7 @@ class TestExpansions(unittest.TestCase):
|
|||
self.assertEqual(self.get_values(response), 'totalmateria.net - spam test domain')
|
||||
except Exception:
|
||||
try:
|
||||
self.assertTrue(self.get_values(response).startswith('None of DNS query names exist:'))
|
||||
self.assertTrue(self.get_values(response).startswith('The DNS query name does not exist:'))
|
||||
except Exception:
|
||||
self.assertEqual(self.get_errors(response), 'Not able to reach dbl.spamhaus.org or something went wrong')
|
||||
|
||||
|
|
Loading…
Reference in New Issue