mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-15 18:52:31 +03:00
minor update
This commit is contained in:
parent
685a8e7d2c
commit
70f6eab715
lib
plugins/dbms
firebird
maxdb
oracle
postgresql
sqlite
sybase
|
@ -528,7 +528,7 @@ class Agent:
|
||||||
fromFrom = limitedQuery[fromIndex+1:]
|
fromFrom = limitedQuery[fromIndex+1:]
|
||||||
orderBy = False
|
orderBy = False
|
||||||
|
|
||||||
if kb.dbms in ( "MySQL", "PostgreSQL", "SQLite" ):
|
if kb.dbms in ( DBMS.MYSQL, DBMS.POSTGRESQL, DBMS.SQLITE ):
|
||||||
limitStr = queries[kb.dbms].limit.query % (num, 1)
|
limitStr = queries[kb.dbms].limit.query % (num, 1)
|
||||||
limitedQuery += " %s" % limitStr
|
limitedQuery += " %s" % limitStr
|
||||||
|
|
||||||
|
|
|
@ -711,18 +711,18 @@ def parseTargetDirect():
|
||||||
errMsg += "or 'access://DATABASE_FILEPATH'"
|
errMsg += "or 'access://DATABASE_FILEPATH'"
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
dbmsDict = { "Microsoft SQL Server": [MSSQL_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"],
|
dbmsDict = { DBMS.MSSQL: [MSSQL_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"],
|
||||||
"MySQL": [MYSQL_ALIASES, "python-mysqldb", "http://mysql-python.sourceforge.net/"],
|
DBMS.MYSQL: [MYSQL_ALIASES, "python-mysqldb", "http://mysql-python.sourceforge.net/"],
|
||||||
"PostgreSQL": [PGSQL_ALIASES, "python-psycopg2", "http://initd.org/psycopg/"],
|
DBMS.POSTGRESQL: [PGSQL_ALIASES, "python-psycopg2", "http://initd.org/psycopg/"],
|
||||||
"Oracle": [ORACLE_ALIASES, "python cx_Oracle", "http://cx-oracle.sourceforge.net/"],
|
DBMS.ORACLE: [ORACLE_ALIASES, "python cx_Oracle", "http://cx-oracle.sourceforge.net/"],
|
||||||
"SQLite": [SQLITE_ALIASES, "python-pysqlite2", "http://pysqlite.googlecode.com/"],
|
DBMS.SQLITE: [SQLITE_ALIASES, "python-pysqlite2", "http://pysqlite.googlecode.com/"],
|
||||||
"Access": [ACCESS_ALIASES, "python-pyodbc", "http://pyodbc.googlecode.com/"],
|
DBMS.ACCESS: [ACCESS_ALIASES, "python-pyodbc", "http://pyodbc.googlecode.com/"],
|
||||||
"Firebird": [FIREBIRD_ALIASES, "python-kinterbasdb", "http://kinterbasdb.sourceforge.net/"] }
|
DBMS.FIREBIRD: [FIREBIRD_ALIASES, "python-kinterbasdb", "http://kinterbasdb.sourceforge.net/"] }
|
||||||
|
|
||||||
for dbmsName, data in dbmsDict.items():
|
for dbmsName, data in dbmsDict.items():
|
||||||
if conf.dbms in data[0]:
|
if conf.dbms in data[0]:
|
||||||
try:
|
try:
|
||||||
if dbmsName in ('Access', 'SQLite', 'Firebird'):
|
if dbmsName in (DBMS.ACCESS, DBMS.SQLITE, DBMS.FIREBIRD):
|
||||||
if remote:
|
if remote:
|
||||||
warnMsg = "direct connection over the network for "
|
warnMsg = "direct connection over the network for "
|
||||||
warnMsg += "%s DBMS is not supported" % dbmsName
|
warnMsg += "%s DBMS is not supported" % dbmsName
|
||||||
|
@ -734,7 +734,7 @@ def parseTargetDirect():
|
||||||
errMsg = "missing remote connection details"
|
errMsg = "missing remote connection details"
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
if dbmsName == "Microsoft SQL Server":
|
if dbmsName == DBMS.MSSQL:
|
||||||
import _mssql
|
import _mssql
|
||||||
import pymssql
|
import pymssql
|
||||||
|
|
||||||
|
@ -744,17 +744,17 @@ def parseTargetDirect():
|
||||||
errMsg += "http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/"
|
errMsg += "http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/"
|
||||||
raise sqlmapMissingDependence, errMsg
|
raise sqlmapMissingDependence, errMsg
|
||||||
|
|
||||||
elif dbmsName == "MySQL":
|
elif dbmsName == DBMS.MYSQL:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
elif dbmsName == "PostgreSQL":
|
elif dbmsName == DBMS.POSTGRESQL:
|
||||||
import psycopg2
|
import psycopg2
|
||||||
elif dbmsName == "Oracle":
|
elif dbmsName == DBMS.ORACLE:
|
||||||
import cx_Oracle
|
import cx_Oracle
|
||||||
elif dbmsName == "SQLite":
|
elif dbmsName == DBMS.SQLITE:
|
||||||
import sqlite3
|
import sqlite3
|
||||||
elif dbmsName == "Access":
|
elif dbmsName == DBMS.ACCESS:
|
||||||
import pyodbc
|
import pyodbc
|
||||||
elif dbmsName == "Firebird":
|
elif dbmsName == DBMS.FIREBIRD:
|
||||||
import kinterbasdb
|
import kinterbasdb
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
errMsg = "sqlmap requires '%s' third-party library " % data[1]
|
errMsg = "sqlmap requires '%s' third-party library " % data[1]
|
||||||
|
@ -904,7 +904,7 @@ def parseUnionPage(output, expression, partial=False, condition=None, sort=True)
|
||||||
def getDelayQuery(andCond=False):
|
def getDelayQuery(andCond=False):
|
||||||
query = None
|
query = None
|
||||||
|
|
||||||
if kb.dbms in ("MySQL", "PostgreSQL"):
|
if kb.dbms in (DBMS.MYSQL, DBMS.POSTGRESQL):
|
||||||
if not kb.data.banner:
|
if not kb.data.banner:
|
||||||
conf.dbmsHandler.getVersionFromBanner()
|
conf.dbmsHandler.getVersionFromBanner()
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ from lib.core.data import logger
|
||||||
from lib.core.data import queries
|
from lib.core.data import queries
|
||||||
from lib.core.unescaper import unescaper
|
from lib.core.unescaper import unescaper
|
||||||
from lib.techniques.blind.inference import bisection
|
from lib.techniques.blind.inference import bisection
|
||||||
|
from lib.core.settings import DBMS
|
||||||
from lib.core.settings import DUMP_START_MARKER
|
from lib.core.settings import DUMP_START_MARKER
|
||||||
from lib.core.settings import DUMP_STOP_MARKER
|
from lib.core.settings import DUMP_STOP_MARKER
|
||||||
from lib.core.settings import DUMP_DEL_MARKER
|
from lib.core.settings import DUMP_DEL_MARKER
|
||||||
|
@ -58,7 +59,7 @@ def queryOutputLength(expression, payload):
|
||||||
if selectDistinctExpr:
|
if selectDistinctExpr:
|
||||||
lengthExpr = "SELECT %s FROM (%s)" % (lengthQuery % regExpr, expression)
|
lengthExpr = "SELECT %s FROM (%s)" % (lengthQuery % regExpr, expression)
|
||||||
|
|
||||||
if kb.dbms in ( "MySQL", "PostgreSQL" ):
|
if kb.dbms in ( DBMS.MYSQL, DBMS.POSTGRESQL ):
|
||||||
lengthExpr += " AS %s" % randomStr(lowercase=True)
|
lengthExpr += " AS %s" % randomStr(lowercase=True)
|
||||||
elif select:
|
elif select:
|
||||||
lengthExpr = expression.replace(regExpr, lengthQuery % regExpr, 1)
|
lengthExpr = expression.replace(regExpr, lengthQuery % regExpr, 1)
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "Firebird"
|
value += DBMS.FIREBIRD
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp() + " (%s)" % (self.__dialectCheck())
|
actVer = formatDBMSfp() + " (%s)" % (self.__dialectCheck())
|
||||||
|
|
|
@ -87,7 +87,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "SAP MaxDB"
|
value += DBMS.MAXDB
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp() + " (%s)" % self.__versionCheck()
|
actVer = formatDBMSfp() + " (%s)" % self.__versionCheck()
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "Oracle"
|
value += DBMS.ORACLE
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp()
|
actVer = formatDBMSfp()
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "PostgreSQL"
|
value += DBMS.POSTGRESQL
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp()
|
actVer = formatDBMSfp()
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "SQLite"
|
value += DBMS.SQLITE
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp()
|
actVer = formatDBMSfp()
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Fingerprint(GenericFingerprint):
|
||||||
value += "back-end DBMS: "
|
value += "back-end DBMS: "
|
||||||
|
|
||||||
if not conf.extensiveFp:
|
if not conf.extensiveFp:
|
||||||
value += "Sybase"
|
value += DBMS.SYBASE
|
||||||
return value
|
return value
|
||||||
|
|
||||||
actVer = formatDBMSfp()
|
actVer = formatDBMSfp()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user