Skip to content

Commit b154f08

Browse files
committed
Minor update
1 parent e11ea65 commit b154f08

6 files changed

Lines changed: 22 additions & 13 deletions

File tree

lib/core/settings.py

Lines changed: 14 additions & 3 deletions
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.8.27"
23+
VERSION = "1.10.8.28"
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)
@@ -1790,7 +1790,15 @@
17901790
}
17911791
</style>"""
17921792

1793-
# Leaving (dirty) possibility to change values from here (e.g. `export SQLMAP__MAX_NUMBER_OF_THREADS=20`)
1793+
# Leaving (dirty) possibility to change values from here (e.g. `export SQLMAP__MAX_NUMBER_OF_THREADS=20`).
1794+
#
1795+
# NOTE the SECOND underscore is deliberate and must stay. sqlmap scans os.environ TWICE, for two
1796+
# different things: this loop binds settings CONSTANTS at import, while `_mergeOptions` (option.py)
1797+
# binds conf OPTIONS at boot, matching `SQLMAP_<OPTION>` against optDict - that is how `SQLMAP_DBMS=mysql`
1798+
# acts as '--dbms=mysql'. The extra underscore is what keeps the two from reading each other's variables,
1799+
# and they really would collide: `DBMS` and `OS` name both a conf option and a global bound here (the
1800+
# enum classes), so on a single underscore `SQLMAP_DBMS=mysql` would set '--dbms' AND rebind the DBMS
1801+
# enum class to the string "mysql". So: `SQLMAP_<option>` sets an option, `SQLMAP__<CONSTANT>` a constant.
17941802
for key, value in os.environ.items():
17951803
if key.upper().startswith("%s_" % SQLMAP_ENVIRONMENT_PREFIX):
17961804
_ = key[len(SQLMAP_ENVIRONMENT_PREFIX) + 1:].upper()
@@ -1810,5 +1818,8 @@
18101818
pass
18111819
elif isinstance(original, (list, tuple)):
18121820
globals()[_] = [__.strip() for __ in value.split(',')]
1813-
else:
1821+
elif isinstance(original, six.string_types):
18141822
globals()[_] = value
1823+
# anything else (dict, frozenset, enum class, compiled regex) is left alone: a raw string is
1824+
# not a usable substitute for one, and swapping it in fails far from here and silently - a
1825+
# frozenset turned into a string still answers `in`, just by substring

tests/test_boolean_jitter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _vector():
9898

9999
class _BooleanJitterBase(unittest.TestCase):
100100
_CONF = ("threads", "api", "verbose", "direct", "string", "notString", "regexp", "code", "lengths",
101-
"titles", "textOnly", "predictOutput", "hexConvert", "charset", "firstChar", "lastChar",
101+
"titles", "textOnly", "hexConvert", "charset", "firstChar", "lastChar",
102102
"ignoreCode", "ignoreTimeouts")
103103
_KB = ("negativeLogic", "nullConnection", "errorIsNone", "pageTemplate", "matchRatio", "heavilyDynamic",
104104
"pageStructurallyStable", "skipSeqMatcher", "pageEncoding", "partRun", "safeCharEncode",
@@ -126,7 +126,7 @@ def _configure(self):
126126
set_dbms("MySQL")
127127
conf.threads = 1; conf.api = False; conf.verbose = 0; conf.direct = False
128128
conf.string = _STRING; conf.notString = None; conf.regexp = None; conf.code = None
129-
conf.lengths = None; conf.titles = None; conf.textOnly = None; conf.predictOutput = False
129+
conf.lengths = None; conf.titles = None; conf.textOnly = None
130130
conf.hexConvert = False; conf.charset = None; conf.firstChar = None; conf.lastChar = None
131131
conf.ignoreCode = []; conf.ignoreTimeouts = False
132132
kb.negativeLogic = False; kb.nullConnection = False; kb.errorIsNone = True

tests/test_inference_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
_PARSE = re.compile(r"IDX=(\d+) CMP(.)(\d+)")
4040

4141
# conf/kb knobs bisection reads on the simple single-threaded, no-prediction path
42-
_CONF = {"predictOutput": False, "threads": 1, "api": False, "verbose": 0, "hexConvert": False,
42+
_CONF = {"threads": 1, "api": False, "verbose": 0, "hexConvert": False,
4343
"charset": None, "firstChar": None, "lastChar": None, "timeSec": 5}
4444
_KB = {"partRun": None, "safeCharEncode": False, "bruteMode": False, "fileReadMode": False,
4545
"disableShiftTable": False, "originalTimeDelay": 5, "prependFlag": False}

tests/test_jitter_stress.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _timeVector():
6161

6262

6363
class _JitterBase(unittest.TestCase):
64-
_CONF = ("threads", "api", "verbose", "direct", "disableStats", "timeSec", "predictOutput",
64+
_CONF = ("threads", "api", "verbose", "direct", "disableStats", "timeSec",
6565
"hexConvert", "charset", "firstChar", "lastChar")
6666
_KB = ("responseTimeMode", "responseTimePayload", "adjustTimeDelay", "laggingChecked", "partRun",
6767
"safeCharEncode", "bruteMode", "fileReadMode", "disableShiftTable", "prependFlag",
@@ -87,7 +87,7 @@ def tearDown(self):
8787
def _configure(self, baselineJitter, rng, nBaseline=30):
8888
set_dbms("MySQL")
8989
conf.threads = 1; conf.api = False; conf.verbose = 0; conf.direct = False
90-
conf.disableStats = False; conf.timeSec = _TIMESEC; conf.predictOutput = False
90+
conf.disableStats = False; conf.timeSec = _TIMESEC
9191
conf.hexConvert = False; conf.charset = None; conf.firstChar = None; conf.lastChar = None
9292
kb.responseTimeMode = None
9393
kb.responseTimePayload = None

tests/test_option.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ class TestBasicOptionValidation(_BackendGuard):
688688
"textOnly", "nullConnection", "uValues", "uChar", "base64Parameter",
689689
"tamper", "eta", "verbose", "direct", "url", "dbms", "tor", "proxy",
690690
"ignoreProxy", "regexp", "timeSec", "torPort", "torType", "dumpFormat",
691-
"technique", "threads", "predictOutput", "optimize", "csrfToken",
691+
"technique", "threads", "optimize", "csrfToken",
692692
"csrfUrl", "string", "notString", "noCast", "hexConvert",
693693
)
694694

@@ -701,7 +701,6 @@ def _base(self):
701701
conf.direct = False
702702
conf.tor = False
703703
conf.ignoreProxy = False
704-
conf.predictOutput = False
705704
conf.optimize = False
706705
conf.noCast = False
707706
conf.hexConvert = False
@@ -1136,7 +1135,7 @@ class TestBasicOptionValidationExtra(unittest.TestCase):
11361135
"textOnly", "nullConnection", "uValues", "uChar", "base64Parameter",
11371136
"tamper", "eta", "verbose", "direct", "url", "dbms", "tor", "proxy",
11381137
"ignoreProxy", "regexp", "timeSec", "torPort", "torType", "dumpFormat",
1139-
"technique", "threads", "predictOutput", "optimize", "csrfToken",
1138+
"technique", "threads", "optimize", "csrfToken",
11401139
"csrfUrl", "csrfMethod", "csrfData", "string", "notString", "noCast",
11411140
"hexConvert", "titles", "dumpTable", "search", "dumpAll", "data",
11421141
"requestFile", "forms", "googleDork", "bulkFile", "chunked",
@@ -1155,7 +1154,6 @@ def _base(self):
11551154
conf.direct = False
11561155
conf.tor = False
11571156
conf.ignoreProxy = False
1158-
conf.predictOutput = False
11591157
conf.optimize = False
11601158
conf.noCast = False
11611159
conf.hexConvert = False

tests/test_techniques.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ def test_grid_renders(self):
14151415
_PARSE = re.compile(r"IDX=(\d+) CMP(.)(\d+)")
14161416

14171417
# conf/kb knobs bisection reads on the simple single-threaded, no-prediction path
1418-
_CONF = {"predictOutput": False, "threads": 1, "api": False, "verbose": 0, "hexConvert": False,
1418+
_CONF = {"threads": 1, "api": False, "verbose": 0, "hexConvert": False,
14191419
"charset": None, "firstChar": None, "lastChar": None, "timeSec": 5, "eta": False,
14201420
"repair": False, "flushSession": None, "freshQueries": None, "hashDB": None}
14211421
_KB = {"partRun": None, "safeCharEncode": False, "bruteMode": False, "fileReadMode": False,

0 commit comments

Comments
 (0)