fix: [360net] fixes null entries in lists

This commit is contained in:
Christophe Vandeplas 2022-09-13 22:12:51 +02:00
parent c5a5fa7cfa
commit b011ddee5b
2 changed files with 24 additions and 35 deletions

View file

@ -14,8 +14,8 @@
"meta": { "meta": {
"country": "america", "country": "america",
"refs": [ "refs": [
"https://apt.360.net/report/apts/96.html", "https://apt.360.net/report/apts/12.html",
"https://apt.360.net/report/apts/12.html" "https://apt.360.net/report/apts/96.html"
], ],
"suspected-victims": [ "suspected-victims": [
"中国" "中国"
@ -38,9 +38,9 @@
"meta": { "meta": {
"country": "vietnam", "country": "vietnam",
"refs": [ "refs": [
"https://apt.360.net/report/apts/94.html",
"https://apt.360.net/report/apts/1.html", "https://apt.360.net/report/apts/1.html",
"https://apt.360.net/report/apts/93.html", "https://apt.360.net/report/apts/93.html"
"https://apt.360.net/report/apts/94.html"
], ],
"suspected-victims": [ "suspected-victims": [
"中国", "中国",
@ -88,9 +88,9 @@
"meta": { "meta": {
"country": "mideast", "country": "mideast",
"refs": [ "refs": [
"https://apt.360.net/report/apts/26.html",
"https://apt.360.net/report/apts/100.html", "https://apt.360.net/report/apts/100.html",
"https://apt.360.net/report/apts/98.html", "https://apt.360.net/report/apts/98.html"
"https://apt.360.net/report/apts/26.html"
], ],
"suspected-victims": [ "suspected-victims": [
"叙利亚" "叙利亚"
@ -110,8 +110,8 @@
"country": "korea", "country": "korea",
"refs": [ "refs": [
"https://apt.360.net/report/apts/9.html", "https://apt.360.net/report/apts/9.html",
"https://apt.360.net/report/apts/101.html", "https://apt.360.net/report/apts/90.html",
"https://apt.360.net/report/apts/90.html" "https://apt.360.net/report/apts/101.html"
], ],
"suspected-victims": [ "suspected-victims": [
"中国", "中国",
@ -139,9 +139,7 @@
"refs": [ "refs": [
"https://apt.360.net/report/apts/11.html" "https://apt.360.net/report/apts/11.html"
], ],
"suspected-victims": [], "synonyms": []
"synonyms": [],
"target-category": []
}, },
"uuid": "03e70e52-ec27-5961-bb53-d4c8c737addc", "uuid": "03e70e52-ec27-5961-bb53-d4c8c737addc",
"value": "黄金雕 - APT-C-34" "value": "黄金雕 - APT-C-34"
@ -153,9 +151,7 @@
"refs": [ "refs": [
"https://apt.360.net/report/apts/83.html" "https://apt.360.net/report/apts/83.html"
], ],
"suspected-victims": [], "synonyms": []
"synonyms": [],
"target-category": []
}, },
"uuid": "c111ae65-f889-56b0-b266-f54342977da5", "uuid": "c111ae65-f889-56b0-b266-f54342977da5",
"value": "盲眼鹰 - APT-C-36" "value": "盲眼鹰 - APT-C-36"
@ -310,7 +306,6 @@
"target-category": [ "target-category": [
"政府", "政府",
"航空航天、教育", "航空航天、教育",
null,
"军事" "军事"
] ]
}, },
@ -408,8 +403,8 @@
"meta": { "meta": {
"country": "russia", "country": "russia",
"refs": [ "refs": [
"https://apt.360.net/report/apts/87.html", "https://apt.360.net/report/apts/69.html",
"https://apt.360.net/report/apts/69.html" "https://apt.360.net/report/apts/87.html"
], ],
"suspected-victims": [ "suspected-victims": [
"欧美国家", "欧美国家",
@ -783,9 +778,7 @@
"meta": { "meta": {
"country": "Israel", "country": "Israel",
"refs": [], "refs": [],
"suspected-victims": [], "synonyms": []
"synonyms": [],
"target-category": []
}, },
"uuid": "bf77827a-e0f1-504f-815c-4bccfe72b644", "uuid": "bf77827a-e0f1-504f-815c-4bccfe72b644",
"value": "SandCat - APT-C-32" "value": "SandCat - APT-C-32"
@ -838,11 +831,9 @@
"refs": [ "refs": [
"https://apt.360.net/report/apts/159.html" "https://apt.360.net/report/apts/159.html"
], ],
"suspected-victims": null,
"synonyms": [ "synonyms": [
"Machete" "Machete"
], ]
"target-category": null
}, },
"uuid": "d0b9840d-efe2-5200-89d1-2f1a37737e30", "uuid": "d0b9840d-efe2-5200-89d1-2f1a37737e30",
"value": "Machete - APT-C-43" "value": "Machete - APT-C-43"
@ -852,9 +843,7 @@
"meta": { "meta": {
"country": "russia", "country": "russia",
"refs": [], "refs": [],
"suspected-victims": [], "synonyms": []
"synonyms": [],
"target-category": []
}, },
"uuid": "ca52d879-f02b-531e-89ff-817ffc23ce35", "uuid": "ca52d879-f02b-531e-89ff-817ffc23ce35",
"value": "Gamaredon - APT-C-53" "value": "Gamaredon - APT-C-53"
@ -866,9 +855,7 @@
"refs": [ "refs": [
"https://apt.360.net/report/apts/157.html" "https://apt.360.net/report/apts/157.html"
], ],
"suspected-victims": null, "synonyms": []
"synonyms": [],
"target-category": null
}, },
"uuid": "367bfb72-da65-5886-a333-389299470722", "uuid": "367bfb72-da65-5886-a333-389299470722",
"value": "北非狐 - APT-C-44" "value": "北非狐 - APT-C-44"
@ -880,7 +867,6 @@
"refs": [ "refs": [
"https://apt.360.net/report/apts/136.html" "https://apt.360.net/report/apts/136.html"
], ],
"suspected-victims": null,
"synonyms": [], "synonyms": [],
"target-category": [ "target-category": [
"IT通信行业" "IT通信行业"

View file

@ -41,7 +41,7 @@ for actor in list_data['data']['list']:
for ref in actor['recommends']: for ref in actor['recommends']:
refs.append(ref['url']) refs.append(ref['url'])
refs = list(set(refs)) refs = list(set(refs))
clusters.append({ cluster = {
'value': f"{actor['name']} - {actor['code']}", 'value': f"{actor['name']} - {actor['code']}",
'description': actor['description'], 'description': actor['description'],
'uuid': str(uuid.uuid5(uuid.UUID("9319371e-2504-4128-8410-3741cebbcfd3"), actor['code'])), 'uuid': str(uuid.uuid5(uuid.UUID("9319371e-2504-4128-8410-3741cebbcfd3"), actor['code'])),
@ -49,11 +49,14 @@ for actor in list_data['data']['list']:
'synonyms': actor['alias'], 'synonyms': actor['alias'],
'country': country_code, 'country': country_code,
'refs': refs, 'refs': refs,
'target-category': actor['attack_industry'],
'suspected-victims': actor['attack_region'],
# LATER find a way to convert attack-method to MITRE ATT&CK
} }
}) }
if actor['attack_industry']:
cluster['meta']['target-category'] = [i for i in actor['attack_industry'] if i]
if actor['attack_region']:
cluster['meta']['suspected-victims'] = [i for i in actor['attack_region'] if i]
# LATER find a way to convert attack-method to MITRE ATT&CK
clusters.append(cluster)
json_galaxy = { json_galaxy = {
'icon': "user-secret", 'icon': "user-secret",