Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit feb1df6

Browse files
committed
Adding support for Apache Ignite (H2 fork)
1 parent 4772a92 commit feb1df6

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

lib/core/dicts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
DBMS.PRESTO: "FROM_HEX(NULL)",
248248
DBMS.ALTIBASE: "TDESENCRYPT(NULL,NULL)",
249249
DBMS.MIMERSQL: "ASCII_CHAR(256)",
250-
DBMS.CRATEDB: "(NULL~NULL)",
250+
DBMS.CRATEDB: "MD5(NULL~NULL)", # Note: NULL~NULL also being evaluated on H2 and Ignite
251251
DBMS.CUBRID: "(NULL SETEQ NULL)",
252252
}
253253

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class FORK(object):
8888
REDSHIFT = "Amazon Redshift"
8989
GREENPLUM = "Greenplum"
9090
DRIZZLE = "Drizzle"
91+
IGNITE = "Apache Ignite"
9192

9293
class CUSTOM_LOGGING(object):
9394
PAYLOAD = 9

lib/core/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.2.10"
21+
VERSION = "1.4.2.11"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -257,7 +257,7 @@
257257
SYBASE_SYSTEM_DBS = ("master", "model", "sybsystemdb", "sybsystemprocs")
258258
DB2_SYSTEM_DBS = ("NULLID", "SQLJ", "SYSCAT", "SYSFUN", "SYSIBM", "SYSIBMADM", "SYSIBMINTERNAL", "SYSIBMTS", "SYSPROC", "SYSPUBLIC", "SYSSTAT", "SYSTOOLS")
259259
HSQLDB_SYSTEM_DBS = ("INFORMATION_SCHEMA", "SYSTEM_LOB")
260-
H2_SYSTEM_DBS = ("INFORMATION_SCHEMA",)
260+
H2_SYSTEM_DBS = ("INFORMATION_SCHEMA",) + ("IGNITE", "ignite-sys-cache")
261261
INFORMIX_SYSTEM_DBS = ("sysmaster", "sysutils", "sysuser", "sysadmin")
262262
MONETDB_SYSTEM_DBS = ("tmp", "json", "profiler")
263263
DERBY_SYSTEM_DBS = ("NULLID", "SQLJ", "SYS", "SYSCAT", "SYSCS_DIAG", "SYSCS_UTIL", "SYSFUN", "SYSIBM", "SYSPROC", "SYSSTAT")
@@ -267,7 +267,7 @@
267267
ALTIBASE_SYSTEM_DBS = ("SYSTEM_",)
268268
MIMERSQL_SYSTEM_DBS = ("information_schema", "SYSTEM",)
269269
CRATEDB_SYSTEM_DBS = ("information_schema", "pg_catalog", "sys")
270-
CUBRID_SYSTEM_DBS = ("",)
270+
CUBRID_SYSTEM_DBS = ("DBA",)
271271

272272
# Note: (<regular>) + (<forks>)
273273
MSSQL_ALIASES = ("microsoft sql server", "mssqlserver", "mssql", "ms")

plugins/dbms/h2/fingerprint.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77

88
from lib.core.common import Backend
99
from lib.core.common import Format
10+
from lib.core.common import hashDBRetrieve
11+
from lib.core.common import hashDBWrite
1012
from lib.core.data import conf
1113
from lib.core.data import kb
1214
from lib.core.data import logger
1315
from lib.core.enums import DBMS
16+
from lib.core.enums import FORK
17+
from lib.core.enums import HASHDB_KEYS
1418
from lib.core.session import setDbms
1519
from lib.core.settings import H2_ALIASES
1620
from lib.request import inject
@@ -21,6 +25,16 @@ def __init__(self):
2125
GenericFingerprint.__init__(self, DBMS.H2)
2226

2327
def getFingerprint(self):
28+
fork = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
29+
30+
if fork is None:
31+
if inject.checkBooleanExpression("EXISTS(SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='IGNITE')"):
32+
fork = FORK.IGNITE
33+
else:
34+
fork = ""
35+
36+
hashDBWrite(HASHDB_KEYS.DBMS_FORK, fork)
37+
2438
value = ""
2539
wsOsFp = Format.getOs("web server", kb.headersFp)
2640

@@ -37,6 +51,8 @@ def getFingerprint(self):
3751

3852
if not conf.extensiveFp:
3953
value += DBMS.H2
54+
if fork:
55+
value += " (%s fork)" % fork
4056
return value
4157

4258
actVer = Format.getDbms()

0 commit comments

Comments
 (0)