Compare commits

...
3 Commits
Author SHA1 Message Date
Miroslav Štampar 5b180533c1 Fixes #6143 2026-10-11 21:20:29 +02:00
Miroslav Štampar 2c6e4d85b5 Fixes #6142 2026-10-10 12:00:33 +02:00
Mr.X 1b1f93ae5c Make test_ssti and test_xpath runnable standalone (#6136)
Every tests/test_*.py file provides an

    if __name__ == "__main__":
        unittest.main(...)

entrypoint so it can be run directly, except test_ssti.py and
test_xpath.py. Running either of those directly produced no output and
executed none of its tests; they only ran under `unittest discover`.

Add the missing entrypoint to both so they behave like the rest of the
suite. No test logic changed (62 and 48 tests respectively still pass).
2026-10-05 23:54:39 +02:00
5 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.10.0"
VERSION = "1.10.10.2"
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)
+1 -1
View File
@@ -1638,7 +1638,7 @@ class Connect(object):
match = re.search(r"['\"]", post)
if match:
quote = match.group(0)
post = re.sub(r"\}\Z", "%s%s}" % (',' if re.search(r"\w", post) else "", "%s%s%s:%s" % (quote, name, quote, entry if entry.isdigit() else "%s%s%s" % (quote, entry, quote))), post)
post = re.sub(r"\}\Z", "%s%s}" % (',' if re.search(r"\w", post) else "", "%s%s%s:%s" % (quote, name, quote, entry if entry.isdigit() else "%s%s%s" % (quote, entry.replace('\\', r'\\'), quote))), post)
else:
post += "%s%s=%s" % (delimiter, name, entry)
elif get is not None:
+11
View File
@@ -79,6 +79,7 @@ from lib.core.enums import HASH
from lib.core.enums import MKSTEMP_PREFIX
from lib.core.exception import SqlmapDataException
from lib.core.exception import SqlmapUserQuitException
from lib.core.patch import dirtyPatches
from lib.core.settings import COMMON_PASSWORD_SUFFIXES
from lib.core.settings import COMMON_PASSWORDS
from lib.core.settings import COMMON_USER_COLUMNS
@@ -101,6 +102,16 @@ from thirdparty import six
from thirdparty.colorama.initialise import init as coloramainit
from thirdparty.six.moves import queue as _queue
# On Windows, multiprocessing's 'spawn' start method boots a fresh interpreter per cracking
# worker (_bruteProcessVariantA/B/Salted below) to unpickle its target function, which re-imports
# this module from scratch without ever running the main process's startup dirtyPatches() - so
# process-wide monkeypatches it installs (e.g. the 'reversible' codec error handler used by
# getUnicode()/openFile()) are missing in the worker, raising LookupError on every hashed entry
# (#6143). Placing the (idempotent) call here means that very re-import applies it. POSIX fork()
# workers inherit the parent's patches already, so this only needs to run on Windows.
if IS_WIN:
dirtyPatches()
def mysql_passwd(password, uppercase=True):
"""
Reference(s):
+4
View File
@@ -827,3 +827,7 @@ class TestStruts2Header(unittest.TestCase):
# so no start/end marker is found -> no fabricated 'output'
ssti._s2045Send = lambda url, action: "reflected: %s" % action
self.assertIsNone(ssti._executeStruts2Header("http://target", "id"))
if __name__ == "__main__":
unittest.main(verbosity=2)
+4
View File
@@ -557,3 +557,7 @@ class TestRealXPathSyntax(unittest.TestCase):
self.fail("Boundary '%s' in '%s' with orig='%s' invalid: %s\n payload: %s" % (bk, tkey, original, e, payload))
self.assertIsInstance(count, int,
"Boundary '%s' in '%s' produced no count" % (bk, tkey))
if __name__ == "__main__":
unittest.main(verbosity=2)