Skip to content

Commit 68db0fa

Browse files
committed
Trivial update
1 parent 0d4f2f0 commit 68db0fa

2 files changed

Lines changed: 65 additions & 45 deletions

File tree

src/utils/menu.py

Lines changed: 64 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -673,57 +673,77 @@ def _(self, *args):
673673
# argv input errors
674674
settings.sys_argv_errors()
675675

676-
"""
677-
The "os_shell" available options.
678-
"""
676+
# Common interactive shell options.
677+
COMMON_OPTIONS = (
678+
(("?",), "show this help"),
679+
(("back",), "return to the previous menu"),
680+
(("quit", "exit"), "exit Commix (or press <Ctrl-C>)"),
681+
)
682+
683+
# OS shell specific options.
684+
OS_SHELL_OPTIONS = COMMON_OPTIONS + (
685+
(("reverse_tcp",), "configure a reverse TCP shell"),
686+
(("bind_tcp",), "configure a bind TCP shell"),
687+
)
688+
689+
# Reverse TCP shell specific options.
690+
REVERSE_TCP_OPTIONS = COMMON_OPTIONS + (
691+
(("set",), "set a context option"),
692+
(("os_shell",), "return to the OS shell"),
693+
(("bind_tcp",), "switch to the bind TCP shell"),
694+
)
695+
696+
# Bind TCP shell specific options.
697+
BIND_TCP_OPTIONS = COMMON_OPTIONS + (
698+
(("set",), "set a context option"),
699+
(("os_shell",), "return to the OS shell"),
700+
(("reverse_tcp",), "switch to the reverse TCP shell"),
701+
)
702+
703+
# Available smartphones HTTP User-Agent headers.
704+
MOBILE_USER_AGENTS = (
705+
("1", "BlackBerry Z10"),
706+
("2", "Samsung Galaxy S7"),
707+
("3", "HP iPAQ 6365"),
708+
("4", "HTC 10"),
709+
("5", "Huawei P8"),
710+
("6", "Apple iPhone 8"),
711+
("7", "Microsoft Lumia 950"),
712+
("8", "Google Nexus 7"),
713+
("9", "Nokia N97"),
714+
("10", "Google Pixel"),
715+
("11", "Xiaomi Mi 3"),
716+
)
717+
718+
719+
# Print available context options.
720+
def _print_options(context, options):
721+
...
722+
723+
724+
# Print available mobile user agents.
725+
def _print_mobile_user_agents():
726+
...
727+
728+
729+
# Display OS shell options.
679730
def os_shell_options():
680-
settings.print_data_to_stdout("""""" + Style.BRIGHT + """Available 'os_shell' options:""" + Style.RESET_ALL + """
681-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """?""" + Style.RESET_ALL + """' to get all the available options.
682-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """back""" + Style.RESET_ALL + """' to move back from the current context.
683-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """quit""" + Style.RESET_ALL + """' / '""" + Style.BRIGHT + """exit""" + Style.RESET_ALL + """' (or use <Ctrl-C>) to quit commix.
684-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """reverse_tcp""" + Style.RESET_ALL + """' to get a reverse TCP connection.
685-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """bind_tcp""" + Style.RESET_ALL + """' to set a bind TCP connection.""")
731+
_print_options("os_shell", OS_SHELL_OPTIONS)
686732

687-
"""
688-
The "reverse_tcp" available options.
689-
"""
733+
734+
# Display reverse TCP options.
690735
def reverse_tcp_options():
691-
settings.print_data_to_stdout("""""" + Style.BRIGHT + """Available 'reverse_tcp' options:""" + Style.RESET_ALL + """
692-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """?""" + Style.RESET_ALL + """' to get all the available options.
693-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """set""" + Style.RESET_ALL + """' to set a context-specific variable to a value.
694-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """back""" + Style.RESET_ALL + """' to move back from the current context.
695-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """quit""" + Style.RESET_ALL + """' / '""" + Style.BRIGHT + """exit""" + Style.RESET_ALL + """' (or use <Ctrl-C>) to quit commix.
696-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """os_shell""" + Style.RESET_ALL + """' to get into an operating system command shell.
697-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """bind_tcp""" + Style.RESET_ALL + """' to set a bind TCP connection.""")
736+
_print_options("reverse_tcp", REVERSE_TCP_OPTIONS)
698737

699-
"""
700-
The "bind_tcp" available options.
701-
"""
738+
739+
# Display bind TCP options.
702740
def bind_tcp_options():
703-
settings.print_data_to_stdout("""""" + Style.BRIGHT + """Available 'bind_tcp' options:""" + Style.RESET_ALL + """
704-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """?""" + Style.RESET_ALL + """' to get all the available options.
705-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """set""" + Style.RESET_ALL + """' to set a context-specific variable to a value.
706-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """back""" + Style.RESET_ALL + """' to move back from the current context.
707-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """quit""" + Style.RESET_ALL + """' / '""" + Style.BRIGHT + """exit""" + Style.RESET_ALL + """' (or use <Ctrl-C>) to quit commix.
708-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """os_shell""" + Style.RESET_ALL + """' to get into an operating system command shell.
709-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """reverse_tcp""" + Style.RESET_ALL + """' to get a reverse TCP connection.""")
741+
_print_options("bind_tcp", BIND_TCP_OPTIONS)
710742

711-
"""
712-
The available mobile user agents.
713-
"""
743+
744+
# Display mobile user agents.
714745
def mobile_user_agents():
715-
settings.print_data_to_stdout("""""" + Style.BRIGHT + """Available smartphones HTTP User-Agent headers:""" + Style.RESET_ALL + """
716-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """1""" + Style.RESET_ALL + """' for BlackBerry Z10.
717-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """2""" + Style.RESET_ALL + """' for Samsung Galaxy S7.
718-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """3""" + Style.RESET_ALL + """' for HP iPAQ 6365.
719-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """4""" + Style.RESET_ALL + """' for HTC 10.
720-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """5""" + Style.RESET_ALL + """' for Huawei P8.
721-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """6""" + Style.RESET_ALL + """' for Apple iPhone 8.
722-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """7""" + Style.RESET_ALL + """' for Microsoft Lumia 950.
723-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """8""" + Style.RESET_ALL + """' for Google Nexus 7.
724-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """9""" + Style.RESET_ALL + """' for Nokia N97.
725-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """10""" + Style.RESET_ALL + """' for Google Pixel".
726-
""" + settings.SUB_CONTENT_SIGN_TYPE + """Type '""" + Style.BRIGHT + """11""" + Style.RESET_ALL + """' for Xiaomi Mi 3.""")
746+
_print_mobile_user_agents()
727747

728748
"""
729749
The tab compliter (shell options).

src/utils/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def sys_argv_errors():
262262
DESCRIPTION = "The command injection exploiter"
263263
AUTHOR = "Anastasios Stasinopoulos"
264264
VERSION_NUM = "4.2"
265-
REVISION = "27"
265+
REVISION = "28"
266266
STABLE_RELEASE = False
267267
VERSION = "v"
268268
if STABLE_RELEASE:

0 commit comments

Comments
 (0)