mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Adding support for CockroachDB (Postgres fork)
This commit is contained in:
@@ -7,10 +7,14 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import hashDBRetrieve
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import FORK
|
||||
from lib.core.enums import HASHDB_KEYS
|
||||
from lib.core.enums import OS
|
||||
from lib.core.session import setDbms
|
||||
from lib.core.settings import PGSQL_ALIASES
|
||||
@@ -22,6 +26,12 @@ class Fingerprint(GenericFingerprint):
|
||||
GenericFingerprint.__init__(self, DBMS.PGSQL)
|
||||
|
||||
def getFingerprint(self):
|
||||
fork = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
|
||||
|
||||
if fork is None:
|
||||
fork = inject.checkBooleanExpression("VERSION() LIKE '%CockroachDB%'") and FORK.COCKROACHDB or ""
|
||||
hashDBWrite(HASHDB_KEYS.DBMS_FORK, fork)
|
||||
|
||||
value = ""
|
||||
wsOsFp = Format.getOs("web server", kb.headersFp)
|
||||
|
||||
@@ -38,6 +48,8 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
if not conf.extensiveFp:
|
||||
value += DBMS.PGSQL
|
||||
if fork:
|
||||
value += " (%s fork)" % fork
|
||||
return value
|
||||
|
||||
actVer = Format.getDbms()
|
||||
@@ -56,6 +68,9 @@ class Fingerprint(GenericFingerprint):
|
||||
if htmlErrorFp:
|
||||
value += "\n%shtml error message fingerprint: %s" % (blank, htmlErrorFp)
|
||||
|
||||
if fork:
|
||||
value += "\n%sfork fingerprint: %s" % (blank, fork)
|
||||
|
||||
return value
|
||||
|
||||
def checkDbms(self):
|
||||
|
||||
Reference in New Issue
Block a user