mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
Doing some more style updating (capitalization of exception classes; using _ is enough for private members - __ is used in Python specific methods)
This commit is contained in:
@@ -14,8 +14,8 @@ import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.core.settings import IS_WIN
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
@@ -35,7 +35,7 @@ class Connector(GenericConnector):
|
||||
if not IS_WIN:
|
||||
errMsg = "currently, direct connection to Microsoft Access database(s) "
|
||||
errMsg += "is restricted to Windows platforms"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
self.initConnection()
|
||||
self.checkFileDb()
|
||||
@@ -43,7 +43,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};Dbq=%s;Uid=Admin;Pwd=;' % self.db)
|
||||
except (pyodbc.Error, pyodbc.OperationalError), msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -61,7 +61,7 @@ class Connector(GenericConnector):
|
||||
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pyodbc.Error, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on Microsoft Access it is not possible to read files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on Microsoft Access it is not possible to write files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -27,7 +27,7 @@ class Fingerprint(GenericFingerprint):
|
||||
def __init__(self):
|
||||
GenericFingerprint.__init__(self, DBMS.ACCESS)
|
||||
|
||||
def __sandBoxCheck(self):
|
||||
def _sandBoxCheck(self):
|
||||
# Reference: http://milw0rm.com/papers/198
|
||||
retVal = None
|
||||
table = None
|
||||
@@ -43,7 +43,7 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
return retVal
|
||||
|
||||
def __sysTablesCheck(self):
|
||||
def _sysTablesCheck(self):
|
||||
infoMsg = "executing system table(s) existence fingerprint"
|
||||
logger.info(infoMsg)
|
||||
|
||||
@@ -85,7 +85,7 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
return None
|
||||
|
||||
def __getDatabaseDir(self):
|
||||
def _getDatabaseDir(self):
|
||||
retVal = None
|
||||
|
||||
infoMsg = "searching for database directory"
|
||||
@@ -126,7 +126,7 @@ class Fingerprint(GenericFingerprint):
|
||||
value += DBMS.ACCESS
|
||||
return value
|
||||
|
||||
actVer = Format.getDbms() + " (%s)" % (self.__sandBoxCheck())
|
||||
actVer = Format.getDbms() + " (%s)" % (self._sandBoxCheck())
|
||||
blank = " " * 15
|
||||
value += "active fingerprint: %s" % actVer
|
||||
|
||||
@@ -144,7 +144,7 @@ class Fingerprint(GenericFingerprint):
|
||||
if htmlErrorFp:
|
||||
value += "\n%shtml error message fingerprint: %s" % (blank, htmlErrorFp)
|
||||
|
||||
value += "\ndatabase directory: '%s'" % self.__getDatabaseDir()
|
||||
value += "\ndatabase directory: '%s'" % self._getDatabaseDir()
|
||||
|
||||
return value
|
||||
|
||||
@@ -178,7 +178,7 @@ class Fingerprint(GenericFingerprint):
|
||||
infoMsg = "actively fingerprinting %s" % DBMS.ACCESS
|
||||
logger.info(infoMsg)
|
||||
|
||||
version = self.__sysTablesCheck()
|
||||
version = self._sysTablesCheck()
|
||||
|
||||
if version is not None:
|
||||
Backend.setVersion(version)
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -24,7 +24,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -56,7 +56,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on Microsoft Access it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on Microsoft Access it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on Microsoft Access it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on Microsoft Access it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -14,7 +14,7 @@ import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -35,7 +35,7 @@ class Connector(GenericConnector):
|
||||
database = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=%s;HOSTNAME=%s;PORT=%s;PROTOCOL=TCPIP;" % (self.db, self.hostname, self.port)
|
||||
self.connector = ibm_db_dbi.connect(database, self.user, self.password)
|
||||
except ibm_db_dbi.OperationalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
|
||||
self.setCursor()
|
||||
@@ -54,7 +54,7 @@ class Connector(GenericConnector):
|
||||
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except ibm_db_dbi.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class Fingerprint(GenericFingerprint):
|
||||
def __init__(self):
|
||||
GenericFingerprint.__init__(self, DBMS.DB2)
|
||||
|
||||
def __versionCheck(self):
|
||||
def _versionCheck(self):
|
||||
minor, major = None, None
|
||||
|
||||
for version in reversed(xrange(5, 15)):
|
||||
@@ -97,7 +97,7 @@ class Fingerprint(GenericFingerprint):
|
||||
logMsg = "confirming %s" % DBMS.DB2
|
||||
logger.info(logMsg)
|
||||
|
||||
version = self.__versionCheck()
|
||||
version = self._versionCheck()
|
||||
|
||||
if version:
|
||||
Backend.setVersion(version)
|
||||
|
||||
@@ -6,7 +6,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -25,7 +25,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -55,7 +55,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -14,7 +14,7 @@ import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
@@ -42,7 +42,7 @@ class Connector(GenericConnector):
|
||||
self.connector = kinterbasdb.connect(host=self.hostname.encode(UNICODE_ENCODING), database=self.db.encode(UNICODE_ENCODING), \
|
||||
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") #http://www.daniweb.com/forums/thread248499.html
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
|
||||
@@ -59,7 +59,7 @@ class Connector(GenericConnector):
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except kinterbasdb.Error, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on Firebird it is not possible to read files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on Firebird it is not possible to write files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -47,7 +47,7 @@ class Fingerprint(GenericFingerprint):
|
||||
value += actVer
|
||||
return value
|
||||
|
||||
actVer = Format.getDbms() + " (%s)" % (self.__dialectCheck())
|
||||
actVer = Format.getDbms() + " (%s)" % (self._dialectCheck())
|
||||
blank = " " * 15
|
||||
value += "active fingerprint: %s" % actVer
|
||||
|
||||
@@ -67,7 +67,7 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
return value
|
||||
|
||||
def __sysTablesCheck(self):
|
||||
def _sysTablesCheck(self):
|
||||
retVal = None
|
||||
table = (
|
||||
("1.0", ["EXISTS(SELECT CURRENT_USER FROM RDB$DATABASE)"]),
|
||||
@@ -93,7 +93,7 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
return retVal
|
||||
|
||||
def __dialectCheck(self):
|
||||
def _dialectCheck(self):
|
||||
retVal = None
|
||||
|
||||
if Backend.getIdentifiedDbms():
|
||||
@@ -141,7 +141,7 @@ class Fingerprint(GenericFingerprint):
|
||||
infoMsg = "actively fingerprinting %s" % DBMS.FIREBIRD
|
||||
logger.info(infoMsg)
|
||||
|
||||
version = self.__sysTablesCheck()
|
||||
version = self._sysTablesCheck()
|
||||
|
||||
if version is not None:
|
||||
Backend.setVersion(version)
|
||||
|
||||
@@ -6,7 +6,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -26,7 +26,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -58,7 +58,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on Firebird it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on Firebird it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on Firebird it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on Firebird it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -15,4 +15,4 @@ class Connector(GenericConnector):
|
||||
def connect(self):
|
||||
errMsg = "on SAP MaxDB it is not possible to establish a "
|
||||
errMsg += "direct connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -13,8 +13,8 @@ from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.data import queries
|
||||
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapMissingMandatoryOptionException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.core.settings import CURRENT_DB
|
||||
from lib.utils.pivotdumptable import pivotDumpTable
|
||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||
@@ -107,7 +107,7 @@ class Enumeration(GenericEnumeration):
|
||||
if ',' in conf.db:
|
||||
errMsg = "only one database name is allowed when enumerating "
|
||||
errMsg += "the tables' columns"
|
||||
raise sqlmapMissingMandatoryOptionException, errMsg
|
||||
raise SqlmapMissingMandatoryOptionException, errMsg
|
||||
|
||||
conf.db = safeSQLIdentificatorNaming(conf.db)
|
||||
|
||||
@@ -124,7 +124,7 @@ class Enumeration(GenericEnumeration):
|
||||
else:
|
||||
errMsg = "unable to retrieve the tables "
|
||||
errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
|
||||
raise sqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
|
||||
for tbl in tblList:
|
||||
tblList[tblList.index(tbl)] = safeSQLIdentificatorNaming(tbl, True)
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on SAP MaxDB reading of files is not supported"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on SAP MaxDB writing of files is not supported"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -22,7 +22,7 @@ class Fingerprint(GenericFingerprint):
|
||||
def __init__(self):
|
||||
GenericFingerprint.__init__(self, DBMS.MAXDB)
|
||||
|
||||
def __versionCheck(self):
|
||||
def _versionCheck(self):
|
||||
infoMsg = "executing %s SYSINFO version check" % DBMS.MAXDB
|
||||
logger.info(infoMsg)
|
||||
|
||||
@@ -76,7 +76,7 @@ class Fingerprint(GenericFingerprint):
|
||||
value += DBMS.MAXDB
|
||||
return value
|
||||
|
||||
actVer = Format.getDbms() + " (%s)" % self.__versionCheck()
|
||||
actVer = Format.getDbms() + " (%s)" % self._versionCheck()
|
||||
blank = " " * 15
|
||||
value += "active fingerprint: %s" % actVer
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on SAP MaxDB it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on SAP MaxDB it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on SAP MaxDB it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on SAP MaxDB it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -16,7 +16,7 @@ import logging
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -42,7 +42,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
||||
except pymssql.OperationalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -63,7 +63,7 @@ class Connector(GenericConnector):
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||
except pymssql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from lib.core.data import queries
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import EXPECTED
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.core.settings import CURRENT_DB
|
||||
from lib.request import inject
|
||||
|
||||
@@ -150,7 +150,7 @@ class Enumeration(GenericEnumeration):
|
||||
|
||||
if not kb.data.cachedTables:
|
||||
errMsg = "unable to retrieve the tables for any database"
|
||||
raise sqlmapNoneDataException(errMsg)
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
else:
|
||||
for db, tables in kb.data.cachedTables.items():
|
||||
kb.data.cachedTables[db] = sorted(tables) if tables else tables
|
||||
|
||||
@@ -21,8 +21,8 @@ from lib.core.data import logger
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import EXPECTED
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
@@ -31,7 +31,7 @@ class Filesystem(GenericFilesystem):
|
||||
def __init__(self):
|
||||
GenericFilesystem.__init__(self)
|
||||
|
||||
def __dataToScr(self, fileContent, chunkName):
|
||||
def _dataToScr(self, fileContent, chunkName):
|
||||
fileLines = []
|
||||
fileSize = len(fileContent)
|
||||
lineAddr = 0x100
|
||||
@@ -62,10 +62,10 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
return fileLines
|
||||
|
||||
def __updateDestChunk(self, fileContent, tmpPath):
|
||||
def _updateDestChunk(self, fileContent, tmpPath):
|
||||
randScr = "tmpf%s.scr" % randomStr(lowercase=True)
|
||||
chunkName = randomStr(lowercase=True)
|
||||
fileScrLines = self.__dataToScr(fileContent, chunkName)
|
||||
fileScrLines = self._dataToScr(fileContent, chunkName)
|
||||
|
||||
logger.debug("uploading debug script to %s\%s, please wait.." % (tmpPath, randScr))
|
||||
|
||||
@@ -147,7 +147,7 @@ class Filesystem(GenericFilesystem):
|
||||
if not isNumPosStrValue(count):
|
||||
errMsg = "unable to retrieve the content of the "
|
||||
errMsg += "file '%s'" % rFile
|
||||
raise sqlmapNoneDataException(errMsg)
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
|
||||
indexRange = getLimitRange(count)
|
||||
|
||||
@@ -162,9 +162,9 @@ class Filesystem(GenericFilesystem):
|
||||
def unionWriteFile(self, wFile, dFile, fileType):
|
||||
errMsg = "Microsoft SQL Server does not support file upload with "
|
||||
errMsg += "UNION query SQL injection technique"
|
||||
raise sqlmapUnsupportedFeatureException(errMsg)
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def __stackedWriteFilePS(self, tmpPath, wFileContent, dFile, fileType):
|
||||
def _stackedWriteFilePS(self, tmpPath, wFileContent, dFile, fileType):
|
||||
infoMsg = "using PowerShell to write the %s file content " % fileType
|
||||
infoMsg += "to file '%s', please wait.." % dFile
|
||||
logger.info(infoMsg)
|
||||
@@ -191,7 +191,7 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
self.execCmd(complComm)
|
||||
|
||||
def __stackedWriteFileDebugExe(self, tmpPath, wFile, wFileContent, dFile, fileType):
|
||||
def _stackedWriteFileDebugExe(self, tmpPath, wFile, wFileContent, dFile, fileType):
|
||||
infoMsg = "using debug.exe to write the %s " % fileType
|
||||
infoMsg += "file content to file '%s', please wait.." % dFile
|
||||
logger.info(infoMsg)
|
||||
@@ -202,7 +202,7 @@ class Filesystem(GenericFilesystem):
|
||||
debugSize = 0xFF00
|
||||
|
||||
if wFileSize < debugSize:
|
||||
chunkName = self.__updateDestChunk(wFileContent, tmpPath)
|
||||
chunkName = self._updateDestChunk(wFileContent, tmpPath)
|
||||
|
||||
debugMsg = "renaming chunk file %s\%s to %s " % (tmpPath, chunkName, fileType)
|
||||
debugMsg += "file %s\%s and moving it to %s" % (tmpPath, dFileName, dFile)
|
||||
@@ -222,7 +222,7 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
for i in xrange(0, wFileSize, debugSize):
|
||||
wFileChunk = wFileContent[i:i + debugSize]
|
||||
chunkName = self.__updateDestChunk(wFileChunk, tmpPath)
|
||||
chunkName = self._updateDestChunk(wFileChunk, tmpPath)
|
||||
|
||||
if i == 0:
|
||||
debugMsg = "renaming chunk "
|
||||
@@ -246,7 +246,7 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
self.execCmd(complComm)
|
||||
|
||||
def __stackedWriteFileVbs(self, tmpPath, wFileContent, dFile, fileType):
|
||||
def _stackedWriteFileVbs(self, tmpPath, wFileContent, dFile, fileType):
|
||||
infoMsg = "using a custom visual basic script to write the "
|
||||
infoMsg += "%s file content to file '%s', please wait.." % (fileType, dFile)
|
||||
logger.info(infoMsg)
|
||||
@@ -341,7 +341,7 @@ class Filesystem(GenericFilesystem):
|
||||
wFileContent = wFilePointer.read()
|
||||
wFilePointer.close()
|
||||
|
||||
self.__stackedWriteFileVbs(tmpPath, wFileContent, dFile, fileType)
|
||||
self._stackedWriteFileVbs(tmpPath, wFileContent, dFile, fileType)
|
||||
|
||||
sameFile = self.askCheckWrittenFile(wFile, dFile, fileType)
|
||||
|
||||
@@ -351,5 +351,5 @@ class Filesystem(GenericFilesystem):
|
||||
choice = readInput(message, default="Y")
|
||||
|
||||
if not choice or choice.lower() == "y":
|
||||
self.__stackedWriteFileDebugExe(tmpPath, wFile, wFileContent, dFile, fileType)
|
||||
#self.__stackedWriteFilePS(tmpPath, wFileContent, dFile, fileType)
|
||||
self._stackedWriteFileDebugExe(tmpPath, wFile, wFileContent, dFile, fileType)
|
||||
#self._stackedWriteFilePS(tmpPath, wFileContent, dFile, fileType)
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -24,7 +24,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
raise SqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -48,7 +48,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException("Unenclosed ) in '%s'" % expression)
|
||||
raise SqlmapSyntaxException("Unenclosed ) in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -9,7 +9,7 @@ import binascii
|
||||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
@@ -62,7 +62,7 @@ class Takeover(GenericTakeover):
|
||||
errMsg += "overflow because it does not have a valid return "
|
||||
errMsg += "code for the underlying operating system (Windows "
|
||||
errMsg += "%s Service Pack %d)" % (Backend.getOsVersion(), Backend.getOsServicePack())
|
||||
raise sqlmapUnsupportedFeatureException(errMsg)
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
shellcodeChar = ""
|
||||
hexStr = binascii.hexlify(self.shellcodeString[:-1])
|
||||
|
||||
@@ -14,7 +14,7 @@ import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -37,7 +37,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pymysql.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
|
||||
except (pymysql.OperationalError, pymysql.InternalError), msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -58,7 +58,7 @@ class Connector(GenericConnector):
|
||||
except (pymysql.OperationalError, pymysql.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pymysql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import EXPECTED
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.enums import PLACE
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.request import inject
|
||||
from lib.techniques.union.use import unionUse
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
@@ -63,7 +63,7 @@ class Filesystem(GenericFilesystem):
|
||||
logger.warn(warnMsg)
|
||||
result = self.nonStackedReadFile(rFile)
|
||||
else:
|
||||
raise sqlmapNoneDataException, warnMsg
|
||||
raise SqlmapNoneDataException, warnMsg
|
||||
else:
|
||||
length = int(length)
|
||||
sustrLen = 1024
|
||||
|
||||
@@ -26,7 +26,7 @@ class Fingerprint(GenericFingerprint):
|
||||
def __init__(self):
|
||||
GenericFingerprint.__init__(self, DBMS.MYSQL)
|
||||
|
||||
def __commentCheck(self):
|
||||
def _commentCheck(self):
|
||||
infoMsg = "executing %s comment injection fingerprint" % DBMS.MYSQL
|
||||
logger.info(infoMsg)
|
||||
|
||||
@@ -111,7 +111,7 @@ class Fingerprint(GenericFingerprint):
|
||||
value += actVer
|
||||
return value
|
||||
|
||||
comVer = self.__commentCheck()
|
||||
comVer = self._commentCheck()
|
||||
blank = " " * 15
|
||||
value += "active fingerprint: %s" % actVer
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import binascii
|
||||
import re
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -41,7 +41,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -16,7 +16,7 @@ import os
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
os.environ["NLS_LANG"] = ".AL32UTF8"
|
||||
@@ -46,7 +46,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password)
|
||||
except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError), msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -67,7 +67,7 @@ class Connector(GenericConnector):
|
||||
except (cx_Oracle.DatabaseError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
except cx_Oracle.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.data import queries
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import EXPECTED
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.request import inject
|
||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||
|
||||
@@ -160,6 +160,6 @@ class Enumeration(GenericEnumeration):
|
||||
if not kb.data.cachedUsersRoles:
|
||||
errMsg = "unable to retrieve the roles "
|
||||
errMsg += "for the database users"
|
||||
raise sqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
|
||||
return kb.data.cachedUsersRoles, areAdmins
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -15,9 +15,9 @@ class Filesystem(GenericFilesystem):
|
||||
def readFile(self, rFile):
|
||||
errMsg = "File system read access not yet implemented for "
|
||||
errMsg += "Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "File system write access not yet implemented for "
|
||||
errMsg += "Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -24,7 +24,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -47,7 +47,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("))")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -15,19 +15,19 @@ class Takeover(GenericTakeover):
|
||||
def osCmd(self):
|
||||
errMsg = "Operating system command execution functionality not "
|
||||
errMsg += "yet implemented for Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "Operating system shell functionality not yet "
|
||||
errMsg += "implemented for Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "Operating system out-of-band control functionality "
|
||||
errMsg += "not yet implemented for Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "One click operating system out-of-band control "
|
||||
errMsg += "functionality not yet implemented for Oracle"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -14,7 +14,7 @@ except ImportError:
|
||||
pass
|
||||
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -37,7 +37,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = psycopg2.connect(host=self.hostname, user=self.user, password=self.password, database=self.db, port=self.port)
|
||||
except psycopg2.OperationalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.connector.set_client_encoding('UNICODE')
|
||||
|
||||
@@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||
except (psycopg2.OperationalError, psycopg2.ProgrammingError), msg:
|
||||
logger.warn(("(remote) %s" % msg).strip())
|
||||
except psycopg2.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import os
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
@@ -31,7 +31,7 @@ class Filesystem(GenericFilesystem):
|
||||
def unionWriteFile(self, wFile, dFile, fileType):
|
||||
errMsg = "PostgreSQL does not support file upload with UNION "
|
||||
errMsg += "query SQL injection technique"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def stackedWriteFile(self, wFile, dFile, fileType):
|
||||
wFileSize = os.path.getsize(wFile)
|
||||
@@ -39,7 +39,7 @@ class Filesystem(GenericFilesystem):
|
||||
if wFileSize > 8192:
|
||||
errMsg = "on PostgreSQL it is not possible to write files "
|
||||
errMsg += "bigger than 8192 bytes at the moment"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
self.oid = randomInt()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -29,7 +29,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -52,7 +52,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("))")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -11,7 +11,7 @@ from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.data import paths
|
||||
from lib.core.enums import OS
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
@@ -53,7 +53,7 @@ class Takeover(GenericTakeover):
|
||||
majorVer = "8.2"
|
||||
else:
|
||||
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
if Backend.isOs(OS.WINDOWS):
|
||||
self.udfLocalFile += "/postgresql/windows/%d/%s/lib_postgresqludf_sys.dll" % (Backend.getArch(), majorVer)
|
||||
|
||||
@@ -15,8 +15,8 @@ import logging
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import sqlmapMissingDependence
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.exception import SqlmapMissingDependence
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
||||
@@ -56,12 +56,12 @@ class Connector(GenericConnector):
|
||||
except ImportError:
|
||||
errMsg = "sqlmap requires 'python-sqlite2' third-party library "
|
||||
errMsg += "in order to directly connect to the database '%s'" % self.db
|
||||
raise sqlmapMissingDependence, errMsg
|
||||
raise SqlmapMissingDependence, errMsg
|
||||
|
||||
self.__sqlite = sqlite
|
||||
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
||||
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
|
||||
raise sqlmapConnectionException, msg[0]
|
||||
raise SqlmapConnectionException, msg[0]
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -79,7 +79,7 @@ class Connector(GenericConnector):
|
||||
except self.__sqlite.OperationalError, msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
||||
except self.__sqlite.DatabaseError, msg:
|
||||
raise sqlmapConnectionException, msg[0]
|
||||
raise SqlmapConnectionException, msg[0]
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||
|
||||
class Enumeration(GenericEnumeration):
|
||||
@@ -57,7 +57,7 @@ class Enumeration(GenericEnumeration):
|
||||
|
||||
def searchColumn(self):
|
||||
errMsg = "on SQLite you must specify the table and columns to dump"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def getHostname(self):
|
||||
warnMsg = "on SQLite it is not possible to enumerate the hostname"
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on SQLite it is not possible to read files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on SQLite it is not possible to write files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -9,7 +9,7 @@ import binascii
|
||||
import re
|
||||
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -42,7 +42,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex+2:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
|
||||
lastIndex = firstIndex + index + 3
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on SQLite it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on SQLite it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on SQLite it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on SQLite it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -16,7 +16,7 @@ import logging
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
class Connector(GenericConnector):
|
||||
@@ -42,7 +42,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
||||
except pymssql.OperationalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
except pymssql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException, msg
|
||||
|
||||
def select(self, query):
|
||||
self.execute(query)
|
||||
|
||||
@@ -17,8 +17,8 @@ from lib.core.data import logger
|
||||
from lib.core.data import queries
|
||||
from lib.core.dicts import SYBASE_TYPES
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
||||
from lib.core.exception import sqlmapNoneDataException
|
||||
from lib.core.exception import SqlmapMissingMandatoryOptionException
|
||||
from lib.core.exception import SqlmapNoneDataException
|
||||
from lib.core.settings import CURRENT_DB
|
||||
from lib.utils.pivotdumptable import pivotDumpTable
|
||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||
@@ -172,7 +172,7 @@ class Enumeration(GenericEnumeration):
|
||||
if ',' in conf.db:
|
||||
errMsg = "only one database name is allowed when enumerating "
|
||||
errMsg += "the tables' columns"
|
||||
raise sqlmapMissingMandatoryOptionException, errMsg
|
||||
raise SqlmapMissingMandatoryOptionException, errMsg
|
||||
|
||||
conf.db = safeSQLIdentificatorNaming(conf.db)
|
||||
|
||||
@@ -197,7 +197,7 @@ class Enumeration(GenericEnumeration):
|
||||
else:
|
||||
errMsg = "unable to retrieve the tables "
|
||||
errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
|
||||
raise sqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
|
||||
for tbl in tblList:
|
||||
tblList[tblList.index(tbl)] = safeSQLIdentificatorNaming(tbl)
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.filesystem import Filesystem as GenericFilesystem
|
||||
|
||||
class Filesystem(GenericFilesystem):
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on Sybase it is not possible to read files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on Sybase it is not possible to write files"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapSyntaxException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -24,7 +24,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
raise SqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -47,7 +47,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("))")
|
||||
|
||||
if index == -1:
|
||||
raise sqlmapSyntaxException("Unenclosed ) in '%s'" % expression)
|
||||
raise SqlmapSyntaxException("Unenclosed ) in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
||||
class Takeover(GenericTakeover):
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on Sybase it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on Sybase it is not possible to execute commands"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on Sybase it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on Sybase it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise sqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
|
||||
Reference in New Issue
Block a user