Fix for --dump-file with multiple tables and --start/--stop mixing tables

This commit is contained in:
Miroslav Štampar 2026-11-12 16:25:58 +01:00
parent 3fdf005874
commit b6761e1825
2 changed files with 5 additions and 2 deletions

View file

@ -75,6 +75,7 @@ class Dump(object):
self._outputFile = None
self._outputFP = None
self._lock = threading.Lock()
self._dumpFiles = {} # Note: dump file -> table (written during this run)
def _write(self, data, newline=True, console=True, content_type=None):
text = "%s%s" % (data, "\n" if newline else " ")
@ -513,7 +514,8 @@ class Dump(object):
else:
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (safeTable, conf.dumpFormat.lower()))
else:
appendToFile = any((conf.limitStart, conf.limitStop))
# Note: appending (e.g. of --start/--stop ranges) only to the same table's file (i.e. not to a --dump-file shared among multiple tables)
appendToFile = any((conf.limitStart, conf.limitStop)) and self._dumpFiles.get(dumpFileName, table) == table
if not appendToFile:
count = 1
@ -528,6 +530,7 @@ class Dump(object):
else:
count += 1
self._dumpFiles[dumpFileName] = table
dumpFP = openFile(dumpFileName, 'w' if not appendToFile else 'a', buffering=DUMP_FILE_BUFFER_SIZE)
count = int(tableValues["__infos__"]["count"])

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.55"
VERSION = "1.10.11.56"
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)