mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-23 01:56:36 +03:00
Minor bug fix to --cookie-urlencode
This commit is contained in:
parent
c4215ce8d2
commit
505647b00f
|
@ -26,7 +26,6 @@ import re
|
||||||
|
|
||||||
from lib.core.common import randomInt
|
from lib.core.common import randomInt
|
||||||
from lib.core.common import randomStr
|
from lib.core.common import randomStr
|
||||||
from lib.core.convert import urlencode
|
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import queries
|
from lib.core.data import queries
|
||||||
|
@ -79,11 +78,6 @@ class Agent:
|
||||||
retValue = paramString.replace("%s=%s" % (parameter, value),
|
retValue = paramString.replace("%s=%s" % (parameter, value),
|
||||||
"%s=%s" % (parameter, newValue))
|
"%s=%s" % (parameter, newValue))
|
||||||
|
|
||||||
if conf.cookieUrlencode and (kb.injPlace == "Cookie" or place == "Cookie"):
|
|
||||||
name = retValue[:retValue.find('=')]
|
|
||||||
value = retValue[retValue.find('=') + 1:]
|
|
||||||
retValue = "%s=%s" % (name, urlencode(value, convall=True))
|
|
||||||
|
|
||||||
return retValue
|
return retValue
|
||||||
|
|
||||||
def fullPayload(self, query):
|
def fullPayload(self, query):
|
||||||
|
|
|
@ -28,9 +28,10 @@ import re
|
||||||
import StringIO
|
import StringIO
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
|
from lib.core.common import directoryPath
|
||||||
|
from lib.core.common import sanitizeCookie
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.common import directoryPath
|
|
||||||
from lib.parse.headers import headersParser
|
from lib.parse.headers import headersParser
|
||||||
from lib.parse.html import htmlParser
|
from lib.parse.html import htmlParser
|
||||||
|
|
||||||
|
@ -44,6 +45,9 @@ def forgeHeaders(cookie, ua):
|
||||||
|
|
||||||
for header, value in conf.httpHeaders:
|
for header, value in conf.httpHeaders:
|
||||||
if cookie and header == "Cookie":
|
if cookie and header == "Cookie":
|
||||||
|
if conf.cookieUrlencode:
|
||||||
|
cookie = sanitizeCookie(cookie)
|
||||||
|
|
||||||
headers[header] = cookie
|
headers[header] = cookie
|
||||||
elif ua and header == "User-Agent":
|
elif ua and header == "User-Agent":
|
||||||
headers[header] = ua
|
headers[header] = ua
|
||||||
|
|
Loading…
Reference in New Issue
Block a user