Land #9604, Fix logged errors when running without Python 3.6 / gmpy2
parent
a189673782
commit
178afdaed1
|
@ -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':
|
||||
|
|
|
@ -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']]
|
||||
|
|
Loading…
Reference in New Issue