From e862da6d4e8d3e1baaa2ced4e154037f94bf2a2d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 11 Aug 2017 10:47:32 +0200 Subject: [PATCH] Update for an Issue #2653 --- lib/core/common.py | 17 +++++++++++++---- lib/core/option.py | 4 ++-- lib/core/settings.py | 2 +- txt/checksum.md5 | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 1a844b5a0..59d55d7c1 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1515,16 +1515,25 @@ def getLimitRange(count, plusOne=False): retVal = None count = int(count) limitStart, limitStop = 1, count + reverse = False if kb.dumpTable: - if isinstance(conf.limitStop, int) and conf.limitStop > 0 and conf.limitStop < limitStop: - limitStop = conf.limitStop + if conf.limitStart and conf.limitStop and conf.limitStart > conf.limitStop: + limitStop = conf.limitStart + limitStart = conf.limitStop + reverse = True + else: + if isinstance(conf.limitStop, int) and conf.limitStop > 0 and conf.limitStop < limitStop: + limitStop = conf.limitStop - if isinstance(conf.limitStart, int) and conf.limitStart > 0 and conf.limitStart <= limitStop: - limitStart = conf.limitStart + if isinstance(conf.limitStart, int) and conf.limitStart > 0 and conf.limitStart <= limitStop: + limitStart = conf.limitStart retVal = xrange(limitStart, limitStop + 1) if plusOne else xrange(limitStart - 1, limitStop) + if reverse: + retVal = xrange(retVal[-1], retVal[0] - 1, -1) + return retVal def parseUnionPage(page): diff --git a/lib/core/option.py b/lib/core/option.py index 4b6d15629..567e12ef9 100755 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -2370,8 +2370,8 @@ def _basicOptionValidation(): if isinstance(conf.limitStart, int) and conf.limitStart > 0 and \ isinstance(conf.limitStop, int) and conf.limitStop < conf.limitStart: - errMsg = "value for option '--start' (limitStart) must be smaller or equal than value for --stop (limitStop) option" - raise SqlmapSyntaxException(errMsg) + warnMsg = "usage of option '--start' (limitStart) which is bigger than value for --stop (limitStop) option is considered unstable" + logger.warn(warnMsg) if isinstance(conf.firstChar, int) and conf.firstChar > 0 and \ isinstance(conf.lastChar, int) and conf.lastChar < conf.firstChar: diff --git a/lib/core/settings.py b/lib/core/settings.py index 705021eae..c3f828415 100755 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.1.8.3" +VERSION = "1.1.8.4" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index b6a4bda9c..82e434818 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -27,7 +27,7 @@ a66093c734c7f94ecdf94d882c2d8b89 lib/controller/controller.py 310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py ca0a4eba91d73c9d7adedabf528ca4f1 lib/core/agent.py 6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py -1f88ce54a27cb98c301ea0c3fb83bce0 lib/core/common.py +60dbe2a3c2914a9444a69f39250a81e4 lib/core/common.py 5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py 7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py @@ -40,13 +40,13 @@ a44d7a4cc6c9a67a72d6af2f25f4ddac lib/core/exception.py 310efc965c862cfbd7b0da5150a5ad36 lib/core/__init__.py 9ba39bf66e9ecd469446bdbbeda906c3 lib/core/log.py 5a34a1be62eab520cacc197b5eacda39 lib/core/optiondict.py -fbf750dc617c3549ee423d6c2334ba4d lib/core/option.py +467a77eb68d193467a3a91d7b378501d lib/core/option.py 5f2f56e6c5f274408df61943f1e080c0 lib/core/profiling.py 40be71cd774662a7b420caeb7051e7d5 lib/core/readlineng.py d8e9250f3775119df07e9070eddccd16 lib/core/replication.py 785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py 40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py -9d0fd30ccb8b33668cf0ef06f3ed742e lib/core/settings.py +38f2c524858af0751fd13ba74427792f lib/core/settings.py d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py 2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py 4a6ecdd8a6e44bb4737bd9bc7f9b5743 lib/core/target.py