mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
implementation of referer feature
This commit is contained in:
@@ -108,7 +108,7 @@ class Agent:
|
||||
retValue = ET.tostring(root)
|
||||
elif place == PLACE.URI:
|
||||
retValue = paramString.replace("%s%s" % (origValue, URI_INJECTION_MARK_CHAR), self.addPayloadDelimiters(newValue))
|
||||
elif place == PLACE.UA:
|
||||
elif place in (PLACE.UA, PLACE.REFERER):
|
||||
retValue = paramString.replace(origValue, self.addPayloadDelimiters(newValue))
|
||||
else:
|
||||
retValue = paramString.replace("%s=%s" % (parameter, origValue),
|
||||
|
||||
@@ -41,6 +41,7 @@ class PLACE:
|
||||
URI = "URI"
|
||||
COOKIE = "Cookie"
|
||||
UA = "User-Agent"
|
||||
REFERER = "Referer"
|
||||
|
||||
class HTTPMETHOD:
|
||||
GET = "GET"
|
||||
|
||||
@@ -123,6 +123,20 @@ def __setRequestParams():
|
||||
conf.paramDict[PLACE.UA] = { PLACE.UA: headerValue }
|
||||
__testableParameters = True
|
||||
|
||||
elif httpHeader == PLACE.REFERER:
|
||||
# No need for url encoding/decoding the referer
|
||||
conf.parameters[PLACE.REFERER] = urldecode(headerValue)
|
||||
|
||||
condition = not conf.testParameter
|
||||
condition |= PLACE.REFERER in conf.testParameter
|
||||
condition |= "referer" in conf.testParameter
|
||||
condition |= "referrer" in conf.testParameter
|
||||
condition |= "ref" in conf.testParameter
|
||||
|
||||
if condition:
|
||||
conf.paramDict[PLACE.REFERER] = { PLACE.REFERER: headerValue }
|
||||
__testableParameters = True
|
||||
|
||||
if not conf.parameters:
|
||||
errMsg = "you did not provide any GET, POST and Cookie "
|
||||
errMsg += "parameter, neither an User-Agent header"
|
||||
|
||||
Reference in New Issue
Block a user