mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Renaming conf.cDel to conf.cookieDel
This commit is contained in:
parent
0ae8ac707e
commit
7cc4159316
|
@ -539,7 +539,7 @@ def paramToDict(place, parameters=None):
|
||||||
parameters = parameters.replace(", ", ",")
|
parameters = parameters.replace(", ", ",")
|
||||||
parameters = re.sub(r"&(\w{1,4});", r"%s\g<1>%s" % (PARAMETER_AMP_MARKER, PARAMETER_SEMICOLON_MARKER), parameters)
|
parameters = re.sub(r"&(\w{1,4});", r"%s\g<1>%s" % (PARAMETER_AMP_MARKER, PARAMETER_SEMICOLON_MARKER), parameters)
|
||||||
if place == PLACE.COOKIE:
|
if place == PLACE.COOKIE:
|
||||||
splitParams = parameters.split(conf.cDel or DEFAULT_COOKIE_DELIMITER)
|
splitParams = parameters.split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER)
|
||||||
else:
|
else:
|
||||||
splitParams = parameters.split(conf.paramDel or DEFAULT_GET_POST_DELIMITER)
|
splitParams = parameters.split(conf.paramDel or DEFAULT_GET_POST_DELIMITER)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ optDict = {
|
||||||
"data": "string",
|
"data": "string",
|
||||||
"paramDel": "string",
|
"paramDel": "string",
|
||||||
"cookie": "string",
|
"cookie": "string",
|
||||||
"cDel": "string",
|
"cookieDel": "string",
|
||||||
"loadCookies": "string",
|
"loadCookies": "string",
|
||||||
"dropSetCookie": "boolean",
|
"dropSetCookie": "boolean",
|
||||||
"agent": "string",
|
"agent": "string",
|
||||||
|
|
|
@ -88,7 +88,7 @@ def cmdLineParser():
|
||||||
request.add_option("--cookie", dest="cookie",
|
request.add_option("--cookie", dest="cookie",
|
||||||
help="HTTP Cookie header value")
|
help="HTTP Cookie header value")
|
||||||
|
|
||||||
request.add_option("--cookie-del", dest="cDel",
|
request.add_option("--cookie-del", dest="cookieDel",
|
||||||
help="Character used for splitting cookie values")
|
help="Character used for splitting cookie values")
|
||||||
|
|
||||||
request.add_option("--load-cookies", dest="loadCookies",
|
request.add_option("--load-cookies", dest="loadCookies",
|
||||||
|
|
|
@ -94,7 +94,7 @@ def forgeHeaders(items=None):
|
||||||
kb.mergeCookies = not _ or _[0] in ("y", "Y")
|
kb.mergeCookies = not _ or _[0] in ("y", "Y")
|
||||||
|
|
||||||
if kb.mergeCookies:
|
if kb.mergeCookies:
|
||||||
_ = lambda x: re.sub("(?i)%s=[^%s]+" % (cookie.name, conf.cDel or DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, getUnicode(cookie.value)), x)
|
_ = lambda x: re.sub("(?i)%s=[^%s]+" % (cookie.name, conf.cookieDel or DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, getUnicode(cookie.value)), x)
|
||||||
headers[HTTP_HEADER.COOKIE] = _(headers[HTTP_HEADER.COOKIE])
|
headers[HTTP_HEADER.COOKIE] = _(headers[HTTP_HEADER.COOKIE])
|
||||||
|
|
||||||
if PLACE.COOKIE in conf.parameters:
|
if PLACE.COOKIE in conf.parameters:
|
||||||
|
@ -103,7 +103,7 @@ def forgeHeaders(items=None):
|
||||||
conf.httpHeaders = [(item[0], item[1] if item[0] != HTTP_HEADER.COOKIE else _(item[1])) for item in conf.httpHeaders]
|
conf.httpHeaders = [(item[0], item[1] if item[0] != HTTP_HEADER.COOKIE else _(item[1])) for item in conf.httpHeaders]
|
||||||
|
|
||||||
elif not kb.testMode:
|
elif not kb.testMode:
|
||||||
headers[HTTP_HEADER.COOKIE] += "%s %s=%s" % (conf.cDel or DEFAULT_COOKIE_DELIMITER, cookie.name, getUnicode(cookie.value))
|
headers[HTTP_HEADER.COOKIE] += "%s %s=%s" % (conf.cookieDel or DEFAULT_COOKIE_DELIMITER, cookie.name, getUnicode(cookie.value))
|
||||||
|
|
||||||
if kb.testMode:
|
if kb.testMode:
|
||||||
resetCookieJar(conf.cj)
|
resetCookieJar(conf.cj)
|
||||||
|
|
|
@ -769,7 +769,7 @@ class Connect(object):
|
||||||
evaluateCode("%s=%s" % (name.strip(), repr(value)), variables)
|
evaluateCode("%s=%s" % (name.strip(), repr(value)), variables)
|
||||||
|
|
||||||
if cookie:
|
if cookie:
|
||||||
for part in cookie.split(conf.cDel or DEFAULT_COOKIE_DELIMITER):
|
for part in cookie.split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER):
|
||||||
if '=' in part:
|
if '=' in part:
|
||||||
name, value = part.split('=', 1)
|
name, value = part.split('=', 1)
|
||||||
value = urldecode(value, convall=True)
|
value = urldecode(value, convall=True)
|
||||||
|
@ -793,7 +793,7 @@ class Connect(object):
|
||||||
found = True
|
found = True
|
||||||
post = re.sub(regex, "\g<1>%s\g<3>" % value, post)
|
post = re.sub(regex, "\g<1>%s\g<3>" % value, post)
|
||||||
|
|
||||||
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re.escape(conf.cDel or DEFAULT_COOKIE_DELIMITER), name, re.escape(conf.cDel or DEFAULT_COOKIE_DELIMITER))
|
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER), name, re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER))
|
||||||
if re.search(regex, (cookie or "")):
|
if re.search(regex, (cookie or "")):
|
||||||
found = True
|
found = True
|
||||||
cookie = re.sub(regex, "\g<1>%s\g<3>" % value, cookie)
|
cookie = re.sub(regex, "\g<1>%s\g<3>" % value, cookie)
|
||||||
|
@ -804,7 +804,7 @@ class Connect(object):
|
||||||
elif get is not None:
|
elif get is not None:
|
||||||
get += "%s%s=%s" % (delimiter, name, value)
|
get += "%s%s=%s" % (delimiter, name, value)
|
||||||
elif cookie is not None:
|
elif cookie is not None:
|
||||||
cookie += "%s%s=%s" % (conf.cDel or DEFAULT_COOKIE_DELIMITER, name, value)
|
cookie += "%s%s=%s" % (conf.cookieDel or DEFAULT_COOKIE_DELIMITER, name, value)
|
||||||
|
|
||||||
if not conf.skipUrlEncode:
|
if not conf.skipUrlEncode:
|
||||||
get = urlencode(get, limit=True)
|
get = urlencode(get, limit=True)
|
||||||
|
|
|
@ -113,7 +113,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||||
if redurl and kb.redirectChoice == REDIRECTION.YES:
|
if redurl and kb.redirectChoice == REDIRECTION.YES:
|
||||||
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
||||||
if headers and HTTP_HEADER.SET_COOKIE in headers:
|
if headers and HTTP_HEADER.SET_COOKIE in headers:
|
||||||
req.headers[HTTP_HEADER.COOKIE] = headers[HTTP_HEADER.SET_COOKIE].split(conf.cDel or DEFAULT_COOKIE_DELIMITER)[0]
|
req.headers[HTTP_HEADER.COOKIE] = headers[HTTP_HEADER.SET_COOKIE].split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER)[0]
|
||||||
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
||||||
else:
|
else:
|
||||||
result = fp
|
result = fp
|
||||||
|
|
|
@ -46,7 +46,7 @@ paramDel =
|
||||||
cookie =
|
cookie =
|
||||||
|
|
||||||
# Character used for splitting cookie values
|
# Character used for splitting cookie values
|
||||||
cDel =
|
cookieDel =
|
||||||
|
|
||||||
# File containing cookies in Netscape/wget format
|
# File containing cookies in Netscape/wget format
|
||||||
loadCookies =
|
loadCookies =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user