Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8abcdae

Browse files
committed
some update
1 parent 87abec1 commit 8abcdae

4 files changed

Lines changed: 28 additions & 1 deletion

File tree

lib/controller/controller.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from lib.core.data import logger
4040
from lib.core.exception import exceptionsTuple
4141
from lib.core.exception import sqlmapNotVulnerableException
42+
from lib.core.exception import sqlmapUserQuitException
4243
from lib.core.session import setInjection
4344
from lib.core.target import initTargetEnv
4445
from lib.core.target import setupTargetEnv
@@ -279,6 +280,9 @@ def start():
279280
checkForParenthesis()
280281
action()
281282

283+
except sqlmapUserQuitException:
284+
raise
285+
282286
except exceptionsTuple, e:
283287
e = getUnicode(e)
284288

lib/core/exception.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ class sqlmapNoneDataException(Exception):
5555
class sqlmapNotVulnerableException(Exception):
5656
pass
5757

58+
class sqlmapUserQuitException(Exception):
59+
pass
60+
5861
class sqlmapRegExprException(Exception):
5962
pass
6063

@@ -93,6 +96,7 @@ def unhandledException():
9396
sqlmapMissingDependence,
9497
sqlmapMissingMandatoryOptionException,
9598
sqlmapNoneDataException,
99+
sqlmapUserQuitException,
96100
sqlmapRegExprException,
97101
sqlmapSyntaxException,
98102
sqlmapUndefinedMethod,

plugins/generic/enumeration.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
from lib.core.data import conf
4343
from lib.core.data import kb
4444
from lib.core.data import logger
45+
from lib.core.data import paths
4546
from lib.core.data import queries
4647
from lib.core.data import temp
4748
from lib.core.exception import sqlmapMissingMandatoryOptionException
4849
from lib.core.exception import sqlmapNoneDataException
4950
from lib.core.exception import sqlmapUnsupportedFeatureException
51+
from lib.core.exception import sqlmapUserQuitException
5052
from lib.core.session import setOs
5153
from lib.core.settings import SQL_STATEMENTS
5254
from lib.core.shell import autoCompletion
@@ -695,7 +697,17 @@ def getTables(self):
695697
if kb.dbms == "MySQL" and not kb.data.has_information_schema:
696698
errMsg = "information_schema not available, "
697699
errMsg += "back-end DBMS is MySQL < 5.0"
698-
raise sqlmapUnsupportedFeatureException, errMsg
700+
logger.error(errMsg)
701+
702+
message = "do you want to use common table existance check? [Y/n/q]"
703+
test = readInput(message, default="Y")
704+
705+
if test[0] in ("n", "N"):
706+
return
707+
elif test[0] in ("q", "Q"):
708+
raise sqlmapUserQuitException
709+
else:
710+
return self.tableExists(paths.COMMON_TABLES)
699711

700712
self.forceDbmsEnum()
701713

sqlmap.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
from lib.core.data import logger
5252
from lib.core.data import paths
5353
from lib.core.exception import exceptionsTuple
54+
from lib.core.exception import sqlmapUserQuitException
5455
from lib.core.exception import unhandledException
5556
from lib.core.option import init
5657
from lib.core.profiling import profile
@@ -93,6 +94,12 @@ def main():
9394
liveTest()
9495
else:
9596
start()
97+
98+
except sqlmapUserQuitException:
99+
errMsg = "user quit"
100+
logger.error(errMsg)
101+
closeDumper(False, errMsg)
102+
96103
except exceptionsTuple, e:
97104
e = getUnicode(e)
98105
logger.critical(e)

0 commit comments

Comments
 (0)