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


Python OTXv2.OTXv2方法代码示例

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


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

示例1: otx

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def otx(self):
        otx_server = 'https://otx.alienvault.com/'
        otx_conn = OTXv2(self.otx_api_key, server=otx_server)

        domains = []

        try:
            query = otx_conn.get_indicator_details_full(IndicatorTypes.DOMAIN, self.artifact['name'])
            domain_info = query['url_list']['url_list']

            for item in domain_info:
                if item['hostname'] not in domains:
                    domains.append(item['hostname'])

        except Exception as err:
            warning('Caught unknown exception: %s' % str(err))

        self.artifact['data']['dnsbrute']['otx'] = domains 
开发者ID:InQuest,项目名称:omnibus,代码行数:20,代码来源:dnsbrute.py

示例2: connect

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def connect(self, params):
        api_key, otx_server = params.get(Input.API_KEY).get("secretKey", None), params.get(Input.URL)
        try:
            self.client = OTXv2(api_key, server=otx_server)
        except Exception as e:
            raise Exception(f"An error has occurred while connecting: {e}") 
开发者ID:rapid7,项目名称:insightconnect-plugins,代码行数:8,代码来源:connection.py

示例3: __init__

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def __init__(self, *args, **kwargs):
        super(OtxFeed, self).__init__(*args, **kwargs)
        self.otx = OTXv2(yeti_config.get('otx', 'key'))
        self.get_pulses() 
开发者ID:yeti-platform,项目名称:yeti,代码行数:6,代码来源:otx.py

示例4: __init__

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def __init__(self):
        self.otx = OTXv2(API_KEY, server=OTX_SERVER) 
开发者ID:AlienVault-OTX,项目名称:OTX-Python-SDK,代码行数:4,代码来源:PulseManager.py

示例5: setUp

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def setUp(self, api_key=''):
        self.maxDiff = None
        self.api_key = api_key or ALIEN_API_APIKEY
        self.otx = OTXv2(self.api_key, server=ALIEN_DEV_SERVER) 
开发者ID:AlienVault-OTX,项目名称:OTX-Python-SDK,代码行数:6,代码来源:test_client.py

示例6: setUpClass

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def setUpClass(cls):
        cls.otx2 = OTXv2(create_user(cls.user1, "password", cls.user1 + "@aveng.us", group_ids=[51, 64, 2931]), server=ALIEN_DEV_SERVER) 
开发者ID:AlienVault-OTX,项目名称:OTX-Python-SDK,代码行数:4,代码来源:test_client.py

示例7: test_user_agent

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def test_user_agent(self):
        o = OTXv2(self.api_key, server=ALIEN_DEV_SERVER, project='foo')
        self.assertEqual(o.headers['User-Agent'], 'OTX Python foo/1.5.10')

        o = OTXv2(self.api_key, server=ALIEN_DEV_SERVER, user_agent='foo')
        self.assertEqual(o.headers['User-Agent'], 'foo') 
开发者ID:AlienVault-OTX,项目名称:OTX-Python-SDK,代码行数:8,代码来源:test_client.py

示例8: Search

# 需要导入模块: import OTXv2 [as 别名]
# 或者: from OTXv2 import OTXv2 [as 别名]
def Search(self):
        mod.display(self.module_name, "", "INFO", "Search in Alienvault OTX ...")
        try:
            if "otx_api_keys" in self.config:
                otx = OTXv2(self.config["otx_api_keys"])
                if self.type == "IPv4":
                    indicator = IndicatorTypes.IPv4
                if self.type == "IPv6":
                    indicator = IndicatorTypes.IPv6
                if self.type == "domain":
                    indicator = IndicatorTypes.DOMAIN
                if self.type == "URL":
                    indicator = IndicatorTypes.URL
                if self.type == "MD5":
                    indicator = IndicatorTypes.FILE_HASH_MD5
                if self.type == "SHA1":
                    indicator = IndicatorTypes.FILE_HASH_SHA1
                if self.type == "SHA256":
                    indicator = IndicatorTypes.FILE_HASH_SHA256
                result = otx.get_indicator_details_full(indicator, self.ioc)
            else:
                mod.display(self.module_name,
                            self.ioc,
                            message_type="ERROR",
                            string="Please check if you have otx_api_keys field in btg.cfg")
                return None
        except:
            mod.display(self.module_name,
                        self.ioc,
                        "ERROR",
                        "Could not perform the request, either you did not fill the otx_api_keys field or the key maximum request is reached")
            return None
        try:
            if self.ioc == str(result["general"]["indicator"]):
                _id = str(result["general"]["pulse_info"]["pulses"][0]["id"])
                tags = ""
                for tag in result["general"]["pulse_info"]["pulses"][0]["tags"]:
                    tags = tags + "%s " % tag
                mod.display(self.module_name,
                            self.ioc,
                            "FOUND",
                            "Tags: %s| https://otx.alienvault.com/pulse/%s/" % (tags, _id))
        except:
            mod.display(self.module_name,
                        self.ioc,
                        message_type="NOT_FOUND",
                        string="Nothing found in OTX")
        return None 
开发者ID:conix-security,项目名称:BTG,代码行数:50,代码来源:otx.py


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