當前位置: 首頁>>代碼示例>>Python>>正文


Python conf.threads方法代碼示例

本文整理匯總了Python中lib.core.data.conf.threads方法的典型用法代碼示例。如果您正苦於以下問題:Python conf.threads方法的具體用法?Python conf.threads怎麽用?Python conf.threads使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在lib.core.data.conf的用法示例。


在下文中一共展示了conf.threads方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: start

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def start():
    if kb.targets and kb.targets.qsize() > 1:
        infoMsg = "ZEROScan got a total of %d targets" % kb.targets.qsize()
        log.process(infoMsg)

    runThreads(conf.threads, expThreads)

    if not kb.results:
        return

    toNum = 0
    tmp = []
    for _ in kb.results:
        if _:
            toNum += 1
            tmp.append(list(_))

    print tabulate(tmp,["target-url", "poc-name", "status"],tablefmt="grid")
    print "success : {}".format(toNum)

    _createTargetDirs()
    _setRecordFiles()

    if conf.report:
        _setReport() 
開發者ID:zer0yu,項目名稱:ZEROScan,代碼行數:27,代碼來源:controller.py

示例2: __init__

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def __init__(self):
        Cmd.__init__(self)
        os.system("clear")
        banner()

        conf.url = None
        conf.urlFile = None

        conf.cookie = None
        #隨機ua的實現
        #conf.randomAgent = False

        conf.threads = 1

        #是否需要html報告
        conf.report = None

        conf.timeout = 3
        conf.httpHeaders = HTTP_DEFAULT_HEADER

        self.prompt = "ZEROScan > " 
開發者ID:zer0yu,項目名稱:ZEROScan,代碼行數:23,代碼來源:consoles.py

示例3: __goInference

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def __goInference(payload, expression):
    start = time.time()

    if ( conf.eta or conf.threads > 1 ) and kb.dbms:
        _, length, _ = queryOutputLength(expression, payload)
    else:
        length = None

    dataToSessionFile("[%s][%s][%s][%s][" % (conf.url, kb.injPlace, conf.parameters[kb.injPlace], expression))

    count, value = bisection(payload, expression, length=length)
    duration = int(time.time() - start)

    if conf.eta and length:
        infoMsg = "retrieved: %s" % value
        logger.info(infoMsg)

    infoMsg = "performed %d queries in %d seconds" % (count, duration)
    logger.info(infoMsg)

    return value 
開發者ID:tuwid,項目名稱:darkc0de-old-stuff,代碼行數:23,代碼來源:inject.py

示例4: _goInference

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _goInference(payload, expression, charsetType=None, firstChar=None, lastChar=None, dump=False, field=None):
    start = time.time()
    value = None
    count = 0

    value = _goDns(payload, expression)

    if value is not None:
        return value

    timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))

    if not (timeBasedCompare and kb.dnsTest):
        if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not re.search("(COUNT|LTRIM)\(", expression, re.I) and not (timeBasedCompare and not conf.forceThreads):

            if field and re.search("\ASELECT\s+DISTINCT\((.+?)\)\s+FROM", expression, re.I):
                expression = "SELECT %s FROM (%s)" % (field, expression)

                if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL):
                    expression += " AS %s" % randomStr(lowercase=True, seed=hash(expression))

            if field and conf.hexConvert or conf.binaryFields and field in conf.binaryFields.split(','):
                nulledCastedField = agent.nullAndCastField(field)
                injExpression = expression.replace(field, nulledCastedField, 1)
            else:
                injExpression = expression
            length = queryOutputLength(injExpression, payload)
        else:
            length = None

        kb.inferenceMode = True
        count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump)
        kb.inferenceMode = False

        if not kb.bruteMode:
            debugMsg = "performed %d queries in %.2f seconds" % (count, calculateDeltaSeconds(start))
            logger.debug(debugMsg)

    return value 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:41,代碼來源:inject.py

示例5: _setThreads

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _setThreads():
    if not isinstance(conf.threads, int) or conf.threads <= 0:
        conf.threads = 1 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:5,代碼來源:option.py

示例6: _resolveCrossReferences

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _resolveCrossReferences():
    lib.core.threads.readInput = readInput
    lib.core.common.getPageTemplate = getPageTemplate
    lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
    lib.request.connect.setHTTPProxy = _setHTTPProxy
    lib.utils.google.setHTTPProxy = _setHTTPProxy
    lib.controller.checks.setVerbosity = setVerbosity 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:9,代碼來源:option.py

示例7: setOptimize

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def setOptimize():
    """
    Sets options turned on by switch '-o'
    """

    #conf.predictOutput = True
    conf.keepAlive = True
    conf.threads = 3 if conf.threads < 3 else conf.threads
    conf.nullConnection = not any((conf.data, conf.textOnly, conf.titles, conf.string, conf.notString, conf.regexp, conf.tor))

    if not conf.nullConnection:
        debugMsg = "turning off --null-connection switch used indirectly by switch -o"
        logger.debug(debugMsg) 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:15,代碼來源:common.py

示例8: setDaemon

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def setDaemon(thread):
    # Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation
    if PYVERSION >= "2.6":
        thread.daemon = True
    else:
        thread.setDaemon(True) 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:8,代碼來源:threads.py

示例9: SetOption

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def SetOption(option, value):
    """
    @function set the plugin options
    :param option: string, 設置項名稱
    :param value: string, 設置值
    :return:
    """
    #TODO
    #目標如果在txt文件中,必須將文件放在targets目錄下
    if option.upper() == "URL":
        path_files = os.listdir(paths.ZEROSCAN_TARGET_PATH)
        for tmp_path_file in path_files:
            if str(value) in tmp_path_file:
                tmp_str = str(value)
                if tmp_str[-4:] == '.txt':
                    conf.urlFile = str(value)
                    return "%s => %s" % (option, value)
                else:
                    conf.urlFile = str(value)+'.txt'
                    return "%s => %s" % (option, value)
            else:
                #這個是要check的
                conf.url = str(value)
                return "%s => %s" % (option, value)
    elif option.upper() == "THREAD":
        conf.threads = value
        return "%s => %s" % (option, value)
    elif option.upper() == "COOKIE":
        conf.cookie = str(value)
        return "%s => %s" % (option, value)
    elif option.upper() == "REPORT":
        conf.report = value
        return "%s => %s" % (option, value)
    else:
        return "Invalid option: %s" % option 
開發者ID:zer0yu,項目名稱:ZEROScan,代碼行數:37,代碼來源:manager.py

示例10: ClearConf

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def ClearConf():
    """
    @function clear var
    :return:
    """
    conf.urlFile = ""
    conf.url = ""
    conf.threads = 1
    conf.cookie = ""
    conf.report = False 
開發者ID:zer0yu,項目名稱:ZEROScan,代碼行數:12,代碼來源:manager.py

示例11: __setThreads

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def __setThreads():
    if not isinstance(conf.threads, int) or conf.threads <= 0:
        conf.threads = 1 
開發者ID:tuwid,項目名稱:darkc0de-old-stuff,代碼行數:5,代碼來源:option.py

示例12: _resolveCrossReferences

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _resolveCrossReferences():
    lib.core.threads.readInput = readInput
    lib.core.common.getPageTemplate = getPageTemplate
    lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
    lib.request.connect.setHTTPHandlers = _setHTTPHandlers
    lib.utils.search.setHTTPHandlers = _setHTTPHandlers
    lib.controller.checks.setVerbosity = setVerbosity 
開發者ID:ym2011,項目名稱:POC-EXP,代碼行數:9,代碼來源:option.py

示例13: _resolveCrossReferences

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _resolveCrossReferences():
    lib.core.threads.readInput = readInput
    lib.core.common.getPageTemplate = getPageTemplate
    lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
    lib.request.connect.setHTTPHandlers = _setHTTPHandlers
    lib.utils.search.setHTTPHandlers = _setHTTPHandlers
    lib.controller.checks.setVerbosity = setVerbosity
    lib.controller.checks.setWafFunctions = _setWafFunctions 
開發者ID:sabri-zaki,項目名稱:EasY_HaCk,代碼行數:10,代碼來源:option.py

示例14: setOptimize

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def setOptimize():
    """
    Sets options turned on by switch '-o'
    """

    # conf.predictOutput = True
    conf.keepAlive = True
    conf.threads = 3 if conf.threads < 3 else conf.threads
    conf.nullConnection = not any((conf.data, conf.textOnly, conf.titles, conf.string, conf.notString, conf.regexp, conf.tor))

    if not conf.nullConnection:
        debugMsg = "turning off switch '--null-connection' used indirectly by switch '-o'"
        logger.debug(debugMsg) 
開發者ID:sabri-zaki,項目名稱:EasY_HaCk,代碼行數:15,代碼來源:common.py

示例15: _retryProxy

# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import threads [as 別名]
def _retryProxy(**kwargs):
        threadData = getCurrentThreadData()
        threadData.retriesCount += 1

        if conf.proxyList and threadData.retriesCount >= conf.retries:
            warnMsg = "changing proxy"
            logger.warn(warnMsg)

            conf.proxy = None
            setHTTPProxy()

        if kb.testMode and kb.previousMethod == PAYLOAD.METHOD.TIME:
            # timed based payloads can cause web server unresponsiveness
            # if the injectable piece of code is some kind of JOIN-like query
            warnMsg = "most probably web server instance hasn't recovered yet "
            warnMsg += "from previous timed based payload. If the problem "
            warnMsg += "persists please wait for few minutes and rerun "
            warnMsg += "without flag T in option '--technique' "
            warnMsg += "(e.g. '--flush-session --technique=BEUS') or try to "
            warnMsg += "lower the value of option '--time-sec' (e.g. '--time-sec=2')"
            singleTimeWarnMessage(warnMsg)

        elif kb.originalPage is None:
            if conf.tor:
                warnMsg = "please make sure that you have "
                warnMsg += "Tor installed and running so "
                warnMsg += "you could successfully use "
                warnMsg += "switch '--tor' "
                if IS_WIN:
                    warnMsg += "(e.g. 'https://www.torproject.org/download/download.html.en')"
                else:
                    warnMsg += "(e.g. 'https://help.ubuntu.com/community/Tor')"
            else:
                warnMsg = "if the problem persists please check that the provided "
                warnMsg += "target URL is valid. In case that it is, you can try to rerun "
                warnMsg += "with the switch '--random-agent' turned on "
                warnMsg += "and/or proxy switches ('--ignore-proxy', '--proxy',...)"
            singleTimeWarnMessage(warnMsg)

        elif conf.threads > 1:
            warnMsg = "if the problem persists please try to lower "
            warnMsg += "the number of used threads (option '--threads')"
            singleTimeWarnMessage(warnMsg)

        kwargs['retrying'] = True
        return Connect._getPageProxy(**kwargs) 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:48,代碼來源:connect.py


注:本文中的lib.core.data.conf.threads方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。