diff --git a/lib/core/common.py b/lib/core/common.py index 998b7ed55..b4e344da0 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -960,6 +960,10 @@ def cleanQuery(query): return upperQuery def setPaths(): + """ + Sets absolute paths for project directories and files + """ + # sqlmap paths paths.SQLMAP_EXTRAS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "extra") paths.SQLMAP_PROCS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "procs") @@ -1099,6 +1103,7 @@ def parseTargetUrl(): """ Parse target url and set some attributes into the configuration singleton. """ + if not conf.url: return @@ -1157,9 +1162,12 @@ def parseTargetUrl(): conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url))) def expandAsteriskForColumns(expression): - # If the user provided an asterisk rather than the column(s) - # name, sqlmap will retrieve the columns itself and reprocess - # the SQL query string (expression) + """ + If the user provided an asterisk rather than the column(s) + name, sqlmap will retrieve the columns itself and reprocess + the SQL query string (expression) + """ + asterisk = re.search("^SELECT\s+\*\s+FROM\s+([\w\.\_]+)\s*", expression, re.I) if asterisk: diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index feba16a73..2990702c2 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1138,7 +1138,7 @@ class Enumeration: table[safeSQLIdentificatorNaming(tbl, True)] = columns kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)] = table - if not kb.data.cachedColumns and isInferenceAvailable() and not conf.direct: + if safeSQLIdentificatorNaming(conf.db) not in kb.data.cachedColumns and isInferenceAvailable() and not conf.direct: for tbl in tblList: if conf.db is not None and len(kb.data.cachedColumns) > 0 \ and conf.db in kb.data.cachedColumns and tbl in \