同步操作将从 yeqingchen1/sqlmap 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python"""Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)See the file 'LICENSE' for copying permission"""import refrom extra.safe2bin.safe2bin import safechardecodefrom lib.core.agent import agentfrom lib.core.bigarray import BigArrayfrom lib.core.common import Backendfrom lib.core.common import filterNonefrom lib.core.common import getSafeExStringfrom lib.core.common import isNoneValuefrom lib.core.common import isNumPosStrValuefrom lib.core.common import singleTimeWarnMessagefrom lib.core.common import unArrayizeValuefrom lib.core.common import unsafeSQLIdentificatorNamingfrom lib.core.compat import xrangefrom lib.core.convert import getUnicodefrom lib.core.data import conffrom lib.core.data import kbfrom lib.core.data import loggerfrom lib.core.data import queriesfrom lib.core.dicts import DUMP_REPLACEMENTSfrom lib.core.enums import CHARSET_TYPEfrom lib.core.enums import EXPECTEDfrom lib.core.exception import SqlmapConnectionExceptionfrom lib.core.exception import SqlmapNoneDataExceptionfrom lib.core.settings import MAX_INTfrom lib.core.settings import NULLfrom lib.core.unescaper import unescaperfrom lib.request import injectfrom thirdparty.six import unichr as _unichrdef pivotDumpTable(table, colList, count=None, blind=True, alias=None):lengths = {}entries = {}dumpNode = queries[Backend.getIdentifiedDbms()].dump_table.blindvalidColumnList = FalsevalidPivotValue = Falseif count is None:query = dumpNode.count % tablequery = agent.whereQuery(query)count = inject.getValue(query, union=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS) if blind else inject.getValue(query, blind=False, time=False, expected=EXPECTED.INT)if hasattr(count, "isdigit") and count.isdigit():count = int(count)if count == 0:infoMsg = "table '%s' appears to be empty" % unsafeSQLIdentificatorNaming(table)logger.info(infoMsg)for column in colList:lengths[column] = len(column)entries[column] = []return entries, lengthselif not isNumPosStrValue(count):return Nonefor column in colList:lengths[column] = 0entries[column] = BigArray()colList = filterNone(sorted(colList, key=lambda x: len(x) if x else MAX_INT))if conf.pivotColumn:for _ in colList:if re.search(r"(.+\.)?%s" % re.escape(conf.pivotColumn), _, re.I):infoMsg = "using column '%s' as a pivot " % conf.pivotColumninfoMsg += "for retrieving row data"logger.info(infoMsg)colList.remove(_)colList.insert(0, _)validPivotValue = Truebreakif not validPivotValue:warnMsg = "column '%s' not " % conf.pivotColumnwarnMsg += "found in table '%s'" % tablelogger.warn(warnMsg)if not validPivotValue:for column in colList:infoMsg = "fetching number of distinct "infoMsg += "values for column '%s'" % column.replace(("%s." % alias) if alias else "", "")logger.info(infoMsg)query = dumpNode.count2 % (column, table)query = agent.whereQuery(query)value = inject.getValue(query, blind=blind, union=not blind, error=not blind, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)if isNumPosStrValue(value):validColumnList = Trueif value == count:infoMsg = "using column '%s' as a pivot " % column.replace(("%s." % alias) if alias else "", "")infoMsg += "for retrieving row data"logger.info(infoMsg)validPivotValue = TruecolList.remove(column)colList.insert(0, column)breakif not validColumnList:errMsg = "all column name(s) provided are non-existent"raise SqlmapNoneDataException(errMsg)if not validPivotValue:warnMsg = "no proper pivot column provided (with unique values)."warnMsg += " It won't be possible to retrieve all rows"logger.warn(warnMsg)pivotValue = " "breakRetrieval = Falsedef _(column, pivotValue):if column == colList[0]:query = dumpNode.query.replace("'%s'" if unescaper.escape(pivotValue, False) != pivotValue else "%s", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, column), unescaper.escape(pivotValue, False))else:query = dumpNode.query2.replace("'%s'" if unescaper.escape(pivotValue, False) != pivotValue else "%s", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, colList[0]), unescaper.escape(pivotValue, False))query = agent.whereQuery(query)return unArrayizeValue(inject.getValue(query, blind=blind, time=blind, union=not blind, error=not blind))try:for i in xrange(count):if breakRetrieval:breakfor column in colList:value = _(column, pivotValue)if column == colList[0]:if isNoneValue(value):try:for pivotValue in filterNone((" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], _unichr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, _unichr(ord(pivotValue[0]) + 1))):value = _(column, pivotValue)if not isNoneValue(value):breakexcept ValueError:passif isNoneValue(value) or value == NULL:breakRetrieval = TruebreakpivotValue = safechardecode(value)if conf.limitStart or conf.limitStop:if conf.limitStart and (i + 1) < conf.limitStart:warnMsg = "skipping first %d pivot " % conf.limitStartwarnMsg += "point values"singleTimeWarnMessage(warnMsg)breakelif conf.limitStop and (i + 1) > conf.limitStop:breakRetrieval = Truebreakvalue = "" if isNoneValue(value) else unArrayizeValue(value)lengths[column] = max(lengths[column], len(DUMP_REPLACEMENTS.get(getUnicode(value), getUnicode(value))))entries[column].append(value)except KeyboardInterrupt:kb.dumpKeyboardInterrupt = TruewarnMsg = "user aborted during enumeration. sqlmap "warnMsg += "will display partial output"logger.warn(warnMsg)except SqlmapConnectionException as ex:errMsg = "connection exception detected ('%s'). sqlmap " % getSafeExString(ex)errMsg += "will display partial output"logger.critical(errMsg)return entries, lengths
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。