mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Minor patch on request of an user
This commit is contained in:
parent
c2b2ccd2b5
commit
e73ac6c8e3
|
@ -3360,6 +3360,8 @@ def randomizeParameterValue(value):
|
||||||
|
|
||||||
retVal = value
|
retVal = value
|
||||||
|
|
||||||
|
value = re.sub(r"%[0-9a-fA-F]{2}", "", value)
|
||||||
|
|
||||||
for match in re.finditer('[A-Z]+', value):
|
for match in re.finditer('[A-Z]+', value):
|
||||||
retVal = retVal.replace(match.group(), randomStr(len(match.group())).upper())
|
retVal = retVal.replace(match.group(), randomStr(len(match.group())).upper())
|
||||||
|
|
||||||
|
|
|
@ -818,21 +818,23 @@ class Connect(object):
|
||||||
if conf.rParam:
|
if conf.rParam:
|
||||||
def _randomizeParameter(paramString, randomParameter):
|
def _randomizeParameter(paramString, randomParameter):
|
||||||
retVal = paramString
|
retVal = paramString
|
||||||
match = re.search("%s=(?P<value>[^&;]+)" % re.escape(randomParameter), paramString)
|
match = re.search(r"(\A|\b)%s=(?P<value>[^&;]+)" % re.escape(randomParameter), paramString)
|
||||||
if match:
|
if match:
|
||||||
origValue = match.group("value")
|
origValue = match.group("value")
|
||||||
retVal = re.sub("%s=[^&;]+" % re.escape(randomParameter), "%s=%s" % (randomParameter, randomizeParameterValue(origValue)), paramString)
|
retVal = re.sub(r"(\A|\b)%s=[^&;]+" % re.escape(randomParameter), "%s=%s" % (randomParameter, randomizeParameterValue(origValue)), paramString)
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
for randomParameter in conf.rParam:
|
for randomParameter in conf.rParam:
|
||||||
for item in (PLACE.GET, PLACE.POST, PLACE.COOKIE):
|
for item in (PLACE.GET, PLACE.POST, PLACE.COOKIE, PLACE.URI, PLACE.CUSTOM_POST):
|
||||||
if item in conf.parameters:
|
if item in conf.parameters:
|
||||||
if item == PLACE.GET and get:
|
if item == PLACE.GET and get:
|
||||||
get = _randomizeParameter(get, randomParameter)
|
get = _randomizeParameter(get, randomParameter)
|
||||||
elif item == PLACE.POST and post:
|
elif item in (PLACE.POST, PLACE.CUSTOM_POST) and post:
|
||||||
post = _randomizeParameter(post, randomParameter)
|
post = _randomizeParameter(post, randomParameter)
|
||||||
elif item == PLACE.COOKIE and cookie:
|
elif item == PLACE.COOKIE and cookie:
|
||||||
cookie = _randomizeParameter(cookie, randomParameter)
|
cookie = _randomizeParameter(cookie, randomParameter)
|
||||||
|
elif item == PLACE.URI and uri:
|
||||||
|
uri = _randomizeParameter(uri, randomParameter)
|
||||||
|
|
||||||
if conf.evalCode:
|
if conf.evalCode:
|
||||||
delimiter = conf.paramDel or DEFAULT_GET_POST_DELIMITER
|
delimiter = conf.paramDel or DEFAULT_GET_POST_DELIMITER
|
||||||
|
|
Loading…
Reference in New Issue
Block a user