mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-23 19:34:13 +03:00
Another update related to the #3356
This commit is contained in:
parent
e99e9919cd
commit
90e381a5a5
|
@ -10,6 +10,7 @@ from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.dicts import DBMS_DICT
|
from lib.core.dicts import DBMS_DICT
|
||||||
from lib.core.enums import DBMS
|
from lib.core.enums import DBMS
|
||||||
|
from lib.core.exception import SqlmapConnectionException
|
||||||
from lib.core.settings import MSSQL_ALIASES
|
from lib.core.settings import MSSQL_ALIASES
|
||||||
from lib.core.settings import MYSQL_ALIASES
|
from lib.core.settings import MYSQL_ALIASES
|
||||||
from lib.core.settings import ORACLE_ALIASES
|
from lib.core.settings import ORACLE_ALIASES
|
||||||
|
@ -94,21 +95,32 @@ def setHandler():
|
||||||
conf.dbmsConnector = Connector()
|
conf.dbmsConnector = Connector()
|
||||||
|
|
||||||
if conf.direct:
|
if conf.direct:
|
||||||
|
exception = None
|
||||||
dialect = DBMS_DICT[dbms][3]
|
dialect = DBMS_DICT[dbms][3]
|
||||||
|
|
||||||
if dialect:
|
if dialect:
|
||||||
sqlalchemy = SQLAlchemy(dialect=dialect)
|
try:
|
||||||
sqlalchemy.connect()
|
sqlalchemy = SQLAlchemy(dialect=dialect)
|
||||||
|
sqlalchemy.connect()
|
||||||
|
|
||||||
if sqlalchemy.connector:
|
if sqlalchemy.connector:
|
||||||
conf.dbmsConnector = sqlalchemy
|
conf.dbmsConnector = sqlalchemy
|
||||||
else:
|
except Exception, ex:
|
||||||
try:
|
exception = ex
|
||||||
conf.dbmsConnector.connect()
|
|
||||||
except NameError:
|
if not dialect or exception:
|
||||||
pass
|
try:
|
||||||
else:
|
conf.dbmsConnector.connect()
|
||||||
conf.dbmsConnector.connect()
|
except Exception, ex:
|
||||||
|
if exception:
|
||||||
|
raise exception
|
||||||
|
else:
|
||||||
|
if not isinstance(ex, NameError):
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
msg = "support for direct connection to '%s' is not available. " % dbms
|
||||||
|
msg += "Please rerun with '--dependencies'"
|
||||||
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
if conf.forceDbms == dbms or handler.checkDbms():
|
if conf.forceDbms == dbms or handler.checkDbms():
|
||||||
if kb.resolutionDbms:
|
if kb.resolutionDbms:
|
||||||
|
|
|
@ -1410,7 +1410,7 @@ def parseTargetDirect():
|
||||||
except (SqlmapSyntaxException, SqlmapMissingDependence):
|
except (SqlmapSyntaxException, SqlmapMissingDependence):
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
if _sqlalchemy and data[3] in _sqlalchemy.dialects.__all__:
|
if _sqlalchemy and data[3] and any(_ in _sqlalchemy.dialects.__all__ for _ in (data[3], data[3].split('+')[0])):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
errMsg = "sqlmap requires '%s' third-party library " % data[1]
|
errMsg = "sqlmap requires '%s' third-party library " % data[1]
|
||||||
|
|
|
@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||||
from lib.core.enums import OS
|
from lib.core.enums import OS
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.2.11.3"
|
VERSION = "1.2.11.4"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -91,7 +91,7 @@ class HashDB(object):
|
||||||
raise
|
raise
|
||||||
except sqlite3.DatabaseError, ex:
|
except sqlite3.DatabaseError, ex:
|
||||||
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
|
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
|
||||||
errMsg += "If the problem persists please rerun with `--flush-session`"
|
errMsg += "If the problem persists please rerun with '--flush-session'"
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -104,7 +104,7 @@ class HashDB(object):
|
||||||
except:
|
except:
|
||||||
retVal = None
|
retVal = None
|
||||||
warnMsg = "error occurred while unserializing value for session key '%s'. " % key
|
warnMsg = "error occurred while unserializing value for session key '%s'. " % key
|
||||||
warnMsg += "If the problem persists please rerun with `--flush-session`"
|
warnMsg += "If the problem persists please rerun with '--flush-session'"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
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)
|
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.Error, _mssql.MssqlDatabaseException), msg:
|
except (pymssql2.Error, _mssql.MssqlDatabaseException), msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise SqlmapConnectionException
|
raise SqlmapConnectionException
|
||||||
|
|
|
@ -25,11 +25,11 @@ c1bccc94522d3425a372dcd57f78418e extra/wafdetectify/wafdetectify.py
|
||||||
3459c562a6abb9b4bdcc36925f751f3e lib/controller/action.py
|
3459c562a6abb9b4bdcc36925f751f3e lib/controller/action.py
|
||||||
71334197c7ed28167cd66c17b2c21844 lib/controller/checks.py
|
71334197c7ed28167cd66c17b2c21844 lib/controller/checks.py
|
||||||
dd42ef140ffc0bd517128e6df369ab01 lib/controller/controller.py
|
dd42ef140ffc0bd517128e6df369ab01 lib/controller/controller.py
|
||||||
97a0f363bfc33a5ee4853cdf91515423 lib/controller/handler.py
|
ba2717a410b21285d781ab42c4a797d0 lib/controller/handler.py
|
||||||
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
|
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
|
||||||
cb865cf6eff60118bc97a0f106af5e4d lib/core/agent.py
|
cb865cf6eff60118bc97a0f106af5e4d lib/core/agent.py
|
||||||
c347f085bd561adfa26d3a9512e5f3b9 lib/core/bigarray.py
|
c347f085bd561adfa26d3a9512e5f3b9 lib/core/bigarray.py
|
||||||
b2a70451b0e5abe914aff2130015664f lib/core/common.py
|
eb4e54c194d50d9dc8caa1a3ea69cba6 lib/core/common.py
|
||||||
0d082da16c388b3445e656e0760fb582 lib/core/convert.py
|
0d082da16c388b3445e656e0760fb582 lib/core/convert.py
|
||||||
9f87391b6a3395f7f50830b391264f27 lib/core/data.py
|
9f87391b6a3395f7f50830b391264f27 lib/core/data.py
|
||||||
72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py
|
72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py
|
||||||
|
@ -49,7 +49,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
|
||||||
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
|
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
|
||||||
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
|
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
|
||||||
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
|
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
|
||||||
8f0fae6a47aed35b82f320edfec67ce2 lib/core/settings.py
|
46698dfe7954891919d27a2f250d8f42 lib/core/settings.py
|
||||||
a971ce157d04de96ba6e710d3d38a9a8 lib/core/shell.py
|
a971ce157d04de96ba6e710d3d38a9a8 lib/core/shell.py
|
||||||
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
|
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
|
||||||
721198b5be72c8015a02acb116532a1f lib/core/target.py
|
721198b5be72c8015a02acb116532a1f lib/core/target.py
|
||||||
|
@ -107,7 +107,7 @@ f7813cdee00df8f98d6f811475e520a1 lib/techniques/union/test.py
|
||||||
f9867bbfcd6d31916ca73e72e95fd881 lib/utils/deps.py
|
f9867bbfcd6d31916ca73e72e95fd881 lib/utils/deps.py
|
||||||
f7af65aa47329d021e2b2cc8521b42a4 lib/utils/getch.py
|
f7af65aa47329d021e2b2cc8521b42a4 lib/utils/getch.py
|
||||||
7af29f61302c8693cd6436d4b69e22d3 lib/utils/har.py
|
7af29f61302c8693cd6436d4b69e22d3 lib/utils/har.py
|
||||||
062e4e8fc43ac54305a75ddd0d482f81 lib/utils/hashdb.py
|
1205648d55649accafae2cc77d647aa0 lib/utils/hashdb.py
|
||||||
d0f4d56c5d6a09a4635035e233d4a782 lib/utils/hash.py
|
d0f4d56c5d6a09a4635035e233d4a782 lib/utils/hash.py
|
||||||
011d2dbf589e0faa0deca61a651239cc lib/utils/htmlentities.py
|
011d2dbf589e0faa0deca61a651239cc lib/utils/htmlentities.py
|
||||||
1e5532ede194ac9c083891c2f02bca93 lib/utils/__init__.py
|
1e5532ede194ac9c083891c2f02bca93 lib/utils/__init__.py
|
||||||
|
@ -169,7 +169,7 @@ ffd26f64142226d0b1ed1d70f7f294c0 plugins/dbms/maxdb/filesystem.py
|
||||||
4321d7018f5121343460ebfd83bb69be plugins/dbms/maxdb/__init__.py
|
4321d7018f5121343460ebfd83bb69be plugins/dbms/maxdb/__init__.py
|
||||||
e7d44671ae26c0bcd5fe8448be070bbd plugins/dbms/maxdb/syntax.py
|
e7d44671ae26c0bcd5fe8448be070bbd plugins/dbms/maxdb/syntax.py
|
||||||
bf7842bb291e2297c3c8d1023eb3e550 plugins/dbms/maxdb/takeover.py
|
bf7842bb291e2297c3c8d1023eb3e550 plugins/dbms/maxdb/takeover.py
|
||||||
decc645344bb93aca504a71ba2e4cad4 plugins/dbms/mssqlserver/connector.py
|
5e1c7e578d07f3670bba5d88d856715d plugins/dbms/mssqlserver/connector.py
|
||||||
f1f1541a54faf67440179fa521f99849 plugins/dbms/mssqlserver/enumeration.py
|
f1f1541a54faf67440179fa521f99849 plugins/dbms/mssqlserver/enumeration.py
|
||||||
65911fdc86fa6322e72319e6488a0bb8 plugins/dbms/mssqlserver/filesystem.py
|
65911fdc86fa6322e72319e6488a0bb8 plugins/dbms/mssqlserver/filesystem.py
|
||||||
6cf74341fc84588205e02b70b2f0f5b6 plugins/dbms/mssqlserver/fingerprint.py
|
6cf74341fc84588205e02b70b2f0f5b6 plugins/dbms/mssqlserver/fingerprint.py
|
||||||
|
|
Loading…
Reference in New Issue
Block a user