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

Method checkDbms

plugins/dbms/sqlite/fingerprint.py:61–109  ·  view source on GitHub ↗

References for fingerprint: * http://www.sqlite.org/lang_corefunc.html * http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions

(self)

Source from the content-addressed store, hash-verified

59 return value
60
61 def checkDbms(self):
62 """
63 References for fingerprint:
64
65 * http://www.sqlite.org/lang_corefunc.html
66 * http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions
67 """
68
69 if not conf.extensiveFp and Backend.isDbmsWithin(SQLITE_ALIASES):
70 setDbms(DBMS.SQLITE)
71
72 self.getBanner()
73
74 return True
75
76 infoMsg = "testing %s" % DBMS.SQLITE
77 logger.info(infoMsg)
78
79 result = inject.checkBooleanExpression("LAST_INSERT_ROWID()=LAST_INSERT_ROWID()")
80
81 if result:
82 infoMsg = "confirming %s" % DBMS.SQLITE
83 logger.info(infoMsg)
84
85 result = inject.checkBooleanExpression("SQLITE_VERSION()=SQLITE_VERSION()")
86
87 if not result:
88 warnMsg = "the back-end DBMS is not %s" % DBMS.SQLITE
89 logger.warning(warnMsg)
90
91 return False
92 else:
93 infoMsg = "actively fingerprinting %s" % DBMS.SQLITE
94 logger.info(infoMsg)
95
96 result = inject.checkBooleanExpression("RANDOMBLOB(-1) IS NOT NULL")
97 version = '3' if result else '2'
98 Backend.setVersion(version)
99
100 setDbms(DBMS.SQLITE)
101
102 self.getBanner()
103
104 return True
105 else:
106 warnMsg = "the back-end DBMS is not %s" % DBMS.SQLITE
107 logger.warning(warnMsg)
108
109 return False
110
111 def forceDbmsEnum(self):
112 conf.db = "%s%s" % (DBMS.SQLITE, METADB_SUFFIX)

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