@@ -115,7 +115,7 @@ def _orderByTest(cols):
115115
116116 if not isNullValue (kb .uChar ):
117117 for regex in (kb .uChar , r'>\s*%s\s*<' % kb .uChar ):
118- contains = [( count , re .search (regex , _ or "" , re .IGNORECASE ) is not None ) for count , _ in pages .items ()]
118+ contains = (( count , re .search (regex , _ or "" , re .IGNORECASE ) is not None ) for count , _ in pages .items ())
119119 if len (filter (lambda _ : _ [1 ], contains )) == 1 :
120120 retVal = filter (lambda _ : _ [1 ], contains )[0 ][0 ]
121121 break
@@ -178,7 +178,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
178178 for position in positions :
179179 # Prepare expression with delimiters
180180 randQuery = randomStr (charCount )
181- phrase = "%s%s%s" . lower () % (kb .chars .start , randQuery , kb .chars .stop )
181+ phrase = ( "%s%s%s" % (kb .chars .start , randQuery , kb .chars .stop )). lower ( )
182182 randQueryProcessed = agent .concatQuery ("\' %s\' " % randQuery )
183183 randQueryUnescaped = unescaper .escape (randQueryProcessed )
184184
@@ -188,9 +188,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
188188
189189 # Perform the request
190190 page , headers , _ = Request .queryPage (payload , place = place , content = True , raise404 = False )
191- content = "%s%s" .lower () % (removeReflectiveValues (page , payload ) or "" , \
192- removeReflectiveValues (listToStrValue (headers .headers if headers else None ), \
193- payload , True ) or "" )
191+ content = ("%s%s" % (removeReflectiveValues (page , payload ) or "" , removeReflectiveValues (listToStrValue (headers .headers if headers else None ), payload , True ) or "" )).lower ()
194192
195193 if content and phrase in content :
196194 validPayload = payload
@@ -200,7 +198,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
200198 if where == PAYLOAD .WHERE .ORIGINAL :
201199 # Prepare expression with delimiters
202200 randQuery2 = randomStr (charCount )
203- phrase2 = "%s%s%s" . lower () % (kb .chars .start , randQuery2 , kb .chars .stop )
201+ phrase2 = ( "%s%s%s" % (kb .chars .start , randQuery2 , kb .chars .stop )). lower ( )
204202 randQueryProcessed2 = agent .concatQuery ("\' %s\' " % randQuery2 )
205203 randQueryUnescaped2 = unescaper .escape (randQueryProcessed2 )
206204
@@ -210,7 +208,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
210208
211209 # Perform the request
212210 page , headers , _ = Request .queryPage (payload , place = place , content = True , raise404 = False )
213- content = "%s%s" . lower () % (page or "" , listToStrValue (headers .headers if headers else None ) or "" )
211+ content = ( "%s%s" % (page or "" , listToStrValue (headers .headers if headers else None ) or "" )). lower ( )
214212
215213 if not all (_ in content for _ in (phrase , phrase2 )):
216214 vector = (position , count , comment , prefix , suffix , kb .uChar , where , kb .unionDuplicates , True )
@@ -223,9 +221,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
223221
224222 # Perform the request
225223 page , headers , _ = Request .queryPage (payload , place = place , content = True , raise404 = False )
226- content = "%s%s" .lower () % (removeReflectiveValues (page , payload ) or "" , \
227- removeReflectiveValues (listToStrValue (headers .headers if headers else None ), \
228- payload , True ) or "" )
224+ content = ("%s%s" % (removeReflectiveValues (page , payload ) or "" , removeReflectiveValues (listToStrValue (headers .headers if headers else None ), payload , True ) or "" )).lower ()
229225 if content .count (phrase ) > 0 and content .count (phrase ) < LIMITED_ROWS_TEST_NUMBER :
230226 warnMsg = "output with limited number of rows detected. Switching to partial mode"
231227 logger .warn (warnMsg )
@@ -277,7 +273,7 @@ def _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
277273 if count :
278274 validPayload , vector = _unionConfirm (comment , place , parameter , prefix , suffix , count )
279275
280- if not all ([ validPayload , vector ]) and not all ([ conf .uChar , conf .dbms ] ):
276+ if not all (( validPayload , vector )) and not all (( conf .uChar , conf .dbms ) ):
281277 warnMsg = "if UNION based SQL injection is not detected, "
282278 warnMsg += "please consider "
283279
@@ -298,7 +294,7 @@ def _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
298294 warnMsg += "forcing the "
299295 warnMsg += "back-end DBMS (e.g. '--dbms=mysql') "
300296
301- if not all ([ validPayload , vector ] ) and not warnMsg .endswith ("consider " ):
297+ if not all (( validPayload , vector ) ) and not warnMsg .endswith ("consider " ):
302298 singleTimeWarnMessage (warnMsg )
303299
304300 return validPayload , vector
0 commit comments