mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Fixes #3635
This commit is contained in:
@@ -2012,14 +2012,17 @@ def getPageWordSet(page):
|
||||
retVal = set()
|
||||
|
||||
# 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)))
|
||||
|
||||
return retVal
|
||||
|
||||
def showStaticWords(firstPage, secondPage):
|
||||
def showStaticWords(firstPage, secondPage, minLength=3):
|
||||
"""
|
||||
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"
|
||||
@@ -2038,12 +2041,11 @@ def showStaticWords(firstPage, secondPage):
|
||||
commonWords = None
|
||||
|
||||
if commonWords:
|
||||
commonWords = list(commonWords)
|
||||
commonWords.sort(lambda a, b: cmp(a.lower(), b.lower()))
|
||||
commonWords = [_ for _ in commonWords if len(_) >= minLength]
|
||||
commonWords.sort(key=functools.cmp_to_key(lambda a, b: cmp(a.lower(), b.lower())))
|
||||
|
||||
for word in commonWords:
|
||||
if len(word) > 2:
|
||||
infoMsg += "'%s', " % word
|
||||
infoMsg += "'%s', " % word
|
||||
|
||||
infoMsg = infoMsg.rstrip(", ")
|
||||
else:
|
||||
@@ -2051,6 +2053,8 @@ def showStaticWords(firstPage, secondPage):
|
||||
|
||||
logger.info(infoMsg)
|
||||
|
||||
return commonWords
|
||||
|
||||
def isWindowsDriveLetterPath(filepath):
|
||||
"""
|
||||
Returns True if given filepath starts with a Windows drive letter
|
||||
|
||||
Reference in New Issue
Block a user