diff --git a/lib/core/settings.py b/lib/core/settings.py index e2d23d971..861e5673f 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.8.3" +VERSION = "1.10.8.4" 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/tests/test_hql.py b/tests/test_hql.py index 0712b5ce0..113c7ac38 100644 --- a/tests/test_hql.py +++ b/tests/test_hql.py @@ -48,6 +48,30 @@ class TestHelpers(unittest.TestCase): self.assertEqual(hql._shortEntity("User"), "User") +class TestOriginalValue(unittest.TestCase): + def setUp(self): + self.originalParameters = hql.conf.parameters + self.originalParamDict = hql.conf.paramDict + + def tearDown(self): + hql.conf.parameters = self.originalParameters + hql.conf.paramDict = self.originalParamDict + + def test_original_value_parsed_from_raw_query_string(self): + hql.conf.parameters = {"GET": "id=1&name=alice"} + self.assertEqual(hql._originalValue("GET", "name"), "alice") + + def test_original_value_falls_back_to_param_dict(self): + hql.conf.parameters = {} + hql.conf.paramDict = {"GET": {"name": "bob"}} + self.assertEqual(hql._originalValue("GET", "name"), "bob") + + def test_original_value_missing_returns_empty(self): + hql.conf.parameters = {} + hql.conf.paramDict = {} + self.assertEqual(hql._originalValue("GET", "nope"), "") + + class TestBoundary(unittest.TestCase): def test_wrap_string(self): b = hql.Boundary("' OR ", " OR '1'='2", True)