This action will force synchronization from yeqingchen1/sqlmap, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#!/usr/bin/env python"""Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)See the file 'LICENSE' for copying permission"""from __future__ import print_functionimport reimport sysfrom lib.core.common import Backendfrom lib.core.common import dataToStdoutfrom lib.core.common import getSQLSnippetfrom lib.core.common import isStackingAvailablefrom lib.core.convert import getUnicodefrom lib.core.data import conffrom lib.core.data import loggerfrom lib.core.dicts import SQL_STATEMENTSfrom lib.core.enums import AUTOCOMPLETE_TYPEfrom lib.core.exception import SqlmapNoneDataExceptionfrom lib.core.settings import NULLfrom lib.core.settings import PARAMETER_SPLITTING_REGEXfrom lib.core.shell import autoCompletionfrom lib.request import injectfrom thirdparty.six.moves import input as _inputclass Custom(object):"""This class defines custom enumeration functionalities for plugins."""def __init__(self):passdef sqlQuery(self, query):output = NonesqlType = Nonequery = query.rstrip(';')try:for sqlTitle, sqlStatements in SQL_STATEMENTS.items():for sqlStatement in sqlStatements:if query.lower().startswith(sqlStatement):sqlType = sqlTitlebreakif not any(_ in query.upper() for _ in ("OPENROWSET", "INTO")) and (not sqlType or "SELECT" in sqlType):infoMsg = "fetching %s query output: '%s'" % (sqlType if sqlType is not None else "SQL", query)logger.info(infoMsg)output = inject.getValue(query, fromUser=True)return outputelif not isStackingAvailable() and not conf.direct:warnMsg = "execution of non-query SQL statements is only "warnMsg += "available when stacked queries are supported"logger.warn(warnMsg)return Noneelse:if sqlType:debugMsg = "executing %s query: '%s'" % (sqlType if sqlType is not None else "SQL", query)else:debugMsg = "executing unknown SQL type query: '%s'" % querylogger.debug(debugMsg)inject.goStacked(query)debugMsg = "done"logger.debug(debugMsg)output = NULLexcept SqlmapNoneDataException as ex:logger.warn(ex)return outputdef sqlShell(self):infoMsg = "calling %s shell. To quit type " % Backend.getIdentifiedDbms()infoMsg += "'x' or 'q' and press ENTER"logger.info(infoMsg)autoCompletion(AUTOCOMPLETE_TYPE.SQL)while True:query = Nonetry:query = _input("sql-shell> ")query = getUnicode(query, encoding=sys.stdin.encoding)query = query.strip("; ")except KeyboardInterrupt:print()errMsg = "user aborted"logger.error(errMsg)except EOFError:print()errMsg = "exit"logger.error(errMsg)breakif not query:continueif query.lower() in ("x", "q", "exit", "quit"):breakoutput = self.sqlQuery(query)if output and output != "Quit":conf.dumper.sqlQuery(query, output)elif not output:passelif output != "Quit":dataToStdout("No output\n")def sqlFile(self):infoMsg = "executing SQL statements from given file(s)"logger.info(infoMsg)for filename in re.split(PARAMETER_SPLITTING_REGEX, conf.sqlFile):filename = filename.strip()if not filename:continuesnippet = getSQLSnippet(Backend.getDbms(), filename)if snippet and all(query.strip().upper().startswith("SELECT") for query in (_ for _ in snippet.split(';' if ';' in snippet else '\n') if _)):for query in (_ for _ in snippet.split(';' if ';' in snippet else '\n') if _):query = query.strip()if query:conf.dumper.sqlQuery(query, self.sqlQuery(query))else:conf.dumper.sqlQuery(snippet, self.sqlQuery(snippet))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。