当前位置: 首页>>代码示例>>Python>>正文


Python CONFIG.get方法代码示例

本文整理汇总了Python中cowrie.core.config.CONFIG.get方法的典型用法代码示例。如果您正苦于以下问题:Python CONFIG.get方法的具体用法?Python CONFIG.get怎么用?Python CONFIG.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cowrie.core.config.CONFIG的用法示例。


在下文中一共展示了CONFIG.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     self.host = CONFIG.get(self.RETHINK_DB_SEGMENT, 'host')
     self.port = CONFIG.getint(self.RETHINK_DB_SEGMENT, 'port')
     self.db = CONFIG.get(self.RETHINK_DB_SEGMENT, 'db')
     self.table = CONFIG.get(self.RETHINK_DB_SEGMENT, 'table')
     self.password = CONFIG.get(self.RETHINK_DB_SEGMENT, 'password', raw=True)
     cowrie.core.output.Output.__init__(self)
开发者ID:Mato-Z,项目名称:cowrie,代码行数:9,代码来源:rethinkdblog.py

示例2: connectionMade

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def connectionMade(self):
        pt = self.getProtoTransport()

        self.realClientIP = pt.transport.getPeer().host
        self.realClientPort = pt.transport.getPeer().port
        self.logintime = time.time()

        log.msg(eventid='cowrie.session.params', arch=self.user.server.arch)

        try:
            timeout = CONFIG.getint('honeypot', 'interactive_timeout')
        except Exception:
            timeout = 180
        self.setTimeout(timeout)

        # Source IP of client in user visible reports (can be fake or real)
        try:
            self.clientIP = CONFIG.get('honeypot', 'fake_addr')
        except Exception:
            self.clientIP = self.realClientIP

        # Source IP of server in user visible reports (can be fake or real)
        if CONFIG.has_option('honeypot', 'internet_facing_ip'):
            self.kippoIP = CONFIG.get('honeypot', 'internet_facing_ip')
        else:
            try:
                s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
                s.connect(("8.8.8.8", 80))
                self.kippoIP = s.getsockname()[0]
            except Exception:
                self.kippoIP = '192.168.0.1'
            finally:
                s.close()
开发者ID:micheloosterhof,项目名称:cowrie,代码行数:35,代码来源:protocol.py

示例3: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     """
     """
     facilityString = CONFIG.get('output_localsyslog', 'facility')
     self.format = CONFIG.get('output_localsyslog', 'format')
     self.facility = vars(syslog)['LOG_' + facilityString]
     self.syslog = twisted.python.syslog.SyslogObserver(prefix='cowrie', facility=self.facility)
     cowrie.core.output.Output.__init__(self)
开发者ID:davegermiquet,项目名称:cowrie,代码行数:10,代码来源:localsyslog.py

示例4: start

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def start(self):

        server = CONFIG.get('output_hpfeeds', 'server')
        port = CONFIG.getint('output_hpfeeds', 'port')
        ident = CONFIG.get('output_hpfeeds', 'identifier')
        secret = CONFIG.get('output_hpfeeds', 'secret')
        debug = CONFIG.getboolean('output_hpfeeds', 'debug')
        self.client = hpclient(server, port, ident, secret, debug)
        self.meta = {}
开发者ID:Mato-Z,项目名称:cowrie,代码行数:11,代码来源:hpfeeds.py

示例5: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     self.apiKey = CONFIG.get('output_virustotal', 'api_key')
     self.debug = CONFIG.getboolean('output_virustotal', 'debug', fallback=False)
     self.upload = CONFIG.getboolean('output_virustotal', 'upload', fallback=True)
     self.comment = CONFIG.getboolean('output_virustotal', 'comment', fallback=True)
     self.scan_file = CONFIG.getboolean('output_virustotal', 'scan_file', fallback=True)
     self.scan_url = CONFIG.getboolean('output_virustotal', 'scan_url', fallback=False)
     self.commenttext = CONFIG.get('output_virustotal', 'commenttext', fallback=COMMENT)
     cowrie.core.output.Output.__init__(self)
开发者ID:Mato-Z,项目名称:cowrie,代码行数:11,代码来源:virustotal.py

示例6: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     """
     """
     self.host = CONFIG.get('output_elasticsearch', 'host')
     self.port = CONFIG.get('output_elasticsearch', 'port')
     self.index = CONFIG.get('output_elasticsearch', 'index')
     self.type = CONFIG.get('output_elasticsearch', 'type')
     self.pipeline = CONFIG.get('output_elasticsearch', 'pipeline')
     cowrie.core.output.Output.__init__(self)
开发者ID:davegermiquet,项目名称:cowrie,代码行数:11,代码来源:elasticsearch.py

示例7: start

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def start(self):
     server = CONFIG.get('output_xmpp', 'server')
     user = CONFIG.get('output_xmpp', 'user')
     password = CONFIG.get('output_xmpp', 'password')
     muc = CONFIG.get('output_xmpp', 'muc')
     resource = ''.join([choice(string.ascii_letters)
                         for i in range(8)])
     jid = user + '/' + resource
     application = service.Application('honeypot')
     self.run(application, jid, password, JID(None, [muc, server, None]), server)
开发者ID:Mato-Z,项目名称:cowrie,代码行数:12,代码来源:xmpp.py

示例8: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def __init__(self, *args, **kw):
        """
        Initialize logging
        """
        self.ttylogPath = CONFIG.get('honeypot', 'log_path')
        self.downloadPath = CONFIG.get('honeypot', 'download_path')
        self.ttylogEnabled = CONFIG.getboolean('honeypot', 'ttylog', fallback=True)
        self.bytesReceivedLimit = CONFIG.getint('honeypot', 'download_limit_size', fallback=0)

        channel.SSHChannel.__init__(self, *args, **kw)
开发者ID:Mato-Z,项目名称:cowrie,代码行数:12,代码来源:channel.py

示例9: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def __init__(self):
        self.auth_key = CONFIG.get('output_dshield', 'auth_key')
        self.userid = CONFIG.get('output_dshield', 'userid')
        self.batch_size = CONFIG.getint('output_dshield', 'batch_size')
        try:
            self.debug = CONFIG.getboolean('output_dshield', 'debug')
        except:
            self.debug = False

        cowrie.core.output.Output.__init__(self)
开发者ID:davegermiquet,项目名称:cowrie,代码行数:12,代码来源:dshield.py

示例10: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def __init__(self, realm):
        self.hostname = CONFIG.get('honeypot', 'hostname')

        try:
            arches = [arch.strip() for arch in CONFIG.get('shell', 'arch').split(',')]
            self.arch = random.choice(arches)
        except NoOptionError:
            self.arch = 'linux-x64-lsb'

        log.msg("Initialized emulated server as architecture: {}".format(self.arch))
开发者ID:Mato-Z,项目名称:cowrie,代码行数:12,代码来源:server.py

示例11: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def __init__(self, realm):
        self.hostname = CONFIG.get('honeypot', 'hostname')

        try:
            self.arch = random.choice(CONFIG.get('shell', 'arch').split(','))
            # TODO trim whitespace
        except NoOptionError:
            self.arch = 'linux-x64-lsb'

        log.msg("Initialized emulated server as architecture: {}".format(self.arch))
开发者ID:davegermiquet,项目名称:cowrie,代码行数:12,代码来源:server.py

示例12: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     """
     Initializing the class
     """
     self.index = CONFIG.get('output_splunklegacy', 'index')
     self.username = CONFIG.get('output_splunklegacy', 'username')
     self.password = CONFIG.get('output_splunklegacy', 'password', raw=True)
     self.host = CONFIG.get('output_splunklegacy', 'host')
     self.port = CONFIG.getint('output_splunklegacy', 'port')
     cowrie.core.output.Output.__init__(self)
开发者ID:davegermiquet,项目名称:cowrie,代码行数:12,代码来源:splunklegacy.py

示例13: __init__

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
 def __init__(self):
     self.user = CONFIG.get('output_csirtg', 'username') or USERNAME
     self.feed = CONFIG.get('output_csirtg', 'feed') or FEED
     self.token = CONFIG.get('output_csirtg', 'token') or TOKEN
     try:
         self.description = CONFIG.get('output_csirtg', 'description')
     except Exception:
         self.description = DESCRIPTION
     self.context = {}
     self.client = Client(token=self.token)
     cowrie.core.output.Output.__init__(self)
开发者ID:davegermiquet,项目名称:cowrie,代码行数:13,代码来源:csirtg.py

示例14: checkUserPass

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
    def checkUserPass(self, theusername, thepassword, ip):
        # UserDB is the default auth_class
        authname = auth.UserDB

        # Is the auth_class defined in the config file?
        if CONFIG.has_option('honeypot', 'auth_class'):
            authclass = CONFIG.get('honeypot', 'auth_class')
            authmodule = "cowrie.core.auth"

            # Check if authclass exists in this module
            if hasattr(modules[authmodule], authclass):
                authname = getattr(modules[authmodule], authclass)
            else:
                log.msg('auth_class: %s not found in %s' % (authclass, authmodule))

        theauth = authname()

        if theauth.checklogin(theusername, thepassword, ip):
            log.msg(eventid='cowrie.login.success',
                    format='login attempt [%(username)s/%(password)s] succeeded',
                    username=theusername,
                    password=thepassword)
            return True
        else:
            log.msg(eventid='cowrie.login.failed',
                    format='login attempt [%(username)s/%(password)s] failed',
                    username=theusername,
                    password=thepassword)
            return False
开发者ID:Mato-Z,项目名称:cowrie,代码行数:31,代码来源:checkers.py

示例15: hardware_platform

# 需要导入模块: from cowrie.core.config import CONFIG [as 别名]
# 或者: from cowrie.core.config.CONFIG import get [as 别名]
def hardware_platform():
    """
    """
    try:
        return CONFIG.get('shell', 'hardware_platform')
    except NoOptionError:
        return 'x86_64'
开发者ID:davegermiquet,项目名称:cowrie,代码行数:9,代码来源:uname.py


注:本文中的cowrie.core.config.CONFIG.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。