Minor code consistency patch

This commit is contained in:
Miroslav Stampar 2015-08-26 11:30:48 +02:00
parent 1f5e6606a7
commit 2c2f83f67b

View File

@ -64,11 +64,11 @@ def _oneShotErrorUse(expression, field=None):
threadData.resumed = retVal is not None and not partialValue
if Backend.isDbms(DBMS.MYSQL):
chunk_length = MYSQL_ERROR_CHUNK_LENGTH
chunkLength = MYSQL_ERROR_CHUNK_LENGTH
elif Backend.isDbms(DBMS.MSSQL):
chunk_length = MSSQL_ERROR_CHUNK_LENGTH
chunkLength = MSSQL_ERROR_CHUNK_LENGTH
else:
chunk_length = None
chunkLength = None
if retVal is None or partialValue:
try:
@ -84,7 +84,7 @@ def _oneShotErrorUse(expression, field=None):
if extendedField != field: # e.g. MIN(surname)
nulledCastedField = extendedField.replace(field, nulledCastedField)
field = extendedField
nulledCastedField = queries[Backend.getIdentifiedDbms()].substring.query % (nulledCastedField, offset, chunk_length)
nulledCastedField = queries[Backend.getIdentifiedDbms()].substring.query % (nulledCastedField, offset, chunkLength)
# Forge the error-based SQL injection request
vector = kb.injection.data[kb.technique].vector
@ -146,8 +146,8 @@ def _oneShotErrorUse(expression, field=None):
else:
retVal += output if output else ''
if output and len(output) >= chunk_length:
offset += chunk_length
if output and len(output) >= chunkLength:
offset += chunkLength
else:
break