MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getSortedInjectionTests

Function getSortedInjectionTests

lib/core/common.py:3741–3771  ·  view source on GitHub ↗

Returns prioritized test list by eventually detected DBMS from error messages >>> pushValue(kb.forcedDbms) >>> kb.forcedDbms = DBMS.SQLITE >>> [test for test in getSortedInjectionTests() if hasattr(test, "details") and hasattr(test.details, "dbms")][0].details.dbms == kb.forcedDbms

()

Source from the content-addressed store, hash-verified

3739 return isinstance(value, (list, tuple, set, OrderedSet, BigArray))
3740
3741def getSortedInjectionTests():
3742 """
3743 Returns prioritized test list by eventually detected DBMS from error messages
3744
3745 >>> pushValue(kb.forcedDbms)
3746 >>> kb.forcedDbms = DBMS.SQLITE
3747 >>> [test for test in getSortedInjectionTests() if hasattr(test, "details") and hasattr(test.details, "dbms")][0].details.dbms == kb.forcedDbms
3748 True
3749 >>> kb.forcedDbms = popValue()
3750 """
3751
3752 retVal = copy.deepcopy(conf.tests)
3753
3754 def priorityFunction(test):
3755 retVal = SORT_ORDER.FIRST
3756
3757 if test.stype == PAYLOAD.TECHNIQUE.UNION:
3758 retVal = SORT_ORDER.LAST
3759
3760 elif "details" in test and "dbms" in (test.details or {}):
3761 if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
3762 retVal = SORT_ORDER.SECOND
3763 else:
3764 retVal = SORT_ORDER.THIRD
3765
3766 return retVal
3767
3768 if Backend.getIdentifiedDbms():
3769 retVal = sorted(retVal, key=priorityFunction)
3770
3771 return retVal
3772
3773def filterListValue(value, regex):
3774 """

Callers 1

checkSqlInjectionFunction · 0.90

Calls 1

getIdentifiedDbmsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…