From 75057e282657697be201a197ef52e0987b5338d5 Mon Sep 17 00:00:00 2001 From: stasinopoulos Date: Mon, 30 Oct 2023 08:37:06 +0200 Subject: [PATCH] Potential fix for https://github.com/commixproject/commix/issues/859 --- src/core/injections/controller/checks.py | 9 +++++++-- src/utils/settings.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/injections/controller/checks.py b/src/core/injections/controller/checks.py index 9575cfacec..ac8c951fca 100755 --- a/src/core/injections/controller/checks.py +++ b/src/core/injections/controller/checks.py @@ -39,6 +39,7 @@ from src.core.requests import requests from src.thirdparty.six.moves import input as _input from src.thirdparty.six.moves import urllib as _urllib +from src.thirdparty.six.moves import http_client as _http_client from src.thirdparty.colorama import Fore, Back, Style, init from src.thirdparty.flatten_json.flatten_json import flatten, unflatten_list @@ -442,8 +443,11 @@ def newline_fixation(payload): Page enc/decoding """ def page_encoding(response, action): - _ = False - page = response.read() + try: + page = response.read() + except _http_client.IncompleteRead as err_msg: + requests.request_failed(err_msg) + page = err_msg.partial if response.info().get('Content-Encoding') in ("gzip", "x-gzip", "deflate"): try: if response.info().get('Content-Encoding') == 'deflate': @@ -458,6 +462,7 @@ def page_encoding(response, action): warn_msg = "Turning off page compression." print(settings.print_warning_msg(warn_msg)) settings.PAGE_COMPRESSION = False + _ = False try: if action == "encode" and type(page) == str: return page.encode(settings.DEFAULT_CODEC, errors="ignore") diff --git a/src/utils/settings.py b/src/utils/settings.py index 7f2387ac29..82552ec0f3 100755 --- a/src/utils/settings.py +++ b/src/utils/settings.py @@ -241,7 +241,7 @@ def sys_argv_errors(): DESCRIPTION = "The command injection exploiter" AUTHOR = "Anastasios Stasinopoulos" VERSION_NUM = "3.9" -REVISION = "12" +REVISION = "13" STABLE_RELEASE = False VERSION = "v" if STABLE_RELEASE: