diff --git a/lib/core/option.py b/lib/core/option.py index fa848099f..e123c5e1d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -2894,6 +2894,11 @@ def _basicOptionValidation(): errMsg = "HTTP/2 support is currently incompatible with SOCKS/Tor proxies" raise SqlmapSyntaxException(errMsg) + # Note: native HTTP/2 client bypasses urllib's (challenge-response) authentication handlers (only Basic is sent preemptively) + if conf.http2 and ((conf.authType or "").lower() not in ("", AUTH_TYPE.BASIC, AUTH_TYPE.BEARER) or conf.authFile): + errMsg = "HTTP/2 support is currently incompatible with HTTP authentication type '%s'" % (conf.authType or AUTH_TYPE.PKI) + raise SqlmapSyntaxException(errMsg) + if conf.uValues and conf.uChar: errMsg = "option '--union-values' is incompatible with option '--union-char'" raise SqlmapSyntaxException(errMsg) diff --git a/lib/core/settings.py b/lib/core/settings.py index d48811e96..72882e733 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.11.66" +VERSION = "1.10.11.67" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/lib/request/connect.py b/lib/request/connect.py index afaaf6e5a..30088b480 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -736,6 +736,10 @@ class Connect(object): from lib.request.http2 import open_url as http2OpenUrl from lib.request.http2 import proxy_tuple + # Note: (preemptive) Basic authentication, as urllib's handlers are bypassed + if (conf.authType or "").lower() == AUTH_TYPE.BASIC and conf.authUsername is not None and HTTP_HEADER.AUTHORIZATION not in headers: + headers[HTTP_HEADER.AUTHORIZATION] = "Basic %s" % encodeBase64("%s:%s" % (conf.authUsername, conf.authPassword or ""), binary=False) + try: h2proxy = proxy_tuple(conf.proxy, conf.proxyCred) except ValueError: