mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Fixing CI/CD errors
This commit is contained in:
parent
f129d3ac76
commit
fcec8ef89e
3 changed files with 20 additions and 3 deletions
|
|
@ -266,6 +266,10 @@ def _hql_atom(atom):
|
|||
if match:
|
||||
return match.group(1) == match.group(2)
|
||||
|
||||
match = re.match(r"^(\d+)\s*=\s*(\d+)$", atom) # numeric literal 1=1 / 1=2
|
||||
if match:
|
||||
return match.group(1) == match.group(2)
|
||||
|
||||
match = re.match(r"^\w+\s*=\s*'([^']*)'$", atom) # outer: name = 'X'
|
||||
if match:
|
||||
return HQL_RECORD["name"] == match.group(1)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.178"
|
||||
VERSION = "1.10.7.179"
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -348,6 +348,19 @@ def _shortEntity(entity):
|
|||
return re.split(r"[.$]", entity)[-1] if entity else entity
|
||||
|
||||
|
||||
def _exists(truth, predicate):
|
||||
"""Existence probe helper: an unmapped entity/attribute makes the ORM query fail
|
||||
to compile (error page), which for a yes/no existence question is a definitive
|
||||
'no'. Unlike value bisection - where a transient error must stay inconclusive so
|
||||
it never freezes a wrong bit - an inconclusive/error existence probe reads as
|
||||
false (matching the pre-recalibration oracle semantics these probes rely on)."""
|
||||
|
||||
try:
|
||||
return truth(predicate)
|
||||
except InconclusiveError:
|
||||
return False
|
||||
|
||||
|
||||
def _bruteEntities(truth):
|
||||
"""Recover mapped entity names through the boolean oracle alone (no reflected
|
||||
diagnostic needed): a mapped name keeps the FROM clause valid, an unmapped one
|
||||
|
|
@ -356,7 +369,7 @@ def _bruteEntities(truth):
|
|||
|
||||
retVal = []
|
||||
for entity in HQL_COMMON_ENTITIES:
|
||||
if truth("EXISTS(SELECT 1 FROM %s _h)" % entity):
|
||||
if _exists(truth, "EXISTS(SELECT 1 FROM %s _h)" % entity):
|
||||
retVal.append(entity)
|
||||
return retVal
|
||||
|
||||
|
|
@ -370,7 +383,7 @@ def _enumFields(truth, entity):
|
|||
if len(fields) >= HQL_MAX_FIELDS:
|
||||
break
|
||||
predicate = "EXISTS(SELECT _h.%s FROM %s _h)" % (field, entity)
|
||||
if truth(predicate):
|
||||
if _exists(truth, predicate):
|
||||
fields.append(field)
|
||||
logger.info("identified mapped attribute: '%s'" % field)
|
||||
return fields
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue