Skip to content

Commit b0a8238

Browse files
committed
minor fixes
1 parent 9fa3619 commit b0a8238

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/controller/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __formatInjection(inj):
131131
title = sdata.title
132132
vector = sdata.vector
133133
if stype == PAYLOAD.TECHNIQUE.UNION:
134-
count = re.sub(r"\(.+\)", "", sdata.payload).count(",") + 1
134+
count = re.sub(r"(?i)(\(.+\))|(\blimit[^A-Za-z]+)", "", sdata.payload).count(',') + 1
135135
title = re.sub(r"\d+ to \d+", str(count), title)
136136
vector = agent.forgeInbandQuery("[QUERY]", vector[0], vector[1], vector[2], None, None, vector[5], vector[6])
137137
if count == 1:

lib/techniques/union/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def __unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYL
208208

209209
unionErrorCase = kb.errorIsNone and wasLastRequestDBMSError()
210210

211-
if unionErrorCase:
211+
if unionErrorCase and count > 1:
212212
warnMsg = "combined UNION/error-based SQL injection case found on "
213213
warnMsg += "column %d. sqlmap will try to find another " % (position + 1)
214214
warnMsg += "column with better characteristics"
@@ -273,7 +273,7 @@ def __unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix
273273
warnMsg += "forcing the "
274274
warnMsg += "back-end DBMS (e.g. --dbms=mysql) "
275275

276-
if not all([validPayload, vector]):
276+
if not all([validPayload, vector]) and not warnMsg.endswith("consider "):
277277
singleTimeWarnMessage(warnMsg)
278278

279279
return validPayload, vector

0 commit comments

Comments
 (0)