diff --git a/lib/msf/core/modules/external/python/metasploit/module.py b/lib/msf/core/modules/external/python/metasploit/module.py index 56b6781b23..6470effe0e 100644 --- a/lib/msf/core/modules/external/python/metasploit/module.py +++ b/lib/msf/core/modules/external/python/metasploit/module.py @@ -29,7 +29,7 @@ def report_vuln(ip, name, **opts): def run(metadata, module_callback): - req = json.loads(os.read(0, 10000)) + req = json.loads(os.read(0, 10000).decode("utf-8")) if req['method'] == 'describe': rpc_send({'jsonrpc': '2.0', 'id': req['id'], 'response': metadata}) elif req['method'] == 'run': diff --git a/modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py b/modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py index 0dfa7558d9..4b5bab7f6b 100755 --- a/modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py +++ b/modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py @@ -9,9 +9,13 @@ import os import ssl # extra modules -import gmpy2 -from cryptography import x509 -from cryptography.hazmat.backends import default_backend +dependencies_missing = False +try: + import gmpy2 + from cryptography import x509 + from cryptography.hazmat.backends import default_backend +except ImportError: + dependencies_missing = True from metasploit import module @@ -151,6 +155,10 @@ def oracle(target, pms, cke_2nd_prefix, cipher_handshake=ch_def, messageflow=Fal def run(args): + if dependencies_missing: + module.log("Module dependencies (gmpy2 and cryptography python libraries) missing, cannot continue", level='error') + return + target = (args['rhost'], int(args['rport'])) timeout = float(args['timeout']) cipher_handshake = cipher_handshakes[args['cipher_group']]