mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +03:00
Minor fix regarding POST redirects (ML)
This commit is contained in:
parent
04c1d439a7
commit
e4b23c9beb
|
@ -639,6 +639,12 @@ class Connect(object):
|
|||
_ = urlparse.urlsplit(conn.redurl)
|
||||
_ = ("%s%s" % (_.path or "/", ("?%s" % _.query) if _.query else ""))
|
||||
requestMsg = re.sub("(\n[A-Z]+ ).+?( HTTP/\d)", "\g<1>%s\g<2>" % re.escape(getUnicode(_)), requestMsg, 1)
|
||||
|
||||
if kb.resendPostOnRedirect is False:
|
||||
requestMsg = re.sub("(\[#\d+\]:\n)POST ", "\g<1>GET ", requestMsg)
|
||||
requestMsg = re.sub("(?i)Content-length: \d+\n", "", requestMsg)
|
||||
requestMsg = re.sub("(?s)\n\n.+", "\n", requestMsg)
|
||||
|
||||
responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, conn.code, status)
|
||||
else:
|
||||
responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
|
||||
|
|
|
@ -61,8 +61,8 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
|||
|
||||
kb.resendPostOnRedirect = choice.upper() == 'Y'
|
||||
|
||||
if kb.resendPostOnRedirect:
|
||||
self.redirect_request = self._redirect_request
|
||||
if kb.resendPostOnRedirect:
|
||||
self.redirect_request = self._redirect_request
|
||||
|
||||
def _redirect_request(self, req, fp, code, msg, headers, newurl):
|
||||
newurl = newurl.replace(' ', '%20')
|
||||
|
|
Loading…
Reference in New Issue
Block a user