Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix misuse of flags in re.sub() calls
The 4th argument of re.sub() is maximum number of substitutions,
not flags.
  • Loading branch information
jwilk committed Apr 14, 2017
commit bfe5d1145288aff72dd2f49e0ac5f34f2297d605
4 changes: 2 additions & 2 deletions lib/request/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def getPage(**kwargs):

elif target:
if conf.forceSSL and urlparse.urlparse(url).scheme != "https":
url = re.sub("\Ahttp:", "https:", url, re.I)
url = re.sub(":80/", ":443/", url, re.I)
url = re.compile("\Ahttp:", re.I).sub("https:", url)
url = re.sub(":80/", ":443/", url)

if PLACE.GET in conf.parameters and not get:
get = conf.parameters[PLACE.GET]
Expand Down
2 changes: 1 addition & 1 deletion lib/techniques/union/use.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def unionUse(expression, unpack=True, dump=False):

if expressionFieldsList and len(expressionFieldsList) > 1 and "ORDER BY" in expression.upper():
# Removed ORDER BY clause because UNION does not play well with it
expression = re.sub("\s*ORDER BY\s+[\w,]+", "", expression, re.I)
expression = re.compile("\s*ORDER BY\s+[\w,]+", re.I).sub("", expression)
debugMsg = "stripping ORDER BY clause from statement because "
debugMsg += "it does not play well with UNION query SQL injection"
singleTimeDebugMessage(debugMsg)
Expand Down