From 96d88877baecfb7ad8957466945e569086da8086 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 10 Nov 2010 19:44:51 +0000 Subject: [PATCH] bug fix (reported by ToR) --- lib/controller/checks.py | 11 ++++++----- lib/controller/controller.py | 6 +++--- lib/core/exception.py | 6 ++++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index e8dc5b6da..c2f028573 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -31,8 +31,8 @@ from lib.core.enums import NULLCONNECTION from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapGenericException from lib.core.exception import sqlmapNoneDataException +from lib.core.exception import sqlmapSiteTooDynamic from lib.core.exception import sqlmapUserQuitException -from lib.core.exception import sqlmapSilentQuitException from lib.core.session import setString from lib.core.session import setRegexp from lib.request.connect import Connect as Request @@ -285,7 +285,8 @@ def checkStability(): kb.nullConnection = None else: - raise sqlmapSilentQuitException + errMsg = "Empty value supplied" + raise sqlmapNoneDataException, errMsg elif test and test[0] in ("r", "R"): message = "please enter value for parameter 'regex': " @@ -301,7 +302,8 @@ def checkStability(): kb.nullConnection = None else: - raise sqlmapSilentQuitException + errMsg = "Empty value supplied" + raise sqlmapNoneDataException, errMsg else: checkDynamicContent(firstPage, secondPage) @@ -309,8 +311,7 @@ def checkStability(): errMsg = "target url is too dynamic. unable to continue. " errMsg += "consider using other switches (e.g. " errMsg += "--longest-common, --string, --text-only, etc.)" - logger.error(errMsg) - raise sqlmapSilentQuitException + raise sqlmapSiteTooDynamic, errMsg return kb.pageStable diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 2d50e81ec..1164c82ea 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -308,9 +308,6 @@ def start(): checkForParenthesis() action() - except sqlmapSilentQuitException: - raise - except KeyboardInterrupt: if conf.multipleTargets: warnMsg = "Ctrl+C detected in multiple target mode" @@ -331,6 +328,9 @@ def start(): except sqlmapUserQuitException: raise + except sqlmapSilentQuitException: + raise + except exceptionsTuple, e: e = getUnicode(e) diff --git a/lib/core/exception.py b/lib/core/exception.py index c6df89034..8006d4562 100644 --- a/lib/core/exception.py +++ b/lib/core/exception.py @@ -50,6 +50,9 @@ class sqlmapUserQuitException(Exception): class sqlmapRegExprException(Exception): pass +class sqlmapSiteTooDynamic(Exception): + pass + class sqlmapSyntaxException(Exception): pass @@ -89,9 +92,8 @@ exceptionsTuple = ( sqlmapMissingDependence, sqlmapMissingMandatoryOptionException, sqlmapNoneDataException, - sqlmapSilentQuitException, - sqlmapUserQuitException, sqlmapRegExprException, + sqlmapSiteTooDynamic, sqlmapSyntaxException, sqlmapUndefinedMethod, sqlmapMissingPrivileges,