This commit is contained in:
Miroslav Stampar 2019-05-08 16:43:57 +02:00
parent 0bbd7fdcad
commit 2693da6a71
2 changed files with 11 additions and 7 deletions

View File

@ -2012,14 +2012,17 @@ def getPageWordSet(page):
retVal = set() retVal = set()
# only if the page's charset has been successfully identified # only if the page's charset has been successfully identified
if isinstance(page, six.text_type): if isinstance(page, six.string_types):
retVal = set(_.group(0) for _ in re.finditer(r"\w+", getFilteredPageContent(page))) retVal = set(_.group(0) for _ in re.finditer(r"\w+", getFilteredPageContent(page)))
return retVal return retVal
def showStaticWords(firstPage, secondPage): def showStaticWords(firstPage, secondPage, minLength=3):
""" """
Prints words appearing in two different response pages Prints words appearing in two different response pages
>>> showStaticWords("this is a test", "this is another test")
['this']
""" """
infoMsg = "finding static words in longest matching part of dynamic page content" infoMsg = "finding static words in longest matching part of dynamic page content"
@ -2038,11 +2041,10 @@ def showStaticWords(firstPage, secondPage):
commonWords = None commonWords = None
if commonWords: if commonWords:
commonWords = list(commonWords) commonWords = [_ for _ in commonWords if len(_) >= minLength]
commonWords.sort(lambda a, b: cmp(a.lower(), b.lower())) commonWords.sort(key=functools.cmp_to_key(lambda a, b: cmp(a.lower(), b.lower())))
for word in commonWords: for word in commonWords:
if len(word) > 2:
infoMsg += "'%s', " % word infoMsg += "'%s', " % word
infoMsg = infoMsg.rstrip(", ") infoMsg = infoMsg.rstrip(", ")
@ -2051,6 +2053,8 @@ def showStaticWords(firstPage, secondPage):
logger.info(infoMsg) logger.info(infoMsg)
return commonWords
def isWindowsDriveLetterPath(filepath): def isWindowsDriveLetterPath(filepath):
""" """
Returns True if given filepath starts with a Windows drive letter Returns True if given filepath starts with a Windows drive letter

View File

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