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

Method getFingerprint

plugins/dbms/mysql/fingerprint.py:95–165  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 return None
94
95 def getFingerprint(self):
96 fork = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
97
98 if fork is None:
99 if inject.checkBooleanExpression("VERSION() LIKE '%MariaDB%'"):
100 fork = FORK.MARIADB
101 elif inject.checkBooleanExpression("VERSION() LIKE '%TiDB%'"):
102 fork = FORK.TIDB
103 elif inject.checkBooleanExpression("@@VERSION_COMMENT LIKE '%drizzle%'"):
104 fork = FORK.DRIZZLE
105 elif inject.checkBooleanExpression("@@VERSION_COMMENT LIKE '%Percona%'"):
106 fork = FORK.PERCONA
107 elif inject.checkBooleanExpression("@@VERSION_COMMENT LIKE '%Doris%'"):
108 fork = FORK.DORIS
109 elif inject.checkBooleanExpression("@@VERSION_COMMENT LIKE '%StarRocks%'"):
110 fork = FORK.STARROCKS
111 elif inject.checkBooleanExpression("AURORA_VERSION() LIKE '%'"): # Reference: https://aws.amazon.com/premiumsupport/knowledge-center/aurora-version-number/
112 fork = FORK.AURORA
113 else:
114 fork = ""
115
116 hashDBWrite(HASHDB_KEYS.DBMS_FORK, fork)
117
118 value = ""
119 wsOsFp = Format.getOs("web server", kb.headersFp)
120
121 if wsOsFp and not conf.api:
122 value += "%s\n" % wsOsFp
123
124 if kb.data.banner:
125 dbmsOsFp = Format.getOs("back-end DBMS", kb.bannerFp)
126
127 if dbmsOsFp and not conf.api:
128 value += "%s\n" % dbmsOsFp
129
130 value += "back-end DBMS: "
131 actVer = Format.getDbms()
132
133 if not conf.extensiveFp:
134 value += actVer
135 if fork:
136 value += " (%s fork)" % fork
137 return value
138
139 comVer = self._commentCheck()
140 blank = " " * 15
141 value += "active fingerprint: %s" % actVer
142
143 if comVer:
144 comVer = Format.getDbms([comVer])
145 value += "\n%scomment injection fingerprint: %s" % (blank, comVer)
146
147 if kb.bannerFp:
148 banVer = kb.bannerFp.get("dbmsVersion")
149
150 if banVer:
151 if banVer and re.search(r"-log$", kb.data.banner or ""):
152 banVer += ", logging enabled"

Callers

nothing calls this directly

Calls 8

_commentCheckMethod · 0.95
hashDBRetrieveFunction · 0.90
hashDBWriteFunction · 0.90
getOsMethod · 0.45
getDbmsMethod · 0.45
getMethod · 0.45
searchMethod · 0.45
getErrorParsedDBMSesMethod · 0.45

Tested by

no test coverage detected