1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-05 21:16:33 +00:00

Fix path traversal. Dots are escaped by % in Lua, not by \.

This commit is contained in:
d33tah
2013-09-10 23:42:59 +00:00
parent 5083b40527
commit a0bd430087

View File

@@ -315,8 +315,8 @@ first_char = resource:sub(0, 1)
--(Windows drive names are not welcome too.)
drive = resource:match("^([a-zA-Z]):")
if first_char == "." or first_char == "/" or first_char == "\\" or drive
or resource:find("/\\.\\./?") or resource:find("\\\\.\\.\\?")
or resource:find("/?\\.\\./") or resource:find("\\?\\.\\.\\") then
or resource:find("/%.%./?") or resource:find("\\%.%.\\?")
or resource:find("/?%.%./") or resource:find("\\?%.%.\\") then
do_403() --no hidden Unix files or simple directory traversal, sorry!
end