Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit effc7dc

Browse files
committed
Minor adjustment to notify the user that the --auth-cred format for NTLM authentication is "DOMAIN\user:password"
1 parent 652daa6 commit effc7dc

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

lib/core/option.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,21 +574,27 @@ def __setHTTPAuthentication():
574574
if not conf.aCert:
575575
debugMsg = "setting the HTTP authentication type and credentials"
576576
logger.debug(debugMsg)
577-
577+
578578
aTypeLower = conf.aType.lower()
579-
579+
580580
if aTypeLower not in ( "basic", "digest", "ntlm" ):
581581
errMsg = "HTTP authentication type value must be "
582582
errMsg += "Basic, Digest or NTLM"
583583
raise sqlmapSyntaxException, errMsg
584-
585-
aCredRegExp = re.search("^(.*?)\:(.*?)$", conf.aCred)
586-
584+
elif aTypeLower in ( "basic", "digest" ):
585+
regExp = "^(.*?):(.*?)$"
586+
errMsg = "HTTP %s authentication credentials " % aTypeLower
587+
errMsg += "value must be in format username:password"
588+
elif aTypeLower == "ntlm":
589+
regExp = "^(.*?)\\\(.*?):(.*?)$"
590+
errMsg = "HTTP NTLM authentication credentials value must "
591+
errMsg += "be in format DOMAIN\username:password"
592+
593+
aCredRegExp = re.search(regExp, conf.aCred)
594+
587595
if not aCredRegExp:
588-
errMsg = "HTTP authentication credentials value must be "
589-
errMsg += "in format username:password"
590596
raise sqlmapSyntaxException, errMsg
591-
597+
592598
authUsername = aCredRegExp.group(1)
593599
authPassword = aCredRegExp.group(2)
594600

0 commit comments

Comments
 (0)