Skip to content

Commit c14c471

Browse files
committed
1 parent b35c8e5 commit c14c471

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

lib/core/patch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
import lib.core.option
1515
import lib.request.connect
1616
import lib.utils.search
17+
import lib.utils.sqlalchemy
1718
import thirdparty.ansistrm.ansistrm
1819

1920
from lib.request.templates import getPageTemplate
2021

2122
from lib.core.common import filterNone
23+
from lib.core.common import getSafeExString
2224
from lib.core.common import isListLike
2325
from lib.core.common import singleTimeWarnMessage
2426
from lib.core.common import readInput
@@ -67,6 +69,7 @@ def resolveCrossReferences():
6769
lib.utils.search.setHTTPHandlers = _setHTTPHandlers
6870
lib.controller.checks.setVerbosity = setVerbosity
6971
lib.controller.checks.setWafFunctions = _setWafFunctions
72+
lib.utils.sqlalchemy.getSafeExString = getSafeExString
7073
thirdparty.ansistrm.ansistrm.stdoutencode = stdoutencode
7174

7275
def pympTempLeakPatch(tempDir):

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.107"
21+
VERSION = "1.3.5.108"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/utils/sqlalchemy.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from lib.core.exception import SqlmapMissingDependence
3636
from plugins.generic.connector import Connector as GenericConnector
3737

38+
def getSafeExString(ex, encoding=None): # Cross-referenced function
39+
raise NotImplementedError
40+
3841
class SQLAlchemy(GenericConnector):
3942
def __init__(self, dialect=None):
4043
GenericConnector.__init__(self)
@@ -77,7 +80,7 @@ def connect(self):
7780
except SqlmapFilePathException:
7881
raise
7982
except Exception as ex:
80-
raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % ex.msg)
83+
raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % getSafeExString(ex))
8184

8285
self.printConnected()
8386
else:
@@ -90,16 +93,16 @@ def fetchall(self):
9093
retVal.append(tuple(row))
9194
return retVal
9295
except _sqlalchemy.exc.ProgrammingError as ex:
93-
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % ex.message if hasattr(ex, "message") else ex)
96+
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % getSafeExString(ex))
9497
return None
9598

9699
def execute(self, query):
97100
try:
98101
self.cursor = self.connector.execute(query)
99102
except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError) as ex:
100-
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % ex.message if hasattr(ex, "message") else ex)
103+
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % getSafeExString(ex))
101104
except _sqlalchemy.exc.InternalError as ex:
102-
raise SqlmapConnectionException(ex[1])
105+
raise SqlmapConnectionException(getSafeExString(ex))
103106

104107
def select(self, query):
105108
self.execute(query)

0 commit comments

Comments
 (0)