mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-29 17:33:11 +03:00
minor improvement. messages are now warnings (not errors because lots of them are not causing problems for a normal usage) and most of all it's being checked only if the --dependencies is used (until now this switch has been ignored and turned on by default - always)
This commit is contained in:
parent
a4328e914b
commit
d55a242908
|
@ -1212,6 +1212,14 @@ def __setHTTPTimeout():
|
||||||
|
|
||||||
socket.setdefaulttimeout(conf.timeout)
|
socket.setdefaulttimeout(conf.timeout)
|
||||||
|
|
||||||
|
def __checkDependencies():
|
||||||
|
"""
|
||||||
|
Checks for missing dependencies.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if conf.dependencies:
|
||||||
|
checkDependencies()
|
||||||
|
|
||||||
def __cleanupOptions():
|
def __cleanupOptions():
|
||||||
"""
|
"""
|
||||||
Cleanup configuration attributes.
|
Cleanup configuration attributes.
|
||||||
|
@ -1744,7 +1752,7 @@ def init(inputOptions=advancedDict(), overrideOptions=False):
|
||||||
__saveCmdline()
|
__saveCmdline()
|
||||||
__setRequestFromFile()
|
__setRequestFromFile()
|
||||||
__cleanupOptions()
|
__cleanupOptions()
|
||||||
checkDependencies()
|
__checkDependencies()
|
||||||
__basicOptionValidation()
|
__basicOptionValidation()
|
||||||
__setTorProxySettings()
|
__setTorProxySettings()
|
||||||
__setMultipleTargets()
|
__setMultipleTargets()
|
||||||
|
|
|
@ -539,7 +539,7 @@ def cmdLineParser():
|
||||||
|
|
||||||
miscellaneous.add_option("--dependencies", dest="dependencies",
|
miscellaneous.add_option("--dependencies", dest="dependencies",
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="Show which sqlmap dependencies are not available")
|
help="Check for missing sqlmap dependencies")
|
||||||
|
|
||||||
# Hidden and/or experimental options
|
# Hidden and/or experimental options
|
||||||
parser.add_option("--profile", dest="profile", action="store_true",
|
parser.add_option("--profile", dest="profile", action="store_true",
|
||||||
|
|
|
@ -27,10 +27,10 @@ def checkDependencies():
|
||||||
import pymssql
|
import pymssql
|
||||||
|
|
||||||
if not hasattr(pymssql, "__version__") or pymssql.__version__ < "1.0.2":
|
if not hasattr(pymssql, "__version__") or pymssql.__version__ < "1.0.2":
|
||||||
debugMsg = "'%s' third-party library must be " % data[1]
|
warnMsg = "'%s' third-party library must be " % data[1]
|
||||||
debugMsg += "version >= 1.0.2 to work properly. "
|
warnMsg += "version >= 1.0.2 to work properly. "
|
||||||
debugMsg += "Download from %s" % data[2]
|
warnMsg += "Download from %s" % data[2]
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
elif dbmsName == DBMS.MYSQL:
|
elif dbmsName == DBMS.MYSQL:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
elif dbmsName == DBMS.PGSQL:
|
elif dbmsName == DBMS.PGSQL:
|
||||||
|
@ -44,10 +44,10 @@ def checkDependencies():
|
||||||
elif dbmsName == DBMS.FIREBIRD:
|
elif dbmsName == DBMS.FIREBIRD:
|
||||||
import kinterbasdb
|
import kinterbasdb
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
debugMsg = "sqlmap requires '%s' third-party library " % data[1]
|
warnMsg = "sqlmap requires '%s' third-party library " % data[1]
|
||||||
debugMsg += "in order to directly connect to the database "
|
warnMsg += "in order to directly connect to the database "
|
||||||
debugMsg += "%s. Download from %s" % (dbmsName, data[2])
|
warnMsg += "%s. Download from %s" % (dbmsName, data[2])
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
missing_libraries.add(data[1])
|
missing_libraries.add(data[1])
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
@ -60,10 +60,10 @@ def checkDependencies():
|
||||||
debugMsg = "'python-impacket' third-party library is found"
|
debugMsg = "'python-impacket' third-party library is found"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
debugMsg = "sqlmap requires 'python-impacket' third-party library for "
|
warnMsg = "sqlmap requires 'python-impacket' third-party library for "
|
||||||
debugMsg += "out-of-band takeover feature. Download from "
|
warnMsg += "out-of-band takeover feature. Download from "
|
||||||
debugMsg += "http://code.google.com/p/impacket/"
|
warnMsg += "http://code.google.com/p/impacket/"
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
missing_libraries.add('python-impacket')
|
missing_libraries.add('python-impacket')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -71,10 +71,10 @@ def checkDependencies():
|
||||||
debugMsg = "'python-ntlm' third-party library is found"
|
debugMsg = "'python-ntlm' third-party library is found"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
debugMsg = "sqlmap requires 'python-ntlm' third-party library for "
|
warnMsg = "sqlmap requires 'python-ntlm' third-party library for "
|
||||||
debugMsg += "if you plan to attack a web application behind NTLM "
|
warnMsg += "if you plan to attack a web application behind NTLM "
|
||||||
debugMsg += "authentication. Download from http://code.google.com/p/python-ntlm/"
|
warnMsg += "authentication. Download from http://code.google.com/p/python-ntlm/"
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
missing_libraries.add('python-ntlm')
|
missing_libraries.add('python-ntlm')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -82,10 +82,10 @@ def checkDependencies():
|
||||||
debugMsg = "'python-svn' third-party library is found"
|
debugMsg = "'python-svn' third-party library is found"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
debugMsg = "sqlmap requires 'python-svn' third-party library for "
|
warnMsg = "sqlmap requires 'python-svn' third-party library for "
|
||||||
debugMsg += "if you want to use the sqlmap update functionality. "
|
warnMsg += "if you want to use the sqlmap update functionality. "
|
||||||
debugMsg += "Download from http://pysvn.tigris.org/"
|
warnMsg += "Download from http://pysvn.tigris.org/"
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
missing_libraries.add('python-svn')
|
missing_libraries.add('python-svn')
|
||||||
|
|
||||||
if IS_WIN:
|
if IS_WIN:
|
||||||
|
@ -94,12 +94,12 @@ def checkDependencies():
|
||||||
debugMsg = "'python-pyreadline' third-party library is found"
|
debugMsg = "'python-pyreadline' third-party library is found"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
except ImportError, _:
|
except ImportError, _:
|
||||||
debugMsg = "sqlmap requires 'pyreadline' third-party library to "
|
warnMsg = "sqlmap requires 'pyreadline' third-party library to "
|
||||||
debugMsg += "be able to take advantage of the sqlmap TAB "
|
warnMsg += "be able to take advantage of the sqlmap TAB "
|
||||||
debugMsg += "completion and history support features in the SQL "
|
warnMsg += "completion and history support features in the SQL "
|
||||||
debugMsg += "shell and OS shell. Download from "
|
warnMsg += "shell and OS shell. Download from "
|
||||||
debugMsg += "http://ipython.scipy.org/moin/PyReadline/Intro"
|
warnMsg += "http://ipython.scipy.org/moin/PyReadline/Intro"
|
||||||
logger.debug(debugMsg)
|
logger.warn(warnMsg)
|
||||||
missing_libraries.add('python-pyreadline')
|
missing_libraries.add('python-pyreadline')
|
||||||
|
|
||||||
if len(missing_libraries) == 0:
|
if len(missing_libraries) == 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user