mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
Update related to the last commit
This commit is contained in:
@@ -17,6 +17,7 @@ from lib.core.common import Backend
|
||||
from lib.core.common import extractErrorMessage
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getPublicTypeMembers
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import isListLike
|
||||
from lib.core.common import randomStr
|
||||
@@ -280,10 +281,10 @@ def decodePage(page, contentEncoding, contentType):
|
||||
raise Exception("size too large")
|
||||
|
||||
page = data.read()
|
||||
except Exception, msg:
|
||||
except Exception as ex:
|
||||
if "<html" not in page: # in some cases, invalid "Content-Encoding" appears for plain HTML (should be ignored)
|
||||
errMsg = "detected invalid data for declared content "
|
||||
errMsg += "encoding '%s' ('%s')" % (contentEncoding, msg)
|
||||
errMsg += "encoding '%s' ('%s')" % (contentEncoding, getSafeExString(ex))
|
||||
singleTimeLogMessage(errMsg, logging.ERROR)
|
||||
|
||||
warnMsg = "turning off page compression"
|
||||
|
||||
@@ -5,6 +5,8 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import socket
|
||||
@@ -145,13 +147,13 @@ if __name__ == "__main__":
|
||||
if _ is None:
|
||||
break
|
||||
else:
|
||||
print "[i] %s" % _
|
||||
print("[i] %s" % _)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
except socket.error as ex:
|
||||
if 'Permission' in str(ex):
|
||||
print "[x] Please run with sudo/Administrator privileges"
|
||||
print("[x] Please run with sudo/Administrator privileges")
|
||||
else:
|
||||
raise
|
||||
except KeyboardInterrupt:
|
||||
|
||||
@@ -16,6 +16,7 @@ from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.common import getHostHeader
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import logHTTPTraffic
|
||||
from lib.core.common import readInput
|
||||
@@ -75,9 +76,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||
|
||||
try:
|
||||
content = fp.read(MAX_CONNECTION_TOTAL_SIZE)
|
||||
except Exception, msg:
|
||||
except Exception as ex:
|
||||
dbgMsg = "there was a problem while retrieving "
|
||||
dbgMsg += "redirect response content (%s)" % msg
|
||||
dbgMsg += "redirect response content ('%s')" % getSafeExString(ex)
|
||||
logger.debug(dbgMsg)
|
||||
finally:
|
||||
if content:
|
||||
|
||||
Reference in New Issue
Block a user