From 25196b45724110ada0c1f50e8acb0ad248becaa8 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 13 Dec 2014 13:48:50 +0100 Subject: [PATCH] Patch for an Issue #1021 --- lib/core/option.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index 585748d93..05ed7c0df 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1188,6 +1188,9 @@ def _setHTTPAuthentication(): if not conf.authType and not conf.authCred and not conf.authPrivate: return + if conf.authPrivate and not conf.authType: + conf.authType = AUTH_TYPE.PKI + elif conf.authType and not conf.authCred and not conf.authPrivate: errMsg = "you specified the HTTP authentication type, but " errMsg += "did not provide the credentials" @@ -1198,7 +1201,7 @@ def _setHTTPAuthentication(): errMsg += "but did not provide the type" raise SqlmapSyntaxException(errMsg) - elif conf.authType.lower() not in (AUTH_TYPE.BASIC, AUTH_TYPE.DIGEST, AUTH_TYPE.NTLM, AUTH_TYPE.PKI): + elif (conf.authType or "").lower() not in (AUTH_TYPE.BASIC, AUTH_TYPE.DIGEST, AUTH_TYPE.NTLM, AUTH_TYPE.PKI): errMsg = "HTTP authentication type value must be " errMsg += "Basic, Digest, NTLM or PKI" raise SqlmapSyntaxException(errMsg)