diff --git a/lib/core/agent.py b/lib/core/agent.py index bbd90466f..e2c8eac70 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -274,7 +274,7 @@ class Agent(object): where = kb.injection.data[kb.technique].where if where is None else where comment = kb.injection.data[kb.technique].comment if comment is None else comment - if Backend.getIdentifiedDbms() == DBMS.ACCESS and comment == GENERIC_SQL_COMMENT: + if Backend.getIdentifiedDbms() == DBMS.ACCESS and "--" in comment: comment = queries[DBMS.ACCESS].comment.query if comment is not None: @@ -297,7 +297,7 @@ class Agent(object): _ = ( ("[DELIMITER_START]", kb.chars.start), ("[DELIMITER_STOP]", kb.chars.stop),\ ("[AT_REPLACE]", kb.chars.at), ("[SPACE_REPLACE]", kb.chars.space), ("[DOLLAR_REPLACE]", kb.chars.dollar),\ - ("[HASH_REPLACE]", kb.chars.hash_), + ("[HASH_REPLACE]", kb.chars.hash_), ("[GENERIC_SQL_COMMENT]", GENERIC_SQL_COMMENT) ) payload = reduce(lambda x, y: x.replace(y[0], y[1]), _, payload) diff --git a/lib/core/settings.py b/lib/core/settings.py index 99eb7b8a4..ea4efeed6 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.4.6" +VERSION = "1.0.4.7" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") @@ -578,7 +578,7 @@ MAX_BISECTION_LENGTH = 50 * 1024 * 1024 LARGE_CHUNK_TRIM_MARKER = "__TRIMMED_CONTENT__" # Generic SQL comment formation -GENERIC_SQL_COMMENT = "-- -" +GENERIC_SQL_COMMENT = "-- [RANDSTR]" # Threshold value for turning back on time auto-adjustment mechanism VALID_TIME_CHARS_RUN_THRESHOLD = 100 diff --git a/xml/boundaries.xml b/xml/boundaries.xml index a0731df2b..264eb88e8 100644 --- a/xml/boundaries.xml +++ b/xml/boundaries.xml @@ -89,7 +89,7 @@ Formats: 1,2 2 ') - + [GENERIC_SQL_COMMENT] @@ -98,7 +98,7 @@ Formats: 1,2 2 ' - + [GENERIC_SQL_COMMENT] @@ -107,7 +107,7 @@ Formats: 1,2 4 " - + [GENERIC_SQL_COMMENT] @@ -406,7 +406,7 @@ Formats: 1,2 1 - -- [RANDSTR] + [GENERIC_SQL_COMMENT] @@ -426,7 +426,7 @@ Formats: 1,2 2 ') WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -435,7 +435,7 @@ Formats: 1,2 2 ") WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -444,7 +444,7 @@ Formats: 1,2 1 ) WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -453,7 +453,7 @@ Formats: 1,2 2 ' WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -462,7 +462,7 @@ Formats: 1,2 4 " WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -471,7 +471,7 @@ Formats: 1,2 1 WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -482,7 +482,7 @@ Formats: 1,2 2 ')) AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -491,7 +491,7 @@ Formats: 1,2 2 ")) AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -500,7 +500,7 @@ Formats: 1,2 1 )) AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -509,7 +509,7 @@ Formats: 1,2 2 ') AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -518,7 +518,7 @@ Formats: 1,2 4 ") AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -527,7 +527,7 @@ Formats: 1,2 1 ) AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -536,7 +536,7 @@ Formats: 1 1 ` WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] @@ -545,7 +545,7 @@ Formats: 1 1 `) WHERE [RANDNUM]=[RANDNUM] - -- + [GENERIC_SQL_COMMENT] diff --git a/xml/payloads/01_boolean_blind.xml b/xml/payloads/01_boolean_blind.xml index 386e167f4..6c85eb582 100644 --- a/xml/payloads/01_boolean_blind.xml +++ b/xml/payloads/01_boolean_blind.xml @@ -212,7 +212,7 @@ Tag: AND [INFERENCE] AND [RANDNUM]=[RANDNUM] - -- - + [GENERIC_SQL_COMMENT] AND [RANDNUM]=[RANDNUM1] @@ -229,7 +229,7 @@ Tag: OR [INFERENCE] OR [RANDNUM]=[RANDNUM] - -- - + [GENERIC_SQL_COMMENT] OR [RANDNUM]=[RANDNUM1] @@ -246,7 +246,7 @@ Tag: OR NOT [INFERENCE] OR NOT [RANDNUM]=[RANDNUM] - -- - + [GENERIC_SQL_COMMENT] OR NOT [RANDNUM]=[RANDNUM1] diff --git a/xml/payloads/06_union_query.xml b/xml/payloads/06_union_query.xml index 507bf0845..ebbbe7dd8 100644 --- a/xml/payloads/06_union_query.xml +++ b/xml/payloads/06_union_query.xml @@ -12,7 +12,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] [COLSTART]-[COLSTOP] @@ -31,7 +31,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL [COLSTART]-[COLSTOP] @@ -50,7 +50,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] [COLSTART]-[COLSTOP] @@ -69,7 +69,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] 1-10 @@ -88,7 +88,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL 1-10 @@ -107,7 +107,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] 1-10 @@ -126,7 +126,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] 11-20 @@ -145,7 +145,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL 11-20 @@ -164,7 +164,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] 11-20 @@ -183,7 +183,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] 21-30 @@ -202,7 +202,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL 21-30 @@ -221,7 +221,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] 21-30 @@ -240,7 +240,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] 31-40 @@ -259,7 +259,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL 31-40 @@ -278,7 +278,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] 31-40 @@ -297,7 +297,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [CHAR] 41-50 @@ -315,7 +315,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] NULL 41-50 @@ -334,7 +334,7 @@ [UNION] - -- - + [GENERIC_SQL_COMMENT] [RANDNUM] 41-50