Skip to content

Commit

Permalink
Added new option --time-limit for running with a time limit in seco…
Browse files Browse the repository at this point in the history
…nds (e.g. 3600)
  • Loading branch information
stasinopoulos committed Feb 5, 2024
1 parent bb2f35f commit e258151
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 4.0 (TBA)
* Added: New option `--time-limit` for running with a time limit in seconds (e.g. 3600).

## Version 3.9 (2024-01-19)
* Fixed: Multiple bug-fixes regarding several reported unhandled exceptions.
* Revised: Minor improvement regarding logging user-supplied command(s) (i.e. `--os-cmd` option) to a file.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='commix',
version='3.9-stable',
version='4.0-dev',
description='Automated All-in-One OS Command Injection Exploitation Tool',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down
5 changes: 3 additions & 2 deletions src/core/requests/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ def https_open(self, req):

opener = _urllib.request.build_opener(connection_handler())

# if len(settings.HTTP_METHOD) != 0:
# request.get_method = lambda: settings.HTTP_METHOD
# Time limit mechanism.
if menu.options.time_limit and (time.time() - settings.START_TIME > menu.options.time_limit):
raise SystemExit()

_ = False
response = False
Expand Down
5 changes: 5 additions & 0 deletions src/utils/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def banner():
default=None,
help="Log all HTTP traffic into a textual file.")

general.add_option("--time-limit",
dest="time_limit",
type=float,
help="Run with a time limit in seconds (e.g. 3600).")

general.add_option("--batch",
action="store_true",
dest="batch",
Expand Down
8 changes: 5 additions & 3 deletions src/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ def sys_argv_errors():
DESCRIPTION_FULL = "Automated All-in-One OS Command Injection Exploitation Tool"
DESCRIPTION = "The command injection exploiter"
AUTHOR = "Anastasios Stasinopoulos"
VERSION_NUM = "3.9"
REVISION = "44"
STABLE_RELEASE = True
VERSION_NUM = "4.0"
REVISION = "1"
STABLE_RELEASE = False
VERSION = "v"
if STABLE_RELEASE:
VERSION = VERSION + VERSION_NUM + "-stable"
Expand All @@ -273,6 +273,8 @@ def sys_argv_errors():
# Random string generator
RANDOM_STRING_GENERATOR = ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(10))

START_TIME = time.time()

# Readline
READLINE_ERROR = False

Expand Down

0 comments on commit e258151

Please sign in to comment.