mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
some minor range to xrange conversion (where safe to do)
This commit is contained in:
@@ -33,7 +33,7 @@ class Syntax(GenericSyntax):
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "&"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
@@ -34,7 +34,7 @@ class Syntax(GenericSyntax):
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "||"
|
||||
|
||||
@@ -35,7 +35,7 @@ class Syntax(GenericSyntax):
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "ASCII_CHAR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "||"
|
||||
|
||||
@@ -122,7 +122,7 @@ class Enumeration(GenericEnumeration):
|
||||
|
||||
tables = []
|
||||
|
||||
for index in range(int(count)):
|
||||
for index in xrange(int(count)):
|
||||
query = rootQuery.blind.query % (db, index, db)
|
||||
table = inject.getValue(query, inband=False, error=False)
|
||||
kb.hintValue = table
|
||||
|
||||
@@ -161,7 +161,7 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
counter = 1
|
||||
|
||||
for i in range(0, wFileSize, debugSize):
|
||||
for i in xrange(0, wFileSize, debugSize):
|
||||
wFileChunk = wFileContent[i:i + debugSize]
|
||||
chunkName = self.updateBinChunk(wFileChunk, tmpPath)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Syntax(GenericSyntax):
|
||||
#unescaped = "("
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHAR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "+"
|
||||
|
||||
@@ -70,7 +70,7 @@ class Takeover(GenericTakeover):
|
||||
shellcodeChar = ""
|
||||
hexStr = binascii.hexlify(self.shellcodeString[:-1])
|
||||
|
||||
for hexPair in range(0, len(hexStr), 2):
|
||||
for hexPair in xrange(0, len(hexStr), 2):
|
||||
shellcodeChar += "CHAR(0x%s)+" % hexStr[hexPair:hexPair+2]
|
||||
|
||||
shellcodeChar = shellcodeChar[:-1]
|
||||
|
||||
@@ -65,7 +65,7 @@ class Filesystem(GenericFilesystem):
|
||||
if length > sustrLen:
|
||||
result = []
|
||||
|
||||
for i in range(1, length, sustrLen):
|
||||
for i in xrange(1, length, sustrLen):
|
||||
chunk = inject.getValue("SELECT MID(%s, %d, %d) FROM %s" % (self.tblField, i, sustrLen, self.fileTblName), unpack=False, sort=False, resumeValue=False, charsetType=3)
|
||||
|
||||
result.append(chunk)
|
||||
|
||||
@@ -74,7 +74,7 @@ class Fingerprint(GenericFingerprint):
|
||||
if index >= 0:
|
||||
prevVer = None
|
||||
|
||||
for version in range(versions[index][0], versions[index][1] + 1):
|
||||
for version in xrange(versions[index][0], versions[index][1] + 1):
|
||||
randInt = randomInt()
|
||||
version = getUnicode(version)
|
||||
result = inject.checkBooleanExpression("%d=%d/*!%s AND %d=%d*/" % (randInt, randInt, version, randInt, randInt + 1))
|
||||
|
||||
@@ -33,7 +33,7 @@ class Syntax(GenericSyntax):
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "%d" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += ","
|
||||
|
||||
@@ -33,7 +33,7 @@ class Syntax(GenericSyntax):
|
||||
#unescaped = "("
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "||"
|
||||
|
||||
@@ -34,7 +34,7 @@ class Syntax(GenericSyntax):
|
||||
#unescaped = "("
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "||"
|
||||
|
||||
@@ -36,7 +36,7 @@ class Syntax(GenericSyntax):
|
||||
old = "''%s''" % expression[firstIndex:lastIndex]
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "X'%x'" % ord(expression[i])
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "||"
|
||||
|
||||
@@ -104,7 +104,7 @@ class Fingerprint(GenericFingerprint):
|
||||
infoMsg = "actively fingerprinting %s" % DBMS.SYBASE
|
||||
logger.info(infoMsg)
|
||||
|
||||
for version in range(12, 16):
|
||||
for version in xrange(12, 16):
|
||||
result = inject.checkBooleanExpression("@@VERSION_NUMBER/1000=%d" % version)
|
||||
|
||||
if result:
|
||||
|
||||
@@ -34,7 +34,7 @@ class Syntax(GenericSyntax):
|
||||
#unescaped = "("
|
||||
unescaped = ""
|
||||
|
||||
for i in range(firstIndex, lastIndex):
|
||||
for i in xrange(firstIndex, lastIndex):
|
||||
unescaped += "CHAR(%d)" % (ord(expression[i]))
|
||||
if i < lastIndex - 1:
|
||||
unescaped += "+"
|
||||
|
||||
Reference in New Issue
Block a user