-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mitre_Analizer.py
32 lines (20 loc) · 964 Bytes
/
Mitre_Analizer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import json
with open('EquivocalTecnics.txt', 'r') as file:
content = file.readlines()
Equivocal_tecnics = set()
for line in content:
clean_line = line.strip()
Equivocal_tecnics.add(clean_line)
Folder_Equivocal_Tecnics = "Equivocal_Tecnics"
Folder_Mitre_Signatures = "Mitre_Signatures"
file_mitre_list = [file for file in os.listdir(Folder_Mitre_Signatures) if file.startswith("Mitre") and file.endswith(".txt")]
for file_name in file_mitre_list:
input_file_path = os.path.join(Folder_Mitre_Signatures, file_name)
output_file_path = os.path.join(Folder_Equivocal_Tecnics, f"EQUIVOCAL_Tecnics_{file_name.replace('Mitre_', '')}")
with open(output_file_path, 'w') as output_file:
with open(input_file_path, 'r') as file:
for line in file:
attck_id = line.split(":")[1].strip().split(".")[0]
if attck_id in Equivocal_tecnics:
output_file.write(line)