@@ -148,7 +148,6 @@ def checkSqlInjection(place, parameter, value):
148148
149149 # Skip test if it does not match the same SQL injection clause
150150 # already identified by another test
151- # Parse test's <clause>
152151 clauseMatch = False
153152
154153 for clauseTest in clause :
@@ -157,7 +156,7 @@ def checkSqlInjection(place, parameter, value):
157156 break
158157
159158 if clause != [ 0 ] and injection .clause and not clauseMatch :
160- debugMsg = "skipping test '%s' because the clause " % title
159+ debugMsg = "skipping test '%s' because the clauses " % title
161160 debugMsg += "differs from the clause already identified"
162161 logger .debug (debugMsg )
163162 continue
@@ -171,6 +170,11 @@ def checkSqlInjection(place, parameter, value):
171170 fstPayload = unescapeDbms (fstPayload , injection , dbms )
172171 fstPayload = "%s%s" % (fstPayload , comment )
173172
173+ if stype != 4 and clause != [2 , 3 ] and clause != [ 2 ]:
174+ space = " "
175+ else :
176+ space = ""
177+
174178 if conf .prefix is not None and conf .suffix is not None :
175179 # Create a custom boundary object for user's supplied prefix
176180 # and suffix
@@ -260,7 +264,7 @@ def checkSqlInjection(place, parameter, value):
260264 # Forge request payload by prepending with boundary's
261265 # prefix and appending the boundary's suffix to the
262266 # test's ' <payload><comment> ' string
263- boundPayload = "%s%s%s%s %s" % (origValue , prefix , ( " " if stype != 4 else "" ) , fstPayload , suffix )
267+ boundPayload = "%s%s%s%s %s" % (origValue , prefix , space , fstPayload , suffix )
264268 boundPayload = boundPayload .strip ()
265269 boundPayload = agent .cleanupPayload (boundPayload , value )
266270 reqPayload = agent .payload (place , parameter , value , boundPayload )
@@ -281,7 +285,7 @@ def checkSqlInjection(place, parameter, value):
281285 # boundary's prefix and appending the boundary's
282286 # suffix to the test's ' <payload><comment> '
283287 # string
284- boundPayload = "%s%s%s%s %s" % (origValue , prefix , ( " " if stype != 4 else "" ) , sndPayload , suffix )
288+ boundPayload = "%s%s%s%s %s" % (origValue , prefix , space , sndPayload , suffix )
285289 boundPayload = boundPayload .strip ()
286290 boundPayload = agent .cleanupPayload (boundPayload , value )
287291 cmpPayload = agent .payload (place , parameter , value , boundPayload )
@@ -359,7 +363,7 @@ def checkSqlInjection(place, parameter, value):
359363 injection .suffix = suffix
360364 injection .clause = clause
361365
362- if "epayload" in test :
366+ if "epayload" in test and test . epayload is not None :
363367 epayload = "%s%s" % (test .epayload , comment )
364368 else :
365369 epayload = None
0 commit comments