minor update planned for a long time (in case of heuristic test was positive warn the user properly at the end if program fails)

This commit is contained in:
Miroslav Stampar 2011-06-15 17:37:28 +00:00
parent e0ad72031f
commit 4d51fa8155
3 changed files with 22 additions and 10 deletions

View File

@ -582,6 +582,8 @@ def heuristicCheckSqlInjection(place, parameter):
infoMsg = "heuristic test shows that %s " % place infoMsg = "heuristic test shows that %s " % place
infoMsg += "parameter '%s' might " % parameter infoMsg += "parameter '%s' might " % parameter
kb.heuristicTest = result
if result: if result:
infoMsg += "be injectable (possible DBMS: %s)" % (Format.getErrorParsedDBMSes() or UNKNOWN_DBMS_VERSION) infoMsg += "be injectable (possible DBMS: %s)" % (Format.getErrorParsedDBMSes() or UNKNOWN_DBMS_VERSION)
logger.info(infoMsg) logger.info(infoMsg)

View File

@ -488,9 +488,9 @@ def start():
percent = (100.0 * len(getFilteredPageContent(kb.originalPage)) / len(kb.originalPage)) percent = (100.0 * len(getFilteredPageContent(kb.originalPage)) / len(kb.originalPage))
if kb.dynamicParameters: if kb.dynamicParameters:
errMsg += " Give it a go with the --text-only switch " errMsg += " You can give it a go with the --text-only "
errMsg += "if the target page has a low percentage of " errMsg += "switch if the target page has a low percentage "
errMsg += "textual content (~%.2f%% of " % percent errMsg += "of textual content (~%.2f%% of " % percent
errMsg += "page content is text)." errMsg += "page content is text)."
elif percent < LOW_TEXT_PERCENT and not kb.errorIsNone: elif percent < LOW_TEXT_PERCENT and not kb.errorIsNone:
errMsg += " Please retry with the --text-only switch " errMsg += " Please retry with the --text-only switch "
@ -500,18 +500,27 @@ def start():
errMsg += "of comparison engine to detect at least " errMsg += "of comparison engine to detect at least "
errMsg += "one dynamic parameter)." errMsg += "one dynamic parameter)."
if kb.heuristicTest:
errMsg += " As heuristic test turned out positive you are "
errMsg += "strongly advised to continue on with the tests. "
errMsg += "Please, consider usage of tampering scripts as "
errMsg += "your target might filter the queries."
if not conf.string and not conf.regexp: if not conf.string and not conf.regexp:
errMsg += " Rerun by providing either a valid --string " errMsg += " Also, you can try to rerun by providing "
errMsg += "either a valid --string "
errMsg += "or a valid --regexp, refer to the user's " errMsg += "or a valid --regexp, refer to the user's "
errMsg += "manual for details" errMsg += "manual for details"
elif conf.string: elif conf.string:
errMsg += " Rerun by providing a valid --string, perhaps " errMsg += " Also, you can try to rerun by providing a "
errMsg += "the string that you have choosen does not match " errMsg += "valid --string as perhaps the string you "
errMsg += "only on True responses" errMsg += "have choosen does not match "
errMsg += "exclusively True responses"
elif conf.regexp: elif conf.regexp:
errMsg += " Rerun by providing a valid --regexp, perhaps " errMsg += " Also, you can try to rerun by providing a "
errMsg += "the regular expression that you have choosen " errMsg += "valid --regexp as perhaps the regular "
errMsg += "does not match only on True responses" errMsg += "expression that you have choosen "
errMsg += "does not match exclusively True responses"
raise sqlmapNotVulnerableException, errMsg raise sqlmapNotVulnerableException, errMsg
else: else:

View File

@ -1378,6 +1378,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.formNames = [] kb.formNames = []
kb.headersCount = 0 kb.headersCount = 0
kb.headersFp = {} kb.headersFp = {}
kb.heuristicTest = None
kb.hintValue = None kb.hintValue = None
kb.htmlFp = [] kb.htmlFp = []
kb.ignoreTimeout = False kb.ignoreTimeout = False