mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 03:23:48 +03:00
added switch --load-cookies
This commit is contained in:
parent
4cfea96471
commit
b4cf8b05b3
|
@ -148,7 +148,12 @@ def __urllib2Opener():
|
||||||
handlers = [proxyHandler, authHandler, redirectHandler, rangeHandler]
|
handlers = [proxyHandler, authHandler, redirectHandler, rangeHandler]
|
||||||
|
|
||||||
if not conf.dropSetCookie:
|
if not conf.dropSetCookie:
|
||||||
conf.cj = cookielib.LWPCookieJar()
|
if not conf.loC:
|
||||||
|
conf.cj = cookielib.CookieJar()
|
||||||
|
else:
|
||||||
|
conf.cj = cookielib.MozillaCookieJar()
|
||||||
|
conf.cj.load(conf.loC)
|
||||||
|
|
||||||
handlers.append(urllib2.HTTPCookieProcessor(conf.cj))
|
handlers.append(urllib2.HTTPCookieProcessor(conf.cj))
|
||||||
|
|
||||||
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
|
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
|
||||||
|
|
|
@ -26,6 +26,7 @@ optDict = {
|
||||||
"data": "string",
|
"data": "string",
|
||||||
"pDel": "string",
|
"pDel": "string",
|
||||||
"cookie": "string",
|
"cookie": "string",
|
||||||
|
"loC": "string",
|
||||||
"cookieUrlencode": "boolean",
|
"cookieUrlencode": "boolean",
|
||||||
"dropSetCookie": "boolean",
|
"dropSetCookie": "boolean",
|
||||||
"agent": "string",
|
"agent": "string",
|
||||||
|
|
|
@ -73,6 +73,9 @@ def cmdLineParser():
|
||||||
request.add_option("--cookie", dest="cookie",
|
request.add_option("--cookie", dest="cookie",
|
||||||
help="HTTP Cookie header")
|
help="HTTP Cookie header")
|
||||||
|
|
||||||
|
request.add_option("--load-cookies", dest="loC",
|
||||||
|
help="File containing cookies in Netscape/wget format")
|
||||||
|
|
||||||
request.add_option("--cookie-urlencode", dest="cookieUrlencode",
|
request.add_option("--cookie-urlencode", dest="cookieUrlencode",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="URL Encode generated cookie injections")
|
help="URL Encode generated cookie injections")
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Google:
|
||||||
|
|
||||||
def __init__(self, handlers):
|
def __init__(self, handlers):
|
||||||
self._matches = []
|
self._matches = []
|
||||||
self._cj = cookielib.LWPCookieJar()
|
self._cj = cookielib.CookieJar()
|
||||||
|
|
||||||
handlers.append(urllib2.HTTPCookieProcessor(self._cj))
|
handlers.append(urllib2.HTTPCookieProcessor(self._cj))
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,9 @@ pDel =
|
||||||
# HTTP Cookie header.
|
# HTTP Cookie header.
|
||||||
cookie =
|
cookie =
|
||||||
|
|
||||||
|
# File containing cookies in Netscape/wget format
|
||||||
|
loC =
|
||||||
|
|
||||||
# URL-encode generated cookie injections.
|
# URL-encode generated cookie injections.
|
||||||
# Valid: True or False
|
# Valid: True or False
|
||||||
cookieUrlencode = False
|
cookieUrlencode = False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user