File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1529,6 +1529,8 @@ def cleanQuery(query):
15291529
15301530 >>> cleanQuery("select id from users")
15311531 'SELECT id FROM users'
1532+ >>> cleanQuery("select a from selected where b='from'")
1533+ "SELECT a FROM selected WHERE b='from'"
15321534 """
15331535
15341536 retVal = query
@@ -1544,10 +1546,11 @@ def cleanQuery(query):
15441546 if not candidate or candidate .lower () not in queryLower :
15451547 continue
15461548
1547- queryMatch = re .search (r"(?i)\b(%s)\b" % candidate , query )
1548-
1549- if queryMatch and "sys_exec" not in query :
1550- retVal = retVal .replace (queryMatch .group (1 ), candidate .upper ())
1549+ if "sys_exec" not in query :
1550+ # NOTE: the leading branch consumes whole quoted parts (hence keeping keyword-alike data
1551+ # and case sensitive quoted identifiers intact), while the keyword itself is switched only
1552+ # at word boundaries (e.g. 'selected' must not turn into 'SELECTed')
1553+ retVal = re .sub (r"(?i)('[^']*'|\"[^\"]*\")|\b%s\b" % candidate , lambda match : match .group (1 ) or candidate .upper (), retVal )
15511554
15521555 return retVal
15531556
Original file line number Diff line number Diff line change 2020from thirdparty import six
2121
2222# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23- VERSION = "1.10.8.53 "
23+ VERSION = "1.10.8.54 "
2424TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2525TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2626VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
You can’t perform that action at this time.
0 commit comments