From 452915ed4a0a214cae6413a9a10137c00fb102d4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 19 May 2021 18:20:39 +0200 Subject: [PATCH] Minor update --- lib/core/bigarray.py | 22 +++++++++++++++++++++- lib/core/settings.py | 4 ++-- plugins/dbms/mysql/fingerprint.py | 6 +++--- plugins/dbms/oracle/fingerprint.py | 2 +- plugins/dbms/postgresql/fingerprint.py | 4 +++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/lib/core/bigarray.py b/lib/core/bigarray.py index ffe754f39..da01be481 100644 --- a/lib/core/bigarray.py +++ b/lib/core/bigarray.py @@ -56,6 +56,12 @@ class BigArray(list): >>> _[20] = 0 >>> _[99999] 99999 + >>> _ += [0] + >>> _[100000] + 0 + >>> _ = _ + [1] + >>> _[-1] + 1 """ def __init__(self, items=None): @@ -69,6 +75,20 @@ class BigArray(list): for item in (items or []): self.append(item) + def __add__(self, value): + retval = BigArray(self) + + for _ in value: + retval.append(_) + + return retval + + def __iadd__(self, value): + for _ in value: + self.append(_) + + return self + def append(self, value): self.chunks[-1].append(value) @@ -145,7 +165,7 @@ class BigArray(list): self.chunks, self.filenames = state def __getitem__(self, y): - if y < 0: + while y < 0: y += len(self) index = y // self.chunk_length diff --git a/lib/core/settings.py b/lib/core/settings.py index d84780877..6825bd8b7 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.5.4" +VERSION = "1.5.5.5" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) @@ -106,7 +106,7 @@ FUZZ_UNION_ERROR_REGEX = r"(?i)data\s?type|comparable|compatible|conversion|conv FUZZ_UNION_MAX_COLUMNS = 10 # Regular expression used for recognition of generic maximum connection messages -MAX_CONNECTIONS_REGEX = r"\bmax.+?\bconnection" +MAX_CONNECTIONS_REGEX = r"\bmax.{1,100}\bconnection" # Maximum consecutive connection errors before asking the user if he wants to continue MAX_CONSECUTIVE_CONNECTION_ERRORS = 15 diff --git a/plugins/dbms/mysql/fingerprint.py b/plugins/dbms/mysql/fingerprint.py index 301a41a48..1b6e66545 100644 --- a/plugins/dbms/mysql/fingerprint.py +++ b/plugins/dbms/mysql/fingerprint.py @@ -45,10 +45,10 @@ class Fingerprint(GenericFingerprint): # Reference: https://dev.mysql.com/doc/relnotes/mysql/./en/ versions = ( - (80000, 80021), # MySQL 8.0 + (80000, 80028), # MySQL 8.0 (60000, 60014), # MySQL 6.0 - (50700, 50731), # MySQL 5.7 - (50600, 50649), # MySQL 5.6 + (50700, 50736), # MySQL 5.7 + (50600, 50652), # MySQL 5.6 (50500, 50563), # MySQL 5.5 (50400, 50404), # MySQL 5.4 (50100, 50174), # MySQL 5.1 diff --git a/plugins/dbms/oracle/fingerprint.py b/plugins/dbms/oracle/fingerprint.py index 3e471ca62..cf9bd3a10 100644 --- a/plugins/dbms/oracle/fingerprint.py +++ b/plugins/dbms/oracle/fingerprint.py @@ -105,7 +105,7 @@ class Fingerprint(GenericFingerprint): logger.info(infoMsg) # Reference: https://en.wikipedia.org/wiki/Oracle_Database - for version in ("19c", "18c", "12c", "11g", "10g", "9i", "8i", "7"): + for version in ("21c", "19c", "18c", "12c", "11g", "10g", "9i", "8i", "7"): number = int(re.search(r"([\d]+)", version).group(1)) output = inject.checkBooleanExpression("%d=(SELECT SUBSTR((VERSION),1,%d) FROM SYS.PRODUCT_COMPONENT_VERSION WHERE ROWNUM=1)" % (number, 1 if number < 10 else 2)) diff --git a/plugins/dbms/postgresql/fingerprint.py b/plugins/dbms/postgresql/fingerprint.py index 9cf301db1..f7fa57c65 100644 --- a/plugins/dbms/postgresql/fingerprint.py +++ b/plugins/dbms/postgresql/fingerprint.py @@ -131,7 +131,9 @@ class Fingerprint(GenericFingerprint): infoMsg = "actively fingerprinting %s" % DBMS.PGSQL logger.info(infoMsg) - if inject.checkBooleanExpression("SINH(0)=0"): + if inject.checkBooleanExpression("GEN_RANDOM_UUID() IS NOT NULL"): + Backend.setVersion(">= 13.0") + elif inject.checkBooleanExpression("SINH(0)=0"): Backend.setVersion(">= 12.0") elif inject.checkBooleanExpression("SHA256(NULL) IS NULL"): Backend.setVersion(">= 11.0")