Browse Source

chg: [onyphe] fix #252

pipenv
Alexandre Dulaunoy 3 years ago
parent
commit
5d1583d88b
No known key found for this signature in database GPG Key ID: 9E2CD4944E6CBCD
  1. 8
      misp_modules/modules/expansion/onyphe.py
  2. 4
      misp_modules/modules/expansion/onyphe_full.py
  3. 2
      tests/bodyhashdd.json

8
misp_modules/modules/expansion/onyphe.py

@ -65,16 +65,16 @@ def handle_expansion(api, ip, misperrors):
for r in result['results']:
if r['@category'] == 'pastries':
if r['@type'] == 'pastebin':
if r['source'] == 'pastebin':
urls_pasties.append('https://pastebin.com/raw/%s' % r['key'])
elif r['@category'] == 'synscan':
asn_list.append(r['asn'])
os_target = r['os']
if os_target != 'Unknown':
os_list.append(r['os'])
elif r['@category'] == 'resolver' and r['@type'] =='reverse':
elif r['@category'] == 'resolver' and r['type'] =='reverse':
domains_resolver.append(r['reverse'])
elif r['@category'] == 'resolver' and r['@type'] =='forward':
elif r['@category'] == 'resolver' and r['type'] =='forward':
domains_forward.append(r['forward'])
result_filtered['results'].append({'types': ['url'], 'values': urls_pasties,
@ -105,4 +105,4 @@ def introspection():
def version():
moduleinfo['config'] = moduleconfig
return moduleinfo
return moduleinfo

4
misp_modules/modules/expansion/onyphe_full.py

@ -315,7 +315,7 @@ def expand_pastries(api, misperror, **kwargs):
status_ok = True
for item in result['results']:
if item['@category'] == 'pastries':
if item['@type'] == 'pastebin':
if item['source'] == 'pastebin':
urls_pasties.append('https://pastebin.com/raw/%s' % item['key'])
if 'domain' in item:
@ -374,4 +374,4 @@ def introspection():
def version():
moduleinfo['config'] = moduleconfig
return moduleinfo
return moduleinfo

2
tests/bodyhashdd.json

@ -1 +1 @@
{"module": "hashdd", "md5": "838DE99E82C5B9753BAC96D82C1A8DCB"}
{"module": "hashdd", "md5": "838DE99E82C5B9753BAC96D82C1A8DCC"}

Loading…
Cancel
Save