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

Skip to content

Commit cc9f4b6

Browse files
committed
Minor refactoring for MariaDB
1 parent cd7c99c commit cc9f4b6

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class OPTION_TYPE:
194194

195195
class HASHDB_KEYS:
196196
DBMS = "DBMS"
197+
DBMS_FORK = "DBMS_FORK"
197198
CHECK_WAF_RESULT = "CHECK_WAF_RESULT"
198199
CONF_TMP_PATH = "CONF_TMP_PATH"
199200
KB_ABS_FILE_PATHS = "KB_ABS_FILE_PATHS"

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.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.5.25"
22+
VERSION = "1.0.5.26"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

plugins/dbms/mysql/fingerprint.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
from lib.core.common import Backend
1111
from lib.core.common import Format
1212
from lib.core.common import getUnicode
13+
from lib.core.common import hashDBRetrieve
14+
from lib.core.common import hashDBWrite
1315
from lib.core.data import conf
1416
from lib.core.data import kb
1517
from lib.core.data import logger
1618
from lib.core.enums import DBMS
19+
from lib.core.enums import HASHDB_KEYS
1720
from lib.core.enums import OS
1821
from lib.core.session import setDbms
1922
from lib.core.settings import MYSQL_ALIASES
@@ -103,8 +106,9 @@ def getFingerprint(self):
103106
value += "back-end DBMS: "
104107
actVer = Format.getDbms()
105108

106-
if inject.checkBooleanExpression("@@USERSTAT LIKE @@USERSTAT"):
107-
actVer += " (MariaDB fork)"
109+
_ = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
110+
if _:
111+
actVer += " (%s fork)" % _
108112

109113
if not conf.extensiveFp:
110114
value += actVer
@@ -180,6 +184,9 @@ def checkDbms(self):
180184

181185
return False
182186

187+
if hashDBRetrieve(HASHDB_KEYS.DBMS_FORK) is None:
188+
hashDBWrite(HASHDB_KEYS.DBMS_FORK, inject.checkBooleanExpression("@@USERSTAT LIKE @@USERSTAT") and "MariaDB" or "")
189+
183190
# reading information_schema on some platforms is causing annoying timeout exits
184191
# Reference: http://bugs.mysql.com/bug.php?id=15855
185192

0 commit comments

Comments
 (0)