本文整理匯總了Python中lib.core.data.conf.timeout方法的典型用法代碼示例。如果您正苦於以下問題:Python conf.timeout方法的具體用法?Python conf.timeout怎麽用?Python conf.timeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lib.core.data.conf
的用法示例。
在下文中一共展示了conf.timeout方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _setHTTPTimeout
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def _setHTTPTimeout():
"""
Set the HTTP timeout
"""
if conf.timeout:
debugMsg = "setting the HTTP timeout"
logger.debug(debugMsg)
conf.timeout = float(conf.timeout)
if conf.timeout < 3.0:
warnMsg = "the minimum HTTP timeout is 3 seconds, sqlmap "
warnMsg += "will going to reset it"
logger.warn(warnMsg)
conf.timeout = 3.0
else:
conf.timeout = 30.0
socket.setdefaulttimeout(conf.timeout)
示例2: expThreads
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def expThreads():
"""
@function multiThread executing
"""
zsp = PluginBase(package='zsplugins')
plugin_zsp = zsp.make_plugin_source(searchpath=[paths.ZEROSCAN_PLUGINS_PATH])
zspi = plugin_zsp.load_plugin('%s'%(kb.CurrentPlugin))
while not kb.targets.empty() and kb.threadContinue:
target = kb.targets.get()
infoMsg = "exploit target:'%s'" % (target)
log.process(infoMsg)
# TODO
result = zspi.exploit(target, headers=conf.httpHeaders)
#插件中沒有返回值就默認是失敗
if not result:
continue
output = (target, kb.CurrentPlugin, result)
kb.results.add(output)
if isinstance(conf.timeout, (int, float)) and conf.timeout > 0:
time.sleep(conf.timeout)
示例3: __init__
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [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 > "
示例4: __setHTTPTimeout
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def __setHTTPTimeout():
"""
Set the HTTP timeout
"""
if conf.timeout:
debugMsg = "setting the HTTP timeout"
logger.debug(debugMsg)
conf.timeout = float(conf.timeout)
if conf.timeout < 3.0:
warnMsg = "the minimum HTTP timeout is 3 seconds, sqlmap "
warnMsg += "will going to reset it"
logger.warn(warnMsg)
conf.timeout = 3.0
else:
conf.timeout = 10.0
socket.setdefaulttimeout(conf.timeout)
示例5: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
try:
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
except (pymssql.InterfaceError, pymssql.OperationalError), msg:
raise SqlmapConnectionException(msg)
示例6: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
try:
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
except pymssql.OperationalError, msg:
raise SqlmapConnectionException(msg)
示例7: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
try:
self.connector = pymysql.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
except (pymysql.OperationalError, pymysql.InternalError), msg:
raise SqlmapConnectionException(msg[1])
示例8: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
self.checkFileDb()
try:
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
cursor = self.connector.cursor()
cursor.execute("SELECT * FROM sqlite_master")
cursor.close()
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
warnMsg = "unable to connect using SQLite 3 library, trying with SQLite 2"
logger.warn(warnMsg)
try:
try:
import sqlite
except ImportError:
errMsg = "sqlmap requires 'python-sqlite' third-party library "
errMsg += "in order to directly connect to the database '%s'" % self.db
raise SqlmapMissingDependence(errMsg)
self.__sqlite = sqlite
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
raise SqlmapConnectionException(msg[0])
示例9: getConnection
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def getConnection(self, host, timeout=None):
# Reference: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_cert_chain
return httplib.HTTPSConnection(host, cert_file=self.auth_file, key_file=self.auth_file, timeout=conf.timeout)
示例10: getConnection
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def getConnection(self, host, timeout=None):
try:
# Reference: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_cert_chain
return httplib.HTTPSConnection(host, cert_file=self.auth_file, key_file=self.auth_file, timeout=conf.timeout)
except IOError, ex:
errMsg = "error occurred while using key "
errMsg += "file '%s' ('%s')" % (self.auth_file, getSafeExString(ex))
raise SqlmapConnectionException(errMsg)
示例11: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
try:
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
except (pymssql2.Error, _mssql.MssqlDatabaseException), msg:
raise SqlmapConnectionException(msg)
示例12: connect
# 需要導入模塊: from lib.core.data import conf [as 別名]
# 或者: from lib.core.data.conf import timeout [as 別名]
def connect(self):
self.initConnection()
try:
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
except (pymssql.Error, _mssql.MssqlDatabaseException), msg:
raise SqlmapConnectionException(msg)