MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / checkDbms

Method checkDbms

plugins/dbms/hsqldb/fingerprint.py:66–142  ·  view source on GitHub ↗

References for fingerprint: DATABASE_VERSION() version 2.2.6 added two-arg REPLACE functio REPLACE('a','a') compared to REPLACE('a','a','d') version 2.2.5 added SYSTIMESTAMP function version 2.2.3 added REGEXPR_SUBSTRING and REGEXPR_SUBSTRING_ARRAY functions

(self)

Source from the content-addressed store, hash-verified

64 return value
65
66 def checkDbms(self):
67 """
68 References for fingerprint:
69 DATABASE_VERSION()
70 version 2.2.6 added two-arg REPLACE functio REPLACE('a','a') compared to REPLACE('a','a','d')
71 version 2.2.5 added SYSTIMESTAMP function
72 version 2.2.3 added REGEXPR_SUBSTRING and REGEXPR_SUBSTRING_ARRAY functions
73 version 2.2.0 added support for ROWNUM() function
74 version 2.1.0 added MEDIAN aggregate function
75 version < 2.0.1 added support for datetime ROUND and TRUNC functions
76 version 2.0.0 added VALUES support
77 version 1.8.0.4 Added org.hsqldbdb.Library function, getDatabaseFullProductVersion to return the
78 full version string, including the 4th digit (e.g 1.8.0.4).
79 version 1.7.2 CASE statements added and INFORMATION_SCHEMA
80
81 """
82
83 if not conf.extensiveFp and Backend.isDbmsWithin(HSQLDB_ALIASES):
84 setDbms("%s %s" % (DBMS.HSQLDB, Backend.getVersion()))
85
86 if Backend.isVersionGreaterOrEqualThan("1.7.2"):
87 kb.data.has_information_schema = True
88
89 self.getBanner()
90
91 return True
92
93 infoMsg = "testing %s" % DBMS.HSQLDB
94 logger.info(infoMsg)
95
96 result = inject.checkBooleanExpression("CASEWHEN(1=1,1,0)=1")
97
98 if result:
99 infoMsg = "confirming %s" % DBMS.HSQLDB
100 logger.info(infoMsg)
101
102 result = inject.checkBooleanExpression("LEAST(ROUNDMAGIC(PI()),3)=3")
103
104 if not result:
105 warnMsg = "the back-end DBMS is not %s" % DBMS.HSQLDB
106 logger.warning(warnMsg)
107
108 return False
109 else:
110 result = inject.checkBooleanExpression("ZERO() IS 0") # Note: check for H2 DBMS (sharing majority of same functions)
111 if result:
112 warnMsg = "the back-end DBMS is not %s" % DBMS.HSQLDB
113 logger.warning(warnMsg)
114
115 return False
116
117 kb.data.has_information_schema = True
118 Backend.setVersion(">= 1.7.2")
119 setDbms("%s 1.7.2" % DBMS.HSQLDB)
120
121 banner = self.getBanner()
122 if banner:
123 Backend.setVersion("= %s" % banner)

Callers

nothing calls this directly

Calls 10

setDbmsFunction · 0.90
unArrayizeValueFunction · 0.90
isDbmsWithinMethod · 0.80
getVersionMethod · 0.80
infoMethod · 0.80
setVersionMethod · 0.80
setVersionListMethod · 0.80
debugMethod · 0.80
getBannerMethod · 0.45

Tested by

no test coverage detected