4848from lib .core .session import setInjection
4949from lib .core .settings import EMPTY_FORM_FIELDS_REGEX
5050from lib .core .settings import IGNORE_PARAMETERS
51+ from lib .core .settings import LOW_TEXT_PERCENT
5152from lib .core .settings import REFERER_ALIASES
5253from lib .core .settings import USER_AGENT_ALIASES
5354from lib .core .target import initTargetEnv
@@ -424,6 +425,8 @@ def start():
424425 logger .warn (warnMsg )
425426
426427 else :
428+ kb .foundDynamicParameter = True
429+
427430 infoMsg = "%s parameter '%s' is dynamic" % (place , parameter )
428431 logger .info (infoMsg )
429432
@@ -469,7 +472,7 @@ def start():
469472 errMsg += "(e.g. GET parameter 'id' in 'www.site.com/index.php?id=1')"
470473 raise sqlmapNoneDataException , errMsg
471474 elif not conf .realTest :
472- errMsg = "all parameters are not injectable."
475+ errMsg = "all parameters appear to be not injectable."
473476
474477 if conf .level < 5 or conf .risk < 3 :
475478 errMsg += " Try to increase --level/--risk values "
@@ -480,10 +483,19 @@ def start():
480483
481484 if not conf .textOnly and kb .originalPage :
482485 percent = (100.0 * len (getFilteredPageContent (kb .originalPage )) / len (kb .originalPage ))
483- errMsg += " Give it a go with the --text-only switch "
484- errMsg += "if the target page has a low percentage of "
485- errMsg += "textual content (~%.2f%% of " % percent
486- errMsg += "page content is text)."
486+
487+ if kb .dynamicParameters :
488+ errMsg += " Give it a go with the --text-only switch "
489+ errMsg += "if the target page has a low percentage of "
490+ errMsg += "textual content (~%.2f%% of " % percent
491+ errMsg += "page content is text)."
492+ elif percent < LOW_TEXT_PERCENT :
493+ errMsg = " Please retry with the --text-only switch "
494+ errMsg += "as this case looks like a perfect candidate "
495+ errMsg += "(low textual content along with inability "
496+ errMsg += "of comparison engine to detect at least "
497+ errMsg += "one dynamic parameter)."
498+ raise sqlmapNoneDataException , errMsg
487499
488500 if not conf .string and not conf .regexp :
489501 errMsg += " Rerun by providing either a valid --string "
0 commit comments