mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 02:53:46 +03:00
Fixing HTTP chunking for Python2.6
This commit is contained in:
parent
78b1c4f072
commit
d247fda9d3
|
@ -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:/")):
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user