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

Method getFingerprint

plugins/dbms/postgresql/fingerprint.py:28–92  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 GenericFingerprint.__init__(self, DBMS.PGSQL)
27
28 def getFingerprint(self):
29 fork = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
30
31 if fork is None:
32 if inject.checkBooleanExpression("VERSION() LIKE '%CockroachDB%'"):
33 fork = FORK.COCKROACHDB
34 elif inject.checkBooleanExpression("VERSION() LIKE '%Redshift%'"): # Reference: https://dataedo.com/kb/query/amazon-redshift/check-server-version
35 fork = FORK.REDSHIFT
36 elif inject.checkBooleanExpression("VERSION() LIKE '%Greenplum%'"): # Reference: http://www.sqldbpros.com/wordpress/wp-content/uploads/2014/08/what-version-of-greenplum.png
37 fork = FORK.GREENPLUM
38 elif inject.checkBooleanExpression("VERSION() LIKE '%Yellowbrick%'"): # Reference: https://www.yellowbrick.com/docs/3.3/ybd_sqlref/version.html
39 fork = FORK.YELLOWBRICK
40 elif inject.checkBooleanExpression("VERSION() LIKE '%EnterpriseDB%'"): # Reference: https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/user-guide/11/EDB_Postgres_Advanced_Server_Guide.1.087.html
41 fork = FORK.ENTERPRISEDB
42 elif inject.checkBooleanExpression("VERSION() LIKE '%YB-%'"): # Reference: https://github.com/yugabyte/yugabyte-db/issues/2447#issue-499562926
43 fork = FORK.YUGABYTEDB
44 elif inject.checkBooleanExpression("VERSION() LIKE '%openGauss%'"):
45 fork = FORK.OPENGAUSS
46 elif inject.checkBooleanExpression("AURORA_VERSION() LIKE '%'"): # Reference: https://aws.amazon.com/premiumsupport/knowledge-center/aurora-version-number/
47 fork = FORK.AURORA
48 else:
49 fork = ""
50
51 hashDBWrite(HASHDB_KEYS.DBMS_FORK, fork)
52
53 value = ""
54 wsOsFp = Format.getOs("web server", kb.headersFp)
55
56 if wsOsFp:
57 value += "%s\n" % wsOsFp
58
59 if kb.data.banner:
60 dbmsOsFp = Format.getOs("back-end DBMS", kb.bannerFp)
61
62 if dbmsOsFp:
63 value += "%s\n" % dbmsOsFp
64
65 value += "back-end DBMS: "
66
67 if not conf.extensiveFp:
68 value += DBMS.PGSQL
69 if fork:
70 value += " (%s fork)" % fork
71 return value
72
73 actVer = Format.getDbms()
74 blank = " " * 15
75 value += "active fingerprint: %s" % actVer
76
77 if kb.bannerFp:
78 banVer = kb.bannerFp.get("dbmsVersion")
79
80 if banVer:
81 banVer = Format.getDbms([banVer])
82 value += "\n%sbanner parsing fingerprint: %s" % (blank, banVer)
83
84 htmlErrorFp = Format.getErrorParsedDBMSes()
85

Callers

nothing calls this directly

Calls 6

hashDBRetrieveFunction · 0.90
hashDBWriteFunction · 0.90
getOsMethod · 0.45
getDbmsMethod · 0.45
getMethod · 0.45
getErrorParsedDBMSesMethod · 0.45

Tested by

no test coverage detected