Treating Cookie header provided with -H/--headers as --cookie (i.e. testable Cookie parameters)

This commit is contained in:
Miroslav Štampar 2026-11-12 19:08:34 +01:00
parent 2351bd82dd
commit 32edb6a45e
2 changed files with 6 additions and 2 deletions

View file

@ -1641,7 +1641,11 @@ def _setHTTPExtraHeaders():
header, value = (_.lstrip() for _ in headerValue.split(":", 1))
if header and value:
conf.httpHeaders.append((header, value))
# Note: Cookie header provided this way is treated as --cookie (i.e. its parameters become testable)
if header.upper() == HTTP_HEADER.COOKIE.upper() and not conf.cookie:
conf.cookie = value
else:
conf.httpHeaders.append((header, value))
else:
errMsg = "invalid header value: %s. Valid header format is 'name:value'" % repr(headerValue).lstrip('u')
raise SqlmapSyntaxException(errMsg)

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.76"
VERSION = "1.10.11.77"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)