def register(mhandlers, loaded_modules): mhandlers.pop('domaintools', None) mhandlers.pop('type:domaintools', None) if 'domaintools' in loaded_modules: loaded_modules.remove('domaintools') mhandlers['DomainTools-Analyze'] = dt_misp_module_analyze() mhandlers['type:DomainTools-Analyze'] = 'expansion' loaded_modules.append('DomainTools-Analyze') mhandlers['DomainTools-Iris-Analyze'] = dt_misp_module_iris_analyze() mhandlers['type:DomainTools-Iris-Analyze'] = 'expansion' loaded_modules.append('DomainTools-Iris-Analyze') mhandlers['DomainTools-Pivot'] = dt_misp_module_pivot() mhandlers['type:DomainTools-Pivot'] = 'expansion' loaded_modules.append('DomainTools-Pivot') mhandlers['DomainTools-Iris-Pivot'] = dt_misp_module_iris_pivot() mhandlers['type:DomainTools-Iris-Pivot'] = 'expansion' loaded_modules.append('DomainTools-Iris-Pivot') mhandlers['DomainTools-Historic'] = dt_misp_module_historic() mhandlers['type:DomainTools-Historic'] = 'expansion' loaded_modules.append('DomainTools-Historic') mhandlers['DomainTools-Iris-Import'] = dt_misp_module_iris_import() mhandlers['type:DomainTools-Iris-Import'] = 'import' loaded_modules.append('DomainTools-Iris-Import')
def test_pivot_colocated_count(): q = json.loads('{"module":"DomainTools-Pivot","domain":"axwjgj.com","event_id":"734"}') with open('.config') as config: q['config'] = json.load(config) dtmm = dt_misp_module_pivot() response = dtmm.process_request(json.dumps(q)) the_test = False assert 'results' in response assert len(response['results']) > 0 for record in response['results']: if 'co-located domain count' in record['values']: the_test = True assert the_test is True
def test_analyze_whois_registrant_name(): q = json.loads('{"module":"DomainTools-Analyze","domain":"axwjgj.com","event_id":"734"}') with open('.config') as config: q['config'] = json.load(config) dtmm = dt_misp_module_pivot() response = dtmm.process_request(json.dumps(q)) the_test = False assert 'results' in response assert len(response['results']) > 0 for record in response['results']: if 'whois-registrant-name' in record['values']: the_test = True assert the_test is True
def introspection(): dtmm = dt_misp_module_pivot() return dtmm.misp_attributes
def handler(q=False): if not q: return q dtmm = dt_misp_module_pivot() return dtmm.process_request(q)
def version(): dtmm = dt_misp_module_pivot() dtmm.module_info['config'] = dtmm.module_config return dtmm.module_info