diff --git a/lib/core/common.py b/lib/core/common.py index 87ec4d8e5..e424001c7 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1011,8 +1011,8 @@ def parseTargetDirect(): conf.hostname = "localhost" conf.port = 0 elif not remote: - errMsg = "missing remote connection details" - raise SqlmapSyntaxException(errMsg) + errMsg = "missing remote connection details" + raise SqlmapSyntaxException(errMsg) if dbmsName in (DBMS.MSSQL, DBMS.SYBASE): import _mssql diff --git a/lib/core/option.py b/lib/core/option.py index e39046eae..b11bd45f8 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -750,7 +750,7 @@ def _setOS(): def _setTechnique(): validTechniques = sorted(getPublicTypeMembers(PAYLOAD.TECHNIQUE), key=lambda x: x[1]) - validLetters = map(lambda x: x[0][0].upper(), validTechniques) + validLetters = (_[0][0].upper() for _ in validTechniques) if conf.tech and isinstance(conf.tech, basestring): _ = [] diff --git a/lib/core/target.py b/lib/core/target.py index 09865e7b2..9ccec202f 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -130,7 +130,7 @@ def _setRequestParams(): kb.processUserMarks = True if kb.postHint else kb.processUserMarks - if re.search(URI_INJECTABLE_REGEX, conf.url, re.I) and not any(map(lambda place: place in conf.parameters, [PLACE.GET, PLACE.POST])): + if re.search(URI_INJECTABLE_REGEX, conf.url, re.I) and not any(place in conf.parameters for place in (PLACE.GET, PLACE.POST)): warnMsg = "you've provided target url without any GET " warnMsg += "parameters (e.g. www.site.com/article.php?id=1) " warnMsg += "and without providing any POST parameters " diff --git a/lib/core/threads.py b/lib/core/threads.py index 528ba0aa3..d9994b91f 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -104,7 +104,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio kb.threadContinue = True kb.threadException = False - if threadChoice and numThreads == 1 and any(map(lambda _: _ in kb.injection.data, (PAYLOAD.TECHNIQUE.BOOLEAN, PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.QUERY, PAYLOAD.TECHNIQUE.UNION))): + if threadChoice and numThreads == 1 and any(_ in kb.injection.data for _ in (PAYLOAD.TECHNIQUE.BOOLEAN, PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.QUERY, PAYLOAD.TECHNIQUE.UNION)): while True: message = "please enter number of threads? [Enter for %d (current)] " % numThreads choice = readInput(message, default=str(numThreads)) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index a5d68ed6c..d1177703e 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -423,7 +423,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None abortedFlag = True finally: - value = map(lambda _: partialValue[_] if _ < len(partialValue) else threadData.shared.value[_], xrange(length)) + value = (partialValue[_] if _ < len(partialValue) else threadData.shared.value[_] for _ in xrange(length)) infoMsg = None diff --git a/lib/techniques/brute/use.py b/lib/techniques/brute/use.py index 6c450e78d..61fa10688 100644 --- a/lib/techniques/brute/use.py +++ b/lib/techniques/brute/use.py @@ -127,7 +127,7 @@ def tableExists(tableFile, regex=None): else: kb.data.cachedTables[conf.db].append(item) - for _ in map(lambda x: (conf.db, x), threadData.shared.value): + for _ in ((conf.db, item) for item in threadData.shared.value): if _ not in kb.brute.tables: kb.brute.tables.append(_) diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index 5f6085d41..9331f26c3 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -221,7 +221,7 @@ class Enumeration(GenericEnumeration): if colList: table = {} - table[safeSQLIdentificatorNaming(tbl)] = dict(map(lambda x: (x, None), colList)) + table[safeSQLIdentificatorNaming(tbl)] = dict((_, None) for _ in colList) kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)] = table continue diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index ead255d3f..cfa7ff5c2 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -275,7 +275,7 @@ class Databases: values = filter(None, arrayizeValue(values)) if len(values) > 0 and not isListLike(values[0]): - values = map(lambda x: (dbs[0], x), values) + values = ((dbs[0], _) for _ in values) for db, table in filterPairValues(values): db = safeSQLIdentificatorNaming(db)