Skip to content

Commit fcec8ef

Browse files
committed
Fixing CI/CD errors
1 parent f129d3a commit fcec8ef

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ def _hql_atom(atom):
266266
if match:
267267
return match.group(1) == match.group(2)
268268

269+
match = re.match(r"^(\d+)\s*=\s*(\d+)$", atom) # numeric literal 1=1 / 1=2
270+
if match:
271+
return match.group(1) == match.group(2)
272+
269273
match = re.match(r"^\w+\s*=\s*'([^']*)'$", atom) # outer: name = 'X'
270274
if match:
271275
return HQL_RECORD["name"] == match.group(1)

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.7.178"
23+
VERSION = "1.10.7.179"
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)

lib/techniques/hql/inject.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,19 @@ def _shortEntity(entity):
348348
return re.split(r"[.$]", entity)[-1] if entity else entity
349349

350350

351+
def _exists(truth, predicate):
352+
"""Existence probe helper: an unmapped entity/attribute makes the ORM query fail
353+
to compile (error page), which for a yes/no existence question is a definitive
354+
'no'. Unlike value bisection - where a transient error must stay inconclusive so
355+
it never freezes a wrong bit - an inconclusive/error existence probe reads as
356+
false (matching the pre-recalibration oracle semantics these probes rely on)."""
357+
358+
try:
359+
return truth(predicate)
360+
except InconclusiveError:
361+
return False
362+
363+
351364
def _bruteEntities(truth):
352365
"""Recover mapped entity names through the boolean oracle alone (no reflected
353366
diagnostic needed): a mapped name keeps the FROM clause valid, an unmapped one
@@ -356,7 +369,7 @@ def _bruteEntities(truth):
356369

357370
retVal = []
358371
for entity in HQL_COMMON_ENTITIES:
359-
if truth("EXISTS(SELECT 1 FROM %s _h)" % entity):
372+
if _exists(truth, "EXISTS(SELECT 1 FROM %s _h)" % entity):
360373
retVal.append(entity)
361374
return retVal
362375

@@ -370,7 +383,7 @@ def _enumFields(truth, entity):
370383
if len(fields) >= HQL_MAX_FIELDS:
371384
break
372385
predicate = "EXISTS(SELECT _h.%s FROM %s _h)" % (field, entity)
373-
if truth(predicate):
386+
if _exists(truth, predicate):
374387
fields.append(field)
375388
logger.info("identified mapped attribute: '%s'" % field)
376389
return fields

0 commit comments

Comments
 (0)