mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 04:53:48 +03:00
minor refactoring
This commit is contained in:
parent
fec88f6a6d
commit
acb986ae80
|
@ -246,3 +246,6 @@ MAX_RATIO = 1.0
|
||||||
|
|
||||||
# Character used for marking injectable position inside URI
|
# Character used for marking injectable position inside URI
|
||||||
URI_INJECTION_MARK_CHAR = '*'
|
URI_INJECTION_MARK_CHAR = '*'
|
||||||
|
|
||||||
|
# Maximum length used for retrieving data over MySQL error based payload due to "known" problems with longer result strings
|
||||||
|
MYSQL_ERROR_TRIM_LENGTH = 100
|
||||||
|
|
|
@ -29,6 +29,7 @@ from lib.core.enums import DBMS
|
||||||
from lib.core.enums import EXPECTED
|
from lib.core.enums import EXPECTED
|
||||||
from lib.core.enums import PAYLOAD
|
from lib.core.enums import PAYLOAD
|
||||||
from lib.core.settings import FROM_TABLE
|
from lib.core.settings import FROM_TABLE
|
||||||
|
from lib.core.settings import MYSQL_ERROR_TRIM_LENGTH
|
||||||
from lib.core.unescaper import unescaper
|
from lib.core.unescaper import unescaper
|
||||||
from lib.request.connect import Connect as Request
|
from lib.request.connect import Connect as Request
|
||||||
from lib.utils.resume import resume
|
from lib.utils.resume import resume
|
||||||
|
@ -43,7 +44,7 @@ def __oneShotErrorUse(expression, field):
|
||||||
|
|
||||||
if Backend.getIdentifiedDbms() == DBMS.MYSQL:
|
if Backend.getIdentifiedDbms() == DBMS.MYSQL:
|
||||||
# Fix for MySQL odd behaviour ('Subquery returns more than 1 row')
|
# Fix for MySQL odd behaviour ('Subquery returns more than 1 row')
|
||||||
nulledCastedField = nulledCastedField.replace("AS CHAR)", "AS CHAR(100))")
|
nulledCastedField = nulledCastedField.replace("AS CHAR)", "AS CHAR(%d))" % MYSQL_ERROR_TRIM_LENGTH)
|
||||||
|
|
||||||
# Forge the error-based SQL injection request
|
# Forge the error-based SQL injection request
|
||||||
vector = agent.cleanupPayload(kb.injection.data[PAYLOAD.TECHNIQUE.ERROR].vector)
|
vector = agent.cleanupPayload(kb.injection.data[PAYLOAD.TECHNIQUE.ERROR].vector)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user