From 95ce5a4a09a3294d9673bfac4a38befc7522b1d4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 5 Oct 2015 16:33:10 +0200 Subject: [PATCH] Fixes #1444 --- lib/utils/crawler.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/utils/crawler.py b/lib/utils/crawler.py index be47608e1..b76fd3df9 100644 --- a/lib/utils/crawler.py +++ b/lib/utils/crawler.py @@ -22,6 +22,7 @@ from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.exception import SqlmapConnectionException +from lib.core.exception import SqlmapSyntaxException from lib.core.settings import CRAWL_EXCLUDE_EXTENSIONS from lib.core.threads import getCurrentThreadData from lib.core.threads import runThreads @@ -58,12 +59,15 @@ def crawl(target): try: if current: content = Request.getPage(url=current, crawling=True, raise404=False)[0] - except SqlmapConnectionException, e: - errMsg = "connection exception detected (%s). skipping " % e + except SqlmapConnectionException, ex: + errMsg = "connection exception detected (%s). skipping " % ex errMsg += "URL '%s'" % current logger.critical(errMsg) - except httplib.InvalidURL, e: - errMsg = "invalid URL detected (%s). skipping " % e + except SqlmapSyntaxException: + errMsg = "invalid URL detected. skipping '%s'" % current + logger.critical(errMsg) + except httplib.InvalidURL, ex: + errMsg = "invalid URL detected (%s). skipping " % ex errMsg += "URL '%s'" % current logger.critical(errMsg)