From 47a7708950cadc6e96a0d626728606de1d37d514 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 30 Nov 2010 12:45:42 +0000 Subject: [PATCH] minor improvement of dynamic content detection/removal part --- lib/controller/checks.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 2055cfd5f..2abb91990 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -540,18 +540,23 @@ def checkStability(): else: checkDynamicContent(firstPage, secondPage) - if not Request.queryPage(): - warnMsg = "target url is heavily dynamic. retrying. " - logger.warn(warnMsg) + count = 0 + while not Request.queryPage(): + count += 1 + + if count > conf.retries: + errMsg = "target url is too dynamic. unable to continue. " + errMsg += "consider using other switches (e.g. " + errMsg += "--longest-common, --string, --text-only, etc.)" + raise sqlmapSiteTooDynamic, errMsg + + warnMsg = "target url is heavily dynamic" + warnMsg += ", sqlmap is going to retry the request" + logger.critical(warnMsg) + secondPage, _ = Request.queryPage(content=True) checkDynamicContent(firstPage, secondPage) - if not Request.queryPage(): - errMsg = "target url is too dynamic. unable to continue. " - errMsg += "consider using other switches (e.g. " - errMsg += "--longest-common, --string, --text-only, etc.)" - raise sqlmapSiteTooDynamic, errMsg - return kb.pageStable def checkString():