Trivial case update

This commit is contained in:
Miroslav Stampar 2019-05-20 11:24:43 +02:00
parent 4cc13d3c1e
commit b9151ca5c5
6 changed files with 12 additions and 12 deletions

View File

@ -57,7 +57,7 @@ from lib.core.convert import decodeHex
from lib.core.convert import getBytes from lib.core.convert import getBytes
from lib.core.convert import getText from lib.core.convert import getText
from lib.core.convert import getUnicode 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.convert import stdoutEncode
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import kb from lib.core.data import kb
@ -2001,7 +2001,7 @@ def getFilteredPageContent(page, onlyText=True, split=" "):
if isinstance(page, six.text_type): if isinstance(page, six.text_type):
retVal = re.sub(r"(?si)<script.+?</script>|<!--.+?-->|<style.+?</style>%s" % (r"|<[^>]+>|\t|\n|\r" if onlyText else ""), split, page) retVal = re.sub(r"(?si)<script.+?</script>|<!--.+?-->|<style.+?</style>%s" % (r"|<[^>]+>|\t|\n|\r" if onlyText else ""), split, page)
retVal = re.sub(r"%s{2,}" % split, split, retVal) retVal = re.sub(r"%s{2,}" % split, split, retVal)
retVal = htmlunescape(retVal.strip().strip(split)) retVal = htmlUnescape(retVal.strip().strip(split))
return retVal return retVal
@ -2636,7 +2636,7 @@ def extractErrorMessage(page):
match = re.search(regex, page, re.IGNORECASE) match = re.search(regex, page, re.IGNORECASE)
if match: if match:
retVal = htmlunescape(match.group("result")).replace("<br>", "\n").strip() retVal = htmlUnescape(match.group("result")).replace("<br>", "\n").strip()
break break
return retVal return retVal

4
lib/core/convert.py Executable file → Normal file
View File

@ -70,11 +70,11 @@ def base64unpickle(value):
return retVal return retVal
def htmlunescape(value): def htmlUnescape(value):
""" """
Returns (basic conversion) HTML unescaped value Returns (basic conversion) HTML unescaped value
>>> htmlunescape('a&lt;b') >>> htmlUnescape('a&lt;b')
'a<b' 'a<b'
""" """

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.110" VERSION = "1.3.5.111"
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)

View File

@ -34,7 +34,7 @@ from lib.core.common import wasLastResponseHTTPError
from lib.core.compat import xrange from lib.core.compat import xrange
from lib.core.convert import decodeHex from lib.core.convert import decodeHex
from lib.core.convert import getUnicode 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 conf
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger 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 retVal = decodeDbmsHexValue(retVal) if conf.hexConvert else retVal
if isinstance(retVal, six.string_types): if isinstance(retVal, six.string_types):
retVal = htmlunescape(retVal).replace("<br>", "\n") retVal = htmlUnescape(retVal).replace("<br>", "\n")
retVal = _errorReplaceChars(retVal) retVal = _errorReplaceChars(retVal)

View File

@ -42,7 +42,7 @@ from lib.core.compat import xrange
from lib.core.convert import decodeBase64 from lib.core.convert import decodeBase64
from lib.core.convert import getBytes from lib.core.convert import getBytes
from lib.core.convert import getUnicode 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 conf
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger 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 # 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(): if Backend.isDbms(DBMS.MSSQL) and wasLastResponseDBMSError():
retVal = htmlunescape(retVal).replace("<br>", "\n") retVal = htmlUnescape(retVal).replace("<br>", "\n")
hashDBWrite("%s%s" % (conf.hexConvert or False, expression), retVal) hashDBWrite("%s%s" % (conf.hexConvert or False, expression), retVal)

View File

@ -20,7 +20,7 @@ from lib.core.common import readInput
from lib.core.common import safeCSValue from lib.core.common import safeCSValue
from lib.core.common import urldecode from lib.core.common import urldecode
from lib.core.compat import xrange 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 conf
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
@ -99,7 +99,7 @@ def crawl(target):
if href: if href:
if threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID: if threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:
current = threadData.lastRedirectURL[1] 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 # flag to know if we are dealing with the same target host
_ = checkSameHost(url, target) _ = checkSameHost(url, target)