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

Skip to content

Commit fb95ab8

Browse files
committed
Initial commit for #3283 (fixing H2 misidentification with PgSQL and/or HSQLDB)
1 parent 9f6e04b commit fb95ab8

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.10.19"
22+
VERSION = "1.2.10.20"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

plugins/dbms/hsqldb/fingerprint.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def checkDbms(self):
106106

107107
return False
108108
else:
109+
result = inject.checkBooleanExpression("ZERO() IS 0") # Note: check for H2 DBMS (sharing majority of same functions)
110+
if result:
111+
warnMsg = "the back-end DBMS is not %s" % DBMS.HSQLDB
112+
logger.warn(warnMsg)
113+
114+
return False
115+
109116
kb.data.has_information_schema = True
110117
Backend.setVersion(">= 1.7.2")
111118
setDbms("%s 1.7.2" % DBMS.HSQLDB)

plugins/dbms/postgresql/fingerprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def checkDbms(self):
7373
infoMsg = "testing %s" % DBMS.PGSQL
7474
logger.info(infoMsg)
7575

76-
result = inject.checkBooleanExpression("[RANDNUM]::int=[RANDNUM]")
76+
result = inject.checkBooleanExpression("QUOTE_IDENT(NULL) IS NULL")
7777

7878
if result:
7979
infoMsg = "confirming %s" % DBMS.PGSQL

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
4949
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
5050
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5151
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
52-
e8b8aa7f54d6b6b57b34f933063c128f lib/core/settings.py
52+
deced6d285dcd850e4e7d8e478527729 lib/core/settings.py
5353
dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py
5454
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5555
47ad325975ab21fc9f11d90b46d0d143 lib/core/target.py
@@ -143,7 +143,7 @@ c56f2dabe88fd761a1a9a51e4d104088 plugins/dbms/firebird/syntax.py
143143
271a7f16e781d56a0a31a3d5515a1945 plugins/dbms/hsqldb/connector.py
144144
95919592e5bb83df00b99bb9e8a70977 plugins/dbms/hsqldb/enumeration.py
145145
616595e74ecb644271cbbd31815d92e0 plugins/dbms/hsqldb/filesystem.py
146-
aabc2b877a3696b99912bdf362c0fb69 plugins/dbms/hsqldb/fingerprint.py
146+
b061bdbb9159c449072fde51b444f1c0 plugins/dbms/hsqldb/fingerprint.py
147147
fd369161778d6b48d7f1f7fc14dcdb5c plugins/dbms/hsqldb/__init__.py
148148
4673ebfdce9859718c19e8a7765da8d3 plugins/dbms/hsqldb/syntax.py
149149
7c0535736215ca612756cf589adb249b plugins/dbms/hsqldb/takeover.py
@@ -186,7 +186,7 @@ bcdbd9c04d7d5a911e0e31abe1a24f0f plugins/dbms/oracle/takeover.py
186186
f99c23db4ee6a6b8c0edbf684d360ad3 plugins/dbms/postgresql/connector.py
187187
7cdb821884e5f15084d1bea7f8a50574 plugins/dbms/postgresql/enumeration.py
188188
c8bb829d45752b98e6a03817b92e0fe5 plugins/dbms/postgresql/filesystem.py
189-
c490b23b19e40e15cfbdbb026386bbd7 plugins/dbms/postgresql/fingerprint.py
189+
1449c89fa6dac9b62e814cc65233b9de plugins/dbms/postgresql/fingerprint.py
190190
470860d3e85d11a67f2220bffaa415e7 plugins/dbms/postgresql/__init__.py
191191
20e6f48f496348be45f3402ebc265dbb plugins/dbms/postgresql/syntax.py
192192
1287acf330da86a93c8e64aff46e3b65 plugins/dbms/postgresql/takeover.py

0 commit comments

Comments
 (0)