mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-28 20:43:49 +03:00
Same refactoring as the last commit
This commit is contained in:
parent
0cc6e68be2
commit
7e1ff1bb8e
|
@ -125,7 +125,6 @@ from lib.core.settings import SUPPORTED_DBMS
|
|||
from lib.core.settings import TEXT_TAG_REGEX
|
||||
from lib.core.settings import TIME_STDEV_COEFF
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.core.settings import UNKNOWN_DBMS
|
||||
from lib.core.settings import UNKNOWN_DBMS_VERSION
|
||||
from lib.core.settings import URI_QUESTION_MARKER
|
||||
from lib.core.settings import URLENCODE_CHAR_LIMIT
|
||||
|
|
|
@ -10,7 +10,6 @@ import re
|
|||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import getCurrentThreadData
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import wasLastResponseDBMSError
|
||||
from lib.core.data import conf
|
||||
|
@ -67,8 +66,7 @@ class Fingerprint(GenericFingerprint):
|
|||
negate = True
|
||||
table = table[1:]
|
||||
|
||||
randInt = randomInt()
|
||||
result = inject.checkBooleanExpression("EXISTS(SELECT * FROM %s WHERE %d=%d)" % (table, randInt, randInt))
|
||||
result = inject.checkBooleanExpression("EXISTS(SELECT * FROM %s WHERE [RANDNUM]=[RANDNUM])" % table)
|
||||
if result is None:
|
||||
result = False
|
||||
|
||||
|
@ -91,9 +89,8 @@ class Fingerprint(GenericFingerprint):
|
|||
infoMsg = "searching for database directory"
|
||||
logger.info(infoMsg)
|
||||
|
||||
randInt = randomInt()
|
||||
randStr = randomStr()
|
||||
inject.checkBooleanExpression("EXISTS(SELECT * FROM %s.%s WHERE %d=%d)" % (randStr, randStr, randInt, randInt))
|
||||
inject.checkBooleanExpression("EXISTS(SELECT * FROM %s.%s WHERE [RANDNUM]=[RANDNUM])" % (randStr, randStr))
|
||||
|
||||
if wasLastResponseDBMSError():
|
||||
threadData = getCurrentThreadData()
|
||||
|
|
|
@ -8,7 +8,6 @@ See the file 'doc/COPYING' for copying permission
|
|||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
|
@ -90,8 +89,7 @@ class Fingerprint(GenericFingerprint):
|
|||
logMsg = "testing %s" % DBMS.DB2
|
||||
logger.info(logMsg)
|
||||
|
||||
randInt = randomInt()
|
||||
result = inject.checkBooleanExpression("%d=(SELECT %d FROM SYSIBM.SYSDUMMY1)" % (randInt, randInt))
|
||||
result = inject.checkBooleanExpression("[RANDNUM]=(SELECT [RANDNUM] FROM SYSIBM.SYSDUMMY1)")
|
||||
|
||||
if result:
|
||||
logMsg = "confirming %s" % DBMS.DB2
|
||||
|
|
|
@ -10,7 +10,6 @@ import re
|
|||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.common import randomRange
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
|
@ -122,8 +121,7 @@ class Fingerprint(GenericFingerprint):
|
|||
infoMsg = "testing %s" % DBMS.FIREBIRD
|
||||
logger.info(infoMsg)
|
||||
|
||||
randInt = randomInt()
|
||||
result = inject.checkBooleanExpression("(SELECT COUNT(*) FROM RDB$DATABASE WHERE %d=%d)>0" % (randInt, randInt))
|
||||
result = inject.checkBooleanExpression("(SELECT COUNT(*) FROM RDB$DATABASE WHERE [RANDNUM]=[RANDNUM])>0")
|
||||
|
||||
if result:
|
||||
infoMsg = "confirming %s" % DBMS.FIREBIRD
|
||||
|
|
|
@ -8,7 +8,6 @@ See the file 'doc/COPYING' for copying permission
|
|||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
|
@ -85,8 +84,7 @@ class Fingerprint(GenericFingerprint):
|
|||
if conf.direct:
|
||||
result = True
|
||||
else:
|
||||
randInt = randomInt()
|
||||
result = inject.checkBooleanExpression("BINARY_CHECKSUM(%d)=BINARY_CHECKSUM(%d)" % (randInt, randInt))
|
||||
result = inject.checkBooleanExpression("BINARY_CHECKSUM([RANDNUM])=BINARY_CHECKSUM([RANDNUM])")
|
||||
|
||||
if result:
|
||||
infoMsg = "confirming %s" % DBMS.MSSQL
|
||||
|
|
|
@ -10,7 +10,6 @@ import re
|
|||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
|
|
|
@ -7,8 +7,6 @@ See the file 'doc/COPYING' for copying permission
|
|||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import Format
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
|
@ -76,14 +74,13 @@ class Fingerprint(GenericFingerprint):
|
|||
infoMsg = "testing %s" % DBMS.PGSQL
|
||||
logger.info(infoMsg)
|
||||
|
||||
randInt = getUnicode(randomInt(1))
|
||||
result = inject.checkBooleanExpression("%s::int=%s" % (randInt, randInt))
|
||||
result = inject.checkBooleanExpression("[RANDNUM]::int=[RANDNUM]")
|
||||
|
||||
if result:
|
||||
infoMsg = "confirming %s" % DBMS.PGSQL
|
||||
logger.info(infoMsg)
|
||||
|
||||
result = inject.checkBooleanExpression("COALESCE(%s, NULL)=%s" % (randInt, randInt))
|
||||
result = inject.checkBooleanExpression("COALESCE([RANDNUM], NULL)=[RANDNUM]")
|
||||
|
||||
if not result:
|
||||
warnMsg = "the back-end DBMS is not %s" % DBMS.PGSQL
|
||||
|
|
Loading…
Reference in New Issue
Block a user