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

Skip to content

Commit 3779531

Browse files
committed
Adding support for TiDB
1 parent 447e5ec commit 3779531

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

lib/core/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def adjustLateValues(self, payload):
385385
for _ in set(re.findall(r"\[RANDSTR(?:\d+)?\]", payload, re.I)):
386386
payload = payload.replace(_, randomStr())
387387

388-
if hashDBRetrieve(HASHDB_KEYS.DBMS_FORK) == FORK.MEMSQL:
388+
if hashDBRetrieve(HASHDB_KEYS.DBMS_FORK) in (FORK.MEMSQL, FORK.TIDB):
389389
payload = re.sub(r"(?i)\bORD\(", "ASCII(", payload)
390390
payload = re.sub(r"(?i)\bMID\(", "SUBSTR(", payload)
391391
payload = re.sub(r"(?i)\bNCHAR\b", "CHAR", payload)

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class FORK(object):
7575
MARIADB = "MariaDB"
7676
MEMSQL = "MemSQL"
7777
COCKROACHDB = "CockroachDB"
78+
TIDB = "TiDB"
7879

7980
class CUSTOM_LOGGING(object):
8081
PAYLOAD = 9

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
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.1.44"
21+
VERSION = "1.4.1.45"
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)

plugins/dbms/mysql/fingerprint.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ def getFingerprint(self):
9999
fork = hashDBRetrieve(HASHDB_KEYS.DBMS_FORK)
100100

101101
if fork is None:
102-
fork = inject.checkBooleanExpression("VERSION() LIKE '%MariaDB%'") and FORK.MARIADB or ""
102+
if inject.checkBooleanExpression("VERSION() LIKE '%MariaDB%'"):
103+
fork = FORK.MARIADB
104+
elif inject.checkBooleanExpression("VERSION() LIKE '%TiDB%'"):
105+
fork = FORK.TIDB
106+
else:
107+
fork = ""
108+
103109
hashDBWrite(HASHDB_KEYS.DBMS_FORK, fork)
104110

105111
value = ""

0 commit comments

Comments
 (0)