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

Function parseFilePaths

lib/core/common.py:1957–1975  ·  view source on GitHub ↗

Detects (possible) absolute system paths inside the provided page content >>> _ = "/var/www/html/index.php"; parseFilePaths(" Error occurred at line 207 of: %s Please contact your administrator " % _); _ in kb.absFilePaths True

(page)

Source from the content-addressed store, hash-verified

1955 return data
1956
1957def parseFilePaths(page):
1958 """
1959 Detects (possible) absolute system paths inside the provided page content
1960
1961 >>> _ = "/var/www/html/index.php"; parseFilePaths("<html>Error occurred at line 207 of: %s<br>Please contact your administrator</html>" % _); _ in kb.absFilePaths
1962 True
1963 """
1964
1965 if page:
1966 for regex in FILE_PATH_REGEXES:
1967 for match in re.finditer(regex, page):
1968 absFilePath = match.group("result").strip()
1969 page = page.replace(absFilePath, "")
1970
1971 if isWindowsDriveLetterPath(absFilePath):
1972 absFilePath = posixToNtSlashes(absFilePath)
1973
1974 if absFilePath not in kb.absFilePaths:
1975 kb.absFilePaths.add(absFilePath)
1976
1977def getLocalIP():
1978 """

Callers 2

webInitMethod · 0.90

Calls 4

isWindowsDriveLetterPathFunction · 0.85
posixToNtSlashesFunction · 0.85
replaceMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…