From 3663fa936b4bbb78dddd0bdf8b6882cd40358bcc Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 14 Oct 2020 23:04:01 +0200 Subject: [PATCH] Fixes #4382 --- lib/core/option.py | 24 ++++++++++++++++++++---- lib/core/settings.py | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index cb479027d..fdf43eadf 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -418,14 +418,30 @@ def _setBulkMultipleTargets(): return if isinstance(conf.bulkFile, collections.Iterable): - def _(): - for line in conf.bulkFile: + class _(object): + def __init__(self): + self.__rest = set() + + def __iter__(self): + return self + + def __next__(self): + return self.next() + + def next(self): + line = next(conf.bulkFile) if line: match = re.search(r"\bhttps?://[^\s'\"]+", line, re.I) if match: - yield (match.group(0), conf.method, conf.data, conf.cookie, None) + return (match.group(0), conf.method, conf.data, conf.cookie, None) + elif self.__rest: + return self.__rest.pop() else: - break + raise StopIteration() + + def add(self, elem): + self.__rest.add(elem) + kb.targets = _() else: conf.bulkFile = safeExpandUser(conf.bulkFile) diff --git a/lib/core/settings.py b/lib/core/settings.py index ff98ff7ed..450eec110 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.4.10.8" +VERSION = "1.4.10.9" 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)