1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-16 04:39:03 +00:00

Allows the HTTP Set-Cookie parser to handle a trailing semicolon. Fixes #731

This commit is contained in:
nnposter
2017-03-21 13:46:30 +00:00
parent 8b8f56eced
commit b34eaabb3b
2 changed files with 6 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o [NSE][GH#731] NSE is now able to process HTTP responses with a Set-Cookie
header that has an extraneous trailing semicolon. [nnposter]
o [Nsock] Handle any and all socket connect errors the same: raise as an Nsock o [Nsock] Handle any and all socket connect errors the same: raise as an Nsock
error instead of fatal. This prevents Nmap and Ncat from quitting with error instead of fatal. This prevents Nmap and Ncat from quitting with
"Strange error from connect:" [Daniel Miller] "Strange error from connect:" [Daniel Miller]

View File

@@ -762,6 +762,9 @@ parse_set_cookie = function (s)
while s:sub(pos, pos) == ";" do while s:sub(pos, pos) == ";" do
pos = pos + 1 pos = pos + 1
pos = skip_space(s, pos) pos = skip_space(s, pos)
if pos > #s then
break
end
pos, name = get_token(s, pos) pos, name = get_token(s, pos)
if not name then if not name then
return nil, string.format("Can't get attribute name of cookie \"%s\".", cookie.name) return nil, string.format("Can't get attribute name of cookie \"%s\".", cookie.name)