From 82efb0ca79c002565907fe38962d8cfdf51ca937 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 24 May 2019 10:58:47 +0200 Subject: [PATCH] Minor patch --- lib/core/settings.py | 2 +- lib/request/connect.py | 36 +++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index d3cd6bb2a..1744ef964 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.5.128" +VERSION = "1.3.5.129" 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/lib/request/connect.py b/lib/request/connect.py index ad854c0f8..0c4343f36 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -236,23 +236,8 @@ class Connect(object): the target URL page content """ - start = time.time() - - if isinstance(conf.delay, (int, float)) and conf.delay > 0: - time.sleep(conf.delay) - if conf.offline: return None, None, None - elif conf.dummy or conf.murphyRate and randomInt() % conf.murphyRate == 0: - if conf.murphyRate: - time.sleep(randomInt() % (MAX_MURPHY_SLEEP_TIME + 1)) - - return randomStr(int(randomInt()), alphabet=[_unichr(_) for _ in xrange(256)]), None, None if not conf.murphyRate else randomInt(3) - - threadData = getCurrentThreadData() - with kb.locks.request: - kb.requestCounter += 1 - threadData.lastRequestUID = kb.requestCounter url = kwargs.get("url", None) or conf.url get = kwargs.get("get", None) @@ -278,6 +263,27 @@ class Connect(object): finalCode = kwargs.get("finalCode", False) chunked = kwargs.get("chunked", False) or conf.chunked + start = time.time() + + if isinstance(conf.delay, (int, float)) and conf.delay > 0: + time.sleep(conf.delay) + + threadData = getCurrentThreadData() + with kb.locks.request: + kb.requestCounter += 1 + threadData.lastRequestUID = kb.requestCounter + + if conf.dummy or conf.murphyRate and randomInt() % conf.murphyRate == 0: + if conf.murphyRate: + time.sleep(randomInt() % (MAX_MURPHY_SLEEP_TIME + 1)) + + page, headers, code = randomStr(int(randomInt()), alphabet=[_unichr(_) for _ in xrange(256)]), None, None if not conf.murphyRate else randomInt(3) + + threadData.lastPage = page + threadData.lastCode = code + + return page, headers, code + if multipart: post = multipart