diff --git a/lib/core/common.py b/lib/core/common.py index 1df5843f8..5e87b8934 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -57,7 +57,7 @@ from lib.core.convert import decodeHex from lib.core.convert import getBytes from lib.core.convert import getText from lib.core.convert import getUnicode -from lib.core.convert import htmlunescape +from lib.core.convert import htmlUnescape from lib.core.convert import stdoutEncode from lib.core.data import conf from lib.core.data import kb @@ -2001,7 +2001,7 @@ def getFilteredPageContent(page, onlyText=True, split=" "): if isinstance(page, six.text_type): retVal = re.sub(r"(?si)||%s" % (r"|<[^>]+>|\t|\n|\r" if onlyText else ""), split, page) retVal = re.sub(r"%s{2,}" % split, split, retVal) - retVal = htmlunescape(retVal.strip().strip(split)) + retVal = htmlUnescape(retVal.strip().strip(split)) return retVal @@ -2636,7 +2636,7 @@ def extractErrorMessage(page): match = re.search(regex, page, re.IGNORECASE) if match: - retVal = htmlunescape(match.group("result")).replace("
", "\n").strip() + retVal = htmlUnescape(match.group("result")).replace("
", "\n").strip() break return retVal diff --git a/lib/core/convert.py b/lib/core/convert.py old mode 100755 new mode 100644 index 97d97473d..6f4320579 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -70,11 +70,11 @@ def base64unpickle(value): return retVal -def htmlunescape(value): +def htmlUnescape(value): """ Returns (basic conversion) HTML unescaped value - >>> htmlunescape('a<b') + >>> htmlUnescape('a<b') 'a...) -VERSION = "1.3.5.110" +VERSION = "1.3.5.111" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index a4ed17520..3071e4f10 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -34,7 +34,7 @@ from lib.core.common import wasLastResponseHTTPError from lib.core.compat import xrange from lib.core.convert import decodeHex from lib.core.convert import getUnicode -from lib.core.convert import htmlunescape +from lib.core.convert import htmlUnescape from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger @@ -204,7 +204,7 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False): retVal = decodeDbmsHexValue(retVal) if conf.hexConvert else retVal if isinstance(retVal, six.string_types): - retVal = htmlunescape(retVal).replace("
", "\n") + retVal = htmlUnescape(retVal).replace("
", "\n") retVal = _errorReplaceChars(retVal) diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 6cebf45be..215661ee1 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -42,7 +42,7 @@ from lib.core.compat import xrange from lib.core.convert import decodeBase64 from lib.core.convert import getBytes from lib.core.convert import getUnicode -from lib.core.convert import htmlunescape +from lib.core.convert import htmlUnescape from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger @@ -147,7 +147,7 @@ def _oneShotUnionUse(expression, unpack=True, limited=False): # Special case when DBMS is Microsoft SQL Server and error message is used as a result of UNION injection if Backend.isDbms(DBMS.MSSQL) and wasLastResponseDBMSError(): - retVal = htmlunescape(retVal).replace("
", "\n") + retVal = htmlUnescape(retVal).replace("
", "\n") hashDBWrite("%s%s" % (conf.hexConvert or False, expression), retVal) diff --git a/lib/utils/crawler.py b/lib/utils/crawler.py index 66818592d..f1ace276b 100644 --- a/lib/utils/crawler.py +++ b/lib/utils/crawler.py @@ -20,7 +20,7 @@ from lib.core.common import readInput from lib.core.common import safeCSValue from lib.core.common import urldecode from lib.core.compat import xrange -from lib.core.convert import htmlunescape +from lib.core.convert import htmlUnescape from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger @@ -99,7 +99,7 @@ def crawl(target): if href: if threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID: current = threadData.lastRedirectURL[1] - url = _urllib.parse.urljoin(current, htmlunescape(href)) + url = _urllib.parse.urljoin(current, htmlUnescape(href)) # flag to know if we are dealing with the same target host _ = checkSameHost(url, target)