MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / parseUnionPage

Function parseUnionPage

lib/core/common.py:1908–1955  ·  view source on GitHub ↗

Returns resulting items from UNION query inside provided page content >>> parseUnionPage("%sfoo%s%sbar%s" % (kb.chars.start, kb.chars.stop, kb.chars.start, kb.chars.stop)) ['foo', 'bar']

(page)

Source from the content-addressed store, hash-verified

1906 return retVal
1907
1908def parseUnionPage(page):
1909 """
1910 Returns resulting items from UNION query inside provided page content
1911
1912 >>> parseUnionPage("%sfoo%s%sbar%s" % (kb.chars.start, kb.chars.stop, kb.chars.start, kb.chars.stop))
1913 ['foo', 'bar']
1914 """
1915
1916 if page is None:
1917 return None
1918
1919 if re.search(r"(?si)\A%s.*%s\Z" % (kb.chars.start, kb.chars.stop), page):
1920 if len(page) > LARGE_OUTPUT_THRESHOLD:
1921 warnMsg = "large output detected. This might take a while"
1922 logger.warning(warnMsg)
1923
1924 data = BigArray()
1925 keys = set()
1926
1927 for match in re.finditer(r"%s(.*?)%s" % (kb.chars.start, kb.chars.stop), page, re.DOTALL | re.IGNORECASE):
1928 entry = match.group(1)
1929
1930 if kb.chars.start in entry:
1931 entry = entry.split(kb.chars.start)[-1]
1932
1933 if kb.unionDuplicates:
1934 key = entry.lower()
1935 if key not in keys:
1936 keys.add(key)
1937 else:
1938 continue
1939
1940 entry = entry.split(kb.chars.delimiter)
1941
1942 if conf.hexConvert:
1943 entry = applyFunctionRecursively(entry, decodeDbmsHexValue)
1944
1945 if kb.safeCharEncode:
1946 entry = applyFunctionRecursively(entry, safecharencode)
1947
1948 data.append(entry[0] if len(entry) == 1 else entry)
1949 else:
1950 data = page
1951
1952 if len(data) == 1 and isinstance(data[0], six.string_types):
1953 data = data[0]
1954
1955 return data
1956
1957def parseFilePaths(page):
1958 """

Callers 3

_goUnionFunction · 0.90
unionUseFunction · 0.90
unionThreadFunction · 0.90

Calls 5

appendMethod · 0.95
BigArrayClass · 0.90
applyFunctionRecursivelyFunction · 0.85
searchMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…