Skip to content

Commit

Permalink
Potential fix for #859
Browse files Browse the repository at this point in the history
  • Loading branch information
stasinopoulos committed Oct 30, 2023
1 parent 531f1e3 commit 75057e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/core/injections/controller/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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':
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 75057e2

Please sign in to comment.