Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdf6673

Browse files
committed
Dealing with some pesky issues
1 parent 39b8ff4 commit fdf6673

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ c03dc585f89642cfd81b087ac2723e3e1bb3bfa8c60e6f5fe58ef3b0113ebfe6 lib/core/data.
175175
70fb2528e580b22564899595b0dff6b1bc257c6a99d2022ce3996a3d04e68e4e lib/core/decorators.py
176176
147823c37596bd6a56d677697781f34b8d1d1671d5a2518fbc9468d623c6d07d lib/core/defaults.py
177177
2f44a1bfe6f18aafe64147b99e69aa93cf438c0e7befe59f4e2aee9065c8b7b6 lib/core/dicts.py
178-
a033f92d136c707a25927c2383125ddb004d4283db62c004dcd67c3fc242bb1c lib/core/dump.py
178+
ccd3b414727ef75f5d533f9518198b61322781f3ee53a86643763e029b2874c0 lib/core/dump.py
179179
23e33f0b457e2a7114c9171ba9b42e1751b71ee3f384bba7fad39e4490adb803 lib/core/enums.py
180180
5387168e5dfedd94ae22af7bb255f27d6baaca50b24179c6b98f4f325f5cc7b4 lib/core/exception.py
181181
1966ca704961fb987ab757f0a4afddbf841d1a880631b701487c75cef63d60c3 lib/core/__init__.py
@@ -188,7 +188,7 @@ a033f92d136c707a25927c2383125ddb004d4283db62c004dcd67c3fc242bb1c lib/core/dump.
188188
48797d6c34dd9bb8a53f7f3794c85f4288d82a9a1d6be7fcf317d388cb20d4b3 lib/core/replication.py
189189
0b8c38a01bb01f843d94a6c5f2075ee47520d0c4aa799cecea9c3e2c5a4a23a6 lib/core/revision.py
190190
888daba83fd4a34e9503fe21f01fef4cc730e5cde871b1d40e15d4cbc847d56c lib/core/session.py
191-
9af9eabb33938e0c1fed05afa5699fab047b3cb0ab7c61fc2d471ee41df1d4dd lib/core/settings.py
191+
f27a2b0fc084f321c802056cdd7c9cfdc776fcc728553f1cb0db3f67c88a3671 lib/core/settings.py
192192
cd5a66deee8963ba8e7e9af3dd36eb5e8127d4d68698811c29e789655f507f82 lib/core/shell.py
193193
bcb5d8090d5e3e0ef2a586ba09ba80eef0c6d51feb0f611ed25299fbb254f725 lib/core/subprocessng.py
194194
70ea3768f1b3062b22d20644df41c86238157ec80dd43da40545c620714273c6 lib/core/target.py

lib/core/dump.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,17 @@ def dbTableValues(self, tableValues):
410410
db = "All"
411411
table = tableValues["__infos__"]["table"]
412412

413+
safeDb = re.sub(r"[^\w]", UNSAFE_DUMP_FILEPATH_REPLACEMENT, unsafeSQLIdentificatorNaming(db))
414+
safeTable = re.sub(r"[^\w]", UNSAFE_DUMP_FILEPATH_REPLACEMENT, unsafeSQLIdentificatorNaming(table))
415+
413416
if conf.api:
414417
self._write(tableValues, content_type=CONTENT_TYPE.DUMP_TABLE)
415418

416419
try:
417-
dumpDbPath = os.path.join(conf.dumpPath, unsafeSQLIdentificatorNaming(db))
420+
dumpDbPath = os.path.join(conf.dumpPath, safeDb)
418421
except UnicodeError:
419422
try:
420-
dumpDbPath = os.path.join(conf.dumpPath, normalizeUnicode(unsafeSQLIdentificatorNaming(db)))
423+
dumpDbPath = os.path.join(conf.dumpPath, normalizeUnicode(safeDb))
421424
except (UnicodeError, OSError):
422425
tempDir = tempfile.mkdtemp(prefix="sqlmapdb")
423426
warnMsg = "currently unable to use regular dump directory. "
@@ -427,16 +430,14 @@ def dbTableValues(self, tableValues):
427430
dumpDbPath = tempDir
428431

429432
if conf.dumpFormat == DUMP_FORMAT.SQLITE:
430-
replication = Replication(os.path.join(conf.dumpPath, "%s.sqlite3" % unsafeSQLIdentificatorNaming(db)))
433+
replication = Replication(os.path.join(conf.dumpPath, "%s.sqlite3" % safeDb))
431434
elif conf.dumpFormat in (DUMP_FORMAT.CSV, DUMP_FORMAT.HTML):
432435
if not os.path.isdir(dumpDbPath):
433436
try:
434437
os.makedirs(dumpDbPath)
435438
except:
436439
warnFile = True
437-
438-
_ = re.sub(r"[^\w]", UNSAFE_DUMP_FILEPATH_REPLACEMENT, unsafeSQLIdentificatorNaming(db))
439-
dumpDbPath = os.path.join(conf.dumpPath, "%s-%s" % (_, hashlib.md5(getBytes(db)).hexdigest()[:8]))
440+
dumpDbPath = os.path.join(conf.dumpPath, "%s-%s" % (safeDb, hashlib.md5(getBytes(db)).hexdigest()[:8]))
440441

441442
if not os.path.isdir(dumpDbPath):
442443
try:
@@ -450,21 +451,19 @@ def dbTableValues(self, tableValues):
450451

451452
dumpDbPath = tempDir
452453

453-
dumpFileName = conf.dumpFile or os.path.join(dumpDbPath, re.sub(r'[\\/]', UNSAFE_DUMP_FILEPATH_REPLACEMENT, "%s.%s" % (unsafeSQLIdentificatorNaming(table), conf.dumpFormat.lower())))
454+
dumpFileName = conf.dumpFile or os.path.join(dumpDbPath, "%s.%s" % (safeTable, conf.dumpFormat.lower()))
455+
454456
if not checkFile(dumpFileName, False):
455457
try:
456458
openFile(dumpFileName, "w+").close()
457459
except SqlmapSystemException:
458460
raise
459461
except:
460462
warnFile = True
461-
462-
_ = re.sub(r"[^\w]", UNSAFE_DUMP_FILEPATH_REPLACEMENT, normalizeUnicode(unsafeSQLIdentificatorNaming(table)))
463-
if len(_) < len(table) or IS_WIN and table.upper() in WINDOWS_RESERVED_NAMES:
464-
_ = re.sub(r"[^\w]", UNSAFE_DUMP_FILEPATH_REPLACEMENT, unsafeSQLIdentificatorNaming(table))
465-
dumpFileName = os.path.join(dumpDbPath, "%s-%s.%s" % (_, hashlib.md5(getBytes(table)).hexdigest()[:8], conf.dumpFormat.lower()))
463+
if IS_WIN and safeTable.upper() in WINDOWS_RESERVED_NAMES:
464+
dumpFileName = os.path.join(dumpDbPath, "%s-%s.%s" % (safeTable, hashlib.md5(getBytes(table)).hexdigest()[:8], conf.dumpFormat.lower()))
466465
else:
467-
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (_, conf.dumpFormat.lower()))
466+
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (safeTable, conf.dumpFormat.lower()))
468467
else:
469468
appendToFile = any((conf.limitStart, conf.limitStop))
470469

@@ -548,7 +547,7 @@ def dbTableValues(self, tableValues):
548547
dataToDumpFile(dumpFP, "<!DOCTYPE html>\n<html>\n<head>\n")
549548
dataToDumpFile(dumpFP, "<meta http-equiv=\"Content-type\" content=\"text/html;charset=%s\">\n" % UNICODE_ENCODING)
550549
dataToDumpFile(dumpFP, "<meta name=\"generator\" content=\"%s\" />\n" % VERSION_STRING)
551-
dataToDumpFile(dumpFP, "<title>%s</title>\n" % ("%s%s" % ("%s." % db if METADB_SUFFIX not in db else "", table)))
550+
dataToDumpFile(dumpFP, "<title>%s</title>\n" % ("%s%s" % ("%s." % db if METADB_SUFFIX not in db else "", table)).replace("<", ""))
552551
dataToDumpFile(dumpFP, HTML_DUMP_CSS_STYLE)
553552
dataToDumpFile(dumpFP, "\n</head>\n<body>\n<table>\n<thead>\n<tr>\n")
554553

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty import six
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.10.4.4"
23+
VERSION = "1.10.4.5"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)