本文整理匯總了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()
示例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 > "
示例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
示例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
示例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
示例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
示例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)
示例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)
示例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
示例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
示例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
示例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
示例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
示例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)
示例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)