From 2defc30dc6bae07818a8ff7005b1245a984a9711 Mon Sep 17 00:00:00 2001 From: stamparm Date: Wed, 17 Apr 2013 11:12:15 +0200 Subject: [PATCH] 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) --- lib/core/common.py | 7 +++++-- lib/core/option.py | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index fb7baf144..d9e7dda98 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1058,8 +1058,11 @@ def parseTargetDirect(): conf.dbmsUser = details.group('user') conf.dbmsPass = details.group('pass') else: - conf.dbmsUser = unicode() - conf.dbmsPass = unicode() + if conf.dbmsCred: + conf.dbmsUser, conf.dbmsPass = conf.dbmsCred.split(':') + else: + conf.dbmsUser = unicode() + conf.dbmsPass = unicode() if not conf.dbmsPass: conf.dbmsPass = None diff --git a/lib/core/option.py b/lib/core/option.py index e16728965..ed31a02ff 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -2109,6 +2109,11 @@ def _basicOptionValidation(): errMsg += "(e.g. 1-10) or integer value (e.g. 5)" raise SqlmapSyntaxException(errMsg) + if conf.dbmsCred and ':' not in conf.dbmsCred: + errMsg = "value for option '--dbms-cred' must be in " + errMsg += "format : (e.g. \"root:pass\")" + raise SqlmapSyntaxException(errMsg) + if conf.charset: _ = checkCharEncoding(conf.charset, False) if _ is None: