1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Removes dot and dot-dot path segments from parsed URLs

This commit is contained in:
nnposter
2018-02-26 00:27:36 +00:00
parent 4303c2f6ea
commit fcac8c6e28

View File

@@ -433,6 +433,9 @@ URL = {
-- and is simpler for now.
self.file = self.raw:match("^http[s]?://[^:/]*[:]?%d*(/[^#]*)") or '/'
self.path = parsed.path
-- Normalize the values; removes dot and dot-dot path segments
self.file = url.absolute("", self.file)
self.path = url.absolute("", self.path)
self.dir = self.path:match("^(.+%/)") or "/"
-- TODO: Use public suffix list to extract domain
self.domain= self.host:match("^[^%.]-%.(.*)")