From cc9ca802bf2e3ebb651c2db139ba8a336d4dc181 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 6 Jan 2011 08:54:50 +0000 Subject: [PATCH] minor update --- lib/controller/checks.py | 19 +++++++++++++++---- lib/core/session.py | 4 ++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index be83f2ae6..42b85587e 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -19,7 +19,6 @@ from lib.core.common import getComparePageRatio from lib.core.common import getCompiledRegex from lib.core.common import getErrorParsedDBMSes from lib.core.common import getErrorParsedDBMSesFormatted -from lib.core.common import getFilteredPageContent from lib.core.common import getInjectionTests from lib.core.common import getUnicode from lib.core.common import popValue @@ -586,8 +585,6 @@ def checkDynamicContent(firstPage, secondPage): logger.warn(warnMsg) conf.textOnly = True - kb.originalPage = getFilteredPageContent(kb.originalPage) - kb.pageTemplates.clear() setTextOnly() return @@ -640,7 +637,7 @@ def checkStability(): warnMsg += "expression to match on" logger.warn(warnMsg) - message = "how do you want to proceed? [C(ontinue)/s(tring)/r(egex)/q(uit)] " + message = "how do you want to proceed? [C(ontinue)/s(tring)/r(egex)/t(ext only)q(uit)] " if not conf.realTest: test = readInput(message, default="C") else: @@ -657,6 +654,7 @@ def checkStability(): if test: conf.string = test + setString() if kb.nullConnection: debugMsg = "turning off NULL connection " @@ -674,6 +672,7 @@ def checkStability(): if test: conf.regex = test + setRegexp() if kb.nullConnection: debugMsg = "turning off NULL connection " @@ -684,6 +683,18 @@ def checkStability(): else: errMsg = "Empty value supplied" raise sqlmapNoneDataException, errMsg + + elif test and test[0] in ("t", "T"): + conf.textOnly = True + setTextOnly() + + if kb.nullConnection: + debugMsg = "turning off NULL connection " + debugMsg += "support because of regex checking" + logger.debug(debugMsg) + + kb.nullConnection = None + else: checkDynamicContent(firstPage, secondPage) diff --git a/lib/core/session.py b/lib/core/session.py index c1a88c274..df353c314 100644 --- a/lib/core/session.py +++ b/lib/core/session.py @@ -12,6 +12,7 @@ import re from lib.core.common import aliasToDbmsEnum from lib.core.common import dataToSessionFile from lib.core.common import formatFingerprintString +from lib.core.common import getFilteredPageContent from lib.core.common import readInput from lib.core.convert import base64pickle from lib.core.convert import base64unpickle @@ -53,6 +54,9 @@ def setTextOnly(): if condition: dataToSessionFile("[%s][None][None][Text only][True]\n" % conf.url) + kb.originalPage = getFilteredPageContent(kb.originalPage) + kb.pageTemplates.clear() + def setString(): """ Save string to match in session file.