From now on --dbms-cred can be used also in combination with -d (more flexibility as spotted that one user used in that way on ML)

This commit is contained in:
stamparm 2013-04-17 11:12:15 +02:00
parent feed2274c3
commit 2defc30dc6
2 changed files with 10 additions and 2 deletions

View File

@ -1057,6 +1057,9 @@ def parseTargetDirect():
if details.group('credentials'): if details.group('credentials'):
conf.dbmsUser = details.group('user') conf.dbmsUser = details.group('user')
conf.dbmsPass = details.group('pass') conf.dbmsPass = details.group('pass')
else:
if conf.dbmsCred:
conf.dbmsUser, conf.dbmsPass = conf.dbmsCred.split(':')
else: else:
conf.dbmsUser = unicode() conf.dbmsUser = unicode()
conf.dbmsPass = unicode() conf.dbmsPass = unicode()

View File

@ -2109,6 +2109,11 @@ def _basicOptionValidation():
errMsg += "(e.g. 1-10) or integer value (e.g. 5)" errMsg += "(e.g. 1-10) or integer value (e.g. 5)"
raise SqlmapSyntaxException(errMsg) raise SqlmapSyntaxException(errMsg)
if conf.dbmsCred and ':' not in conf.dbmsCred:
errMsg = "value for option '--dbms-cred' must be in "
errMsg += "format <username>:<password> (e.g. \"root:pass\")"
raise SqlmapSyntaxException(errMsg)
if conf.charset: if conf.charset:
_ = checkCharEncoding(conf.charset, False) _ = checkCharEncoding(conf.charset, False)
if _ is None: if _ is None: