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

Method checkDbms

plugins/dbms/vertica/fingerprint.py:60–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 return value
59
60 def checkDbms(self):
61 if not conf.extensiveFp and Backend.isDbmsWithin(VERTICA_ALIASES):
62 setDbms(DBMS.VERTICA)
63
64 self.getBanner()
65
66 return True
67
68 infoMsg = "testing %s" % DBMS.VERTICA
69 logger.info(infoMsg)
70
71 # NOTE: Vertica works too without the CONVERT_TO()
72 result = inject.checkBooleanExpression("BITSTRING_TO_BINARY(NULL) IS NULL")
73
74 if result:
75 infoMsg = "confirming %s" % DBMS.VERTICA
76 logger.info(infoMsg)
77
78 result = inject.checkBooleanExpression("HEX_TO_INTEGER(NULL) IS NULL")
79
80 if not result:
81 warnMsg = "the back-end DBMS is not %s" % DBMS.VERTICA
82 logger.warning(warnMsg)
83
84 return False
85
86 setDbms(DBMS.VERTICA)
87
88 self.getBanner()
89
90 if not conf.extensiveFp:
91 return True
92
93 infoMsg = "actively fingerprinting %s" % DBMS.VERTICA
94 logger.info(infoMsg)
95
96 if inject.checkBooleanExpression("CALENDAR_HIERARCHY_DAY(NULL) IS NULL"):
97 Backend.setVersion(">= 9.0")
98 else:
99 Backend.setVersion("< 9.0")
100
101 return True
102 else:
103 warnMsg = "the back-end DBMS is not %s" % DBMS.VERTICA
104 logger.warning(warnMsg)
105
106 return False

Callers

nothing calls this directly

Calls 5

setDbmsFunction · 0.90
isDbmsWithinMethod · 0.80
infoMethod · 0.80
setVersionMethod · 0.80
getBannerMethod · 0.45

Tested by

no test coverage detected