From f848f259a65710c5b83f603de2947a5c8f37a5a2 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 23 Jan 2013 16:22:28 +0000 Subject: [PATCH] upper() -D value for certain DBMSes --- lib/techniques/brute/use.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/techniques/brute/use.py b/lib/techniques/brute/use.py index 5fdb1b4a7..d57284826 100644 --- a/lib/techniques/brute/use.py +++ b/lib/techniques/brute/use.py @@ -50,6 +50,9 @@ def _addPageTextWords(): def tableExists(tableFile, regex=None): result = inject.checkBooleanExpression("%s" % safeStringFormat(BRUTE_TABLE_EXISTS_TEMPLATE, (randomInt(1), randomStr()))) + if conf.db and Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2): + conf.db = conf.db.upper() + if result: errMsg = "can't use table existence check because of detected invalid results " errMsg += "(most probably caused by inability of the used injection " @@ -141,7 +144,11 @@ def columnExists(columnFile, regex=None): errMsg = "missing table parameter" raise SqlmapMissingMandatoryOptionException(errMsg) + if conf.db and Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2): + conf.db = conf.db.upper() + result = inject.checkBooleanExpression(safeStringFormat(BRUTE_COLUMN_EXISTS_TEMPLATE, (randomStr(), randomStr()))) + if result: errMsg = "can't use column existence check because of detected invalid results " errMsg += "(most probably caused by inability of the used injection "