mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
Fixing DeprecationWarning (logger.warn)
This commit is contained in:
@@ -810,7 +810,7 @@ def checkSqlInjection(place, parameter, value):
|
||||
|
||||
except KeyboardInterrupt:
|
||||
warnMsg = "user aborted during detection phase"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
if conf.multipleTargets:
|
||||
msg = "how do you want to proceed? [ne(X)t target/(s)kip current test/(e)nd detection phase/(n)ext parameter/(c)hange verbosity/(q)uit]"
|
||||
@@ -826,7 +826,7 @@ def checkSqlInjection(place, parameter, value):
|
||||
choice = None
|
||||
while not ((choice or "").isdigit() and 0 <= int(choice) <= 6):
|
||||
if choice:
|
||||
logger.warn("invalid value")
|
||||
logger.warning("invalid value")
|
||||
msg = "enter new verbosity level: [0-6] "
|
||||
choice = readInput(msg, default=str(conf.verbose), checkBatch=False)
|
||||
conf.verbose = int(choice)
|
||||
@@ -851,7 +851,7 @@ def checkSqlInjection(place, parameter, value):
|
||||
warnMsg = "in OR boolean-based injection cases, please consider usage "
|
||||
warnMsg += "of switch '--drop-set-cookie' if you experience any "
|
||||
warnMsg += "problems during data retrieval"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
if not checkFalsePositives(injection):
|
||||
if conf.hostname in kb.vulnHosts:
|
||||
@@ -976,7 +976,7 @@ def checkFalsePositives(injection):
|
||||
|
||||
if not retVal:
|
||||
warnMsg = "false positive or unexploitable injection point detected"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
kb.injection = popValue()
|
||||
|
||||
@@ -1002,7 +1002,7 @@ def checkSuhosinPatch(injection):
|
||||
warnMsg = "parameter length constraining "
|
||||
warnMsg += "mechanism detected (e.g. Suhosin patch). "
|
||||
warnMsg += "Potential problems in enumeration phase can be expected"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
kb.injection = popValue()
|
||||
|
||||
@@ -1023,7 +1023,7 @@ def checkFilteredChars(injection):
|
||||
warnMsg += "filtered by the back-end server. There is a strong "
|
||||
warnMsg += "possibility that sqlmap won't be able to properly "
|
||||
warnMsg += "exploit this vulnerability"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
# inference techniques depend on character '>'
|
||||
if not any(_ in injection.data for _ in (PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.QUERY)):
|
||||
@@ -1031,7 +1031,7 @@ def checkFilteredChars(injection):
|
||||
warnMsg = "it appears that the character '>' is "
|
||||
warnMsg += "filtered by the back-end server. You are strongly "
|
||||
warnMsg += "advised to rerun with the '--tamper=between'"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
kb.injection = popValue()
|
||||
|
||||
@@ -1122,7 +1122,7 @@ def heuristicCheckSqlInjection(place, parameter):
|
||||
|
||||
else:
|
||||
infoMsg += "not be injectable"
|
||||
logger.warn(infoMsg)
|
||||
logger.warning(infoMsg)
|
||||
|
||||
kb.heuristicMode = True
|
||||
kb.disableHtmlDecoding = True
|
||||
@@ -1230,7 +1230,7 @@ def checkDynamicContent(firstPage, secondPage):
|
||||
if count > conf.retries:
|
||||
warnMsg = "target URL content appears to be too dynamic. "
|
||||
warnMsg += "Switching to '--text-only' "
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
conf.textOnly = True
|
||||
return
|
||||
@@ -1288,7 +1288,7 @@ def checkStability():
|
||||
warnMsg += "injectable parameters are detected, or in case of "
|
||||
warnMsg += "junk results, refer to user's manual paragraph "
|
||||
warnMsg += "'Page comparison'"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
message = "how do you want to proceed? [(C)ontinue/(s)tring/(r)egex/(q)uit] "
|
||||
choice = readInput(message, default='C').upper()
|
||||
@@ -1513,7 +1513,7 @@ def checkConnection(suppressOutput=False):
|
||||
warnMsg = "you provided '%s' as the string to " % conf.string
|
||||
warnMsg += "match, but such a string is not within the target "
|
||||
warnMsg += "URL raw response, sqlmap will carry on anyway"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
if conf.regexp:
|
||||
infoMsg = "testing if the provided regular expression matches within "
|
||||
@@ -1524,7 +1524,7 @@ def checkConnection(suppressOutput=False):
|
||||
warnMsg = "you provided '%s' as the regular expression " % conf.regexp
|
||||
warnMsg += "which does not have any match within the target URL raw response. sqlmap "
|
||||
warnMsg += "will carry on anyway"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
|
||||
kb.errorIsNone = False
|
||||
|
||||
@@ -1539,12 +1539,12 @@ def checkConnection(suppressOutput=False):
|
||||
elif wasLastResponseDBMSError():
|
||||
warnMsg = "there is a DBMS error found in the HTTP response body "
|
||||
warnMsg += "which could interfere with the results of the tests"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
elif wasLastResponseHTTPError():
|
||||
if getLastRequestHTTPError() not in (conf.ignoreCode or []):
|
||||
warnMsg = "the web server responded with an HTTP error code (%d) " % getLastRequestHTTPError()
|
||||
warnMsg += "which could interfere with the results of the tests"
|
||||
logger.warn(warnMsg)
|
||||
logger.warning(warnMsg)
|
||||
else:
|
||||
kb.errorIsNone = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user