mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 21:21:33 +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
|
||||
|
||||
Reference in New Issue
Block a user