some update

This commit is contained in:
Miroslav Stampar 2010-09-30 19:45:23 +00:00
parent 87abec16bd
commit 8abcdae1b5
4 changed files with 28 additions and 1 deletions

View File

@ -39,6 +39,7 @@ from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
from lib.core.exception import exceptionsTuple from lib.core.exception import exceptionsTuple
from lib.core.exception import sqlmapNotVulnerableException from lib.core.exception import sqlmapNotVulnerableException
from lib.core.exception import sqlmapUserQuitException
from lib.core.session import setInjection from lib.core.session import setInjection
from lib.core.target import initTargetEnv from lib.core.target import initTargetEnv
from lib.core.target import setupTargetEnv from lib.core.target import setupTargetEnv
@ -279,6 +280,9 @@ def start():
checkForParenthesis() checkForParenthesis()
action() action()
except sqlmapUserQuitException:
raise
except exceptionsTuple, e: except exceptionsTuple, e:
e = getUnicode(e) e = getUnicode(e)

View File

@ -55,6 +55,9 @@ class sqlmapNoneDataException(Exception):
class sqlmapNotVulnerableException(Exception): class sqlmapNotVulnerableException(Exception):
pass pass
class sqlmapUserQuitException(Exception):
pass
class sqlmapRegExprException(Exception): class sqlmapRegExprException(Exception):
pass pass
@ -93,6 +96,7 @@ exceptionsTuple = (
sqlmapMissingDependence, sqlmapMissingDependence,
sqlmapMissingMandatoryOptionException, sqlmapMissingMandatoryOptionException,
sqlmapNoneDataException, sqlmapNoneDataException,
sqlmapUserQuitException,
sqlmapRegExprException, sqlmapRegExprException,
sqlmapSyntaxException, sqlmapSyntaxException,
sqlmapUndefinedMethod, sqlmapUndefinedMethod,

View File

@ -42,11 +42,13 @@ from lib.core.convert import utf8decode
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
from lib.core.data import paths
from lib.core.data import queries from lib.core.data import queries
from lib.core.data import temp from lib.core.data import temp
from lib.core.exception import sqlmapMissingMandatoryOptionException from lib.core.exception import sqlmapMissingMandatoryOptionException
from lib.core.exception import sqlmapNoneDataException from lib.core.exception import sqlmapNoneDataException
from lib.core.exception import sqlmapUnsupportedFeatureException from lib.core.exception import sqlmapUnsupportedFeatureException
from lib.core.exception import sqlmapUserQuitException
from lib.core.session import setOs from lib.core.session import setOs
from lib.core.settings import SQL_STATEMENTS from lib.core.settings import SQL_STATEMENTS
from lib.core.shell import autoCompletion from lib.core.shell import autoCompletion
@ -695,7 +697,17 @@ class Enumeration:
if kb.dbms == "MySQL" and not kb.data.has_information_schema: if kb.dbms == "MySQL" and not kb.data.has_information_schema:
errMsg = "information_schema not available, " errMsg = "information_schema not available, "
errMsg += "back-end DBMS is MySQL < 5.0" errMsg += "back-end DBMS is MySQL < 5.0"
raise sqlmapUnsupportedFeatureException, errMsg logger.error(errMsg)
message = "do you want to use common table existance check? [Y/n/q]"
test = readInput(message, default="Y")
if test[0] in ("n", "N"):
return
elif test[0] in ("q", "Q"):
raise sqlmapUserQuitException
else:
return self.tableExists(paths.COMMON_TABLES)
self.forceDbmsEnum() self.forceDbmsEnum()

View File

@ -51,6 +51,7 @@ from lib.core.data import conf
from lib.core.data import logger from lib.core.data import logger
from lib.core.data import paths from lib.core.data import paths
from lib.core.exception import exceptionsTuple from lib.core.exception import exceptionsTuple
from lib.core.exception import sqlmapUserQuitException
from lib.core.exception import unhandledException from lib.core.exception import unhandledException
from lib.core.option import init from lib.core.option import init
from lib.core.profiling import profile from lib.core.profiling import profile
@ -93,6 +94,12 @@ def main():
liveTest() liveTest()
else: else:
start() start()
except sqlmapUserQuitException:
errMsg = "user quit"
logger.error(errMsg)
closeDumper(False, errMsg)
except exceptionsTuple, e: except exceptionsTuple, e:
e = getUnicode(e) e = getUnicode(e)
logger.critical(e) logger.critical(e)