diff --git a/lib/core/common.py b/lib/core/common.py index a5301bc10..faddf94cb 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -56,7 +56,6 @@ from lib.core.enums import PLACE from lib.core.enums import PAYLOAD from lib.core.enums import REFLECTIVE_COUNTER from lib.core.enums import SORTORDER -from lib.core.enums import WARNFLAGS from lib.core.exception import sqlmapDataException from lib.core.exception import sqlmapFilePathException from lib.core.exception import sqlmapGenericException @@ -665,7 +664,7 @@ def dataToStdout(data, forceOutput=False): warnMsg += "replacement with '?' character. Please, find " warnMsg += "proper character representation inside " warnMsg += "coresponding output files. " - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.DATA_TO_STDOUT) + singleTimeLogMessage(warnMsg) sys.stdout.write(output) else: diff --git a/lib/core/enums.py b/lib/core/enums.py index 2d4ad2790..4c1a59841 100644 --- a/lib/core/enums.py +++ b/lib/core/enums.py @@ -98,16 +98,6 @@ class HTTPHEADER: REFERER = "Referer" USER_AGENT = "User-Agent" -class WARNFLAGS: - NO_CAST = 'NO_CAST' - RANDOM_AGENT = 'RANDOM_AGENT' - DATA_TO_STDOUT = 'DATA_TO_STDOUT' - THREADS = 'THREADS' - PIVOT_LIMIT = 'PIVOT_LIMIT' - TIME_UNRECOVERED = 'TIME_UNRECOVERED' - SINGLE_THREAD = 'SINGLE_THREAD' - UNION_APPEARS = 'UNION_APPEARS' - class EXPECTED: BOOL = "bool" INT = "int" diff --git a/lib/request/connect.py b/lib/request/connect.py index c8a9783a1..69097ad9b 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -8,7 +8,6 @@ See the file 'doc/COPYING' for copying permission """ import httplib -import logging import re import socket import time @@ -44,7 +43,6 @@ from lib.core.enums import HTTPMETHOD from lib.core.enums import NULLCONNECTION from lib.core.enums import PAYLOAD from lib.core.enums import PLACE -from lib.core.enums import WARNFLAGS from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapSyntaxException from lib.core.settings import HTTP_SILENT_TIMEOUT @@ -415,16 +413,16 @@ class Connect: warnMsg += "without flag T in --technique option " warnMsg += "(e.g. --flush-session --technique=BEUS) or try to " warnMsg += "lower the --time-sec value (e.g. --time-sec=2)" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.TIME_UNRECOVERED) + singleTimeLogMessage(warnMsg) elif kb.originalPage is None: warnMsg = "if the problem persists please try to rerun " warnMsg += "with the --random-agent switch turned on " warnMsg += "and/or try to use proxy switches (--ignore-proxy, --proxy,...)" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.RANDOM_AGENT) + singleTimeLogMessage(warnMsg) elif conf.threads > 1: warnMsg = "if the problem persists please try to lower " warnMsg += "the number of used threads (--threads)" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.THREADS) + singleTimeLogMessage(warnMsg) time.sleep(1) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 9e81f651a..c1b6e1f50 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -7,7 +7,6 @@ Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/) See the file 'doc/COPYING' for copying permission """ -import logging import threading import time import traceback @@ -34,7 +33,6 @@ from lib.core.data import logger from lib.core.data import queries from lib.core.enums import DBMS from lib.core.enums import PAYLOAD -from lib.core.enums import WARNFLAGS from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapValueException from lib.core.exception import sqlmapThreadException @@ -118,7 +116,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if conf.threads == 1 and not timeBasedCompare: warnMsg = "running in a single-thread mode. please consider usage of " warnMsg += "--threads option to declare higher number of threads" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.SINGLE_THREAD) + singleTimeLogMessage(warnMsg) if conf.verbose in (1, 2) and not showEta: if isinstance(length, int) and conf.threads > 1: diff --git a/lib/techniques/inband/union/test.py b/lib/techniques/inband/union/test.py index 46ef92eb6..3f3b650b7 100644 --- a/lib/techniques/inband/union/test.py +++ b/lib/techniques/inband/union/test.py @@ -7,7 +7,6 @@ Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/) See the file 'doc/COPYING' for copying permission """ -import logging import random import re import time @@ -34,7 +33,6 @@ from lib.core.data import logger from lib.core.data import queries from lib.core.enums import DBMS from lib.core.enums import PAYLOAD -from lib.core.enums import WARNFLAGS from lib.core.settings import FROM_TABLE from lib.core.settings import UNION_MIN_RESPONSE_CHARS from lib.core.settings import UNION_STDEV_COEFF @@ -216,7 +214,7 @@ def __unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix warnMsg = "please consider usage of --union-char option " warnMsg += "(e.g. --union-char=1) and/or try to force " warnMsg += "back-end DBMS (e.g. --dbms=mysql) to make it work" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.UNION_APPEARS) + singleTimeLogMessage(warnMsg) return validPayload, vector diff --git a/lib/techniques/inband/union/use.py b/lib/techniques/inband/union/use.py index 987932c5e..d76e94345 100644 --- a/lib/techniques/inband/union/use.py +++ b/lib/techniques/inband/union/use.py @@ -7,7 +7,6 @@ Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/) See the file 'doc/COPYING' for copying permission """ -import logging import re import threading import time @@ -34,7 +33,6 @@ from lib.core.data import logger from lib.core.data import queries from lib.core.enums import DBMS from lib.core.enums import PAYLOAD -from lib.core.enums import WARNFLAGS from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapSyntaxException from lib.core.settings import FROM_TABLE @@ -96,7 +94,7 @@ def __oneShotUnionUse(expression, unpack=True): warnMsg = "if the problem persists with 'None' values please try to use " warnMsg += "hidden switch --no-cast (fixing problems with some collation " warnMsg += "issues)" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.NO_CAST) + singleTimeLogMessage(warnMsg) return output diff --git a/lib/utils/hash.py b/lib/utils/hash.py index f7a8ab40a..e49045385 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -210,7 +210,7 @@ def crypt_generic_passwd(password, salt, uppercase=False): retVal = crypt(password, salt) - return retVal.upper() if uppercase else retVal.lower() + return retVal.upper() if uppercase else retVal __functions__ = { HASH.MYSQL: mysql_passwd, diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index bc1746ff9..ba938fe11 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -7,7 +7,6 @@ Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/) See the file 'doc/COPYING' for copying permission """ -import logging import re import time @@ -49,7 +48,6 @@ from lib.core.dicts import firebirdPrivs from lib.core.enums import DBMS from lib.core.enums import EXPECTED from lib.core.enums import PAYLOAD -from lib.core.enums import WARNFLAGS from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapMissingMandatoryOptionException from lib.core.exception import sqlmapNoneDataException @@ -1412,7 +1410,7 @@ class Enumeration: if (i + 1) < conf.limitStart: warnMsg = "skipping first %d pivot " % conf.limitStart warnMsg += "point values" - singleTimeLogMessage(warnMsg, logging.WARN, WARNFLAGS.PIVOT_LIMIT) + singleTimeLogMessage(warnMsg) break elif (i + 1) > conf.limitStop: breakRetrieval = True