Fixing HTTP chunking for Python2.6

This commit is contained in:
Miroslav Stampar 2021-02-01 21:34:26 +01:00
parent 78b1c4f072
commit d247fda9d3
4 changed files with 12 additions and 4 deletions

View File

@ -2477,7 +2477,15 @@ def _setTorSocksProxySettings():
def _setHttpChunked(): def _setHttpChunked():
if conf.chunked and conf.data: if conf.chunked and conf.data:
if hasattr(_http_client.HTTPConnection, "_set_content_length"):
_http_client.HTTPConnection._set_content_length = lambda self, *args, **kwargs: None _http_client.HTTPConnection._set_content_length = lambda self, *args, **kwargs: None
else:
def putheader(self, header, *values):
if header != HTTP_HEADER.CONTENT_LENGTH:
self._putheader(header, *values)
_http_client.HTTPConnection._putheader = _http_client.HTTPConnection.putheader
_http_client.HTTPConnection.putheader = putheader
def _checkWebSocket(): def _checkWebSocket():
if conf.url and (conf.url.startswith("ws:/") or conf.url.startswith("wss:/")): if conf.url and (conf.url.startswith("ws:/") or conf.url.startswith("wss:/")):

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.5.1.47" VERSION = "1.5.2.0"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -134,7 +134,7 @@ def vulnTest():
for tag, value in (("<url>", url), ("<direct>", direct), ("<request>", request), ("<log>", log), ("<config>", config), ("<base64>", url.replace("id=1", "id=MZ=%3d"))): for tag, value in (("<url>", url), ("<direct>", direct), ("<request>", request), ("<log>", log), ("<config>", config), ("<base64>", url.replace("id=1", "id=MZ=%3d"))):
options = options.replace(tag, value) options = options.replace(tag, value)
cmd = "%s %s %s --batch --non-interactive --debug" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), options) cmd = "%s \"%s\" %s --batch --non-interactive --debug" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), options)
if "<tmp>" in cmd: if "<tmp>" in cmd:
handle, tmp = tempfile.mkstemp() handle, tmp = tempfile.mkstemp()

View File

@ -1068,7 +1068,7 @@ def cmdLineParser(argv=None):
except SystemExit: except SystemExit:
# Protection against Windows dummy double clicking # Protection against Windows dummy double clicking
if IS_WIN: if IS_WIN and "--non-interactive" not in sys.argv:
dataToStdout("\nPress Enter to continue...") dataToStdout("\nPress Enter to continue...")
_input() _input()
raise raise