-
Notifications
You must be signed in to change notification settings - Fork 1
/
mitre.json
68 lines (68 loc) · 2.43 KB
/
mitre.json
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
---
{%- comment -%}capture the entries that have MITRE ids assigned {%- endcomment -%}
{%- assign techniques = '' | split: '' -%}
{%- for gtfobin in site.gtfobins -%}
{%- capture name -%}{%- include get_gtfobin_name.html path=gtfobin.path -%}{%- endcapture -%}
{%- for function_item in gtfobin.functions -%}
{%- assign function_name = function_item[0] -%}
{%- assign function = function_item[1] -%}
{%- for example in function -%}
{%- if example.mitre -%}
{%- capture item -%}{{ example.mitre }},{{ name }},{{ function_name }},{{ gtfobin.url | absolute_url }}{%- endcapture -%}
{%- assign item = item | split: ',' -%}
{%- assign techniques = techniques | push: item -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- endfor -%}
{
"name": {{ site.title | jsonify }},
"versions": {
"attack": "15",
"navigator": "5.0.1",
"layer": "4.5"
},
"links": [
{
"label": "GTFOBins",
"url": {{ '/' | absolute_url | jsonify }}
}
],
"layout": {
"expandedSubtechniques": "annotated"
},
"domain": "enterprise-attack",
"filters": {
"platforms": [
"Linux",
"macOS"
]
},
"techniques": [
{%- assign techniques = techniques | group_by_exp: "item", "item[0]" -%}
{%- for group in techniques -%}
{%- assign technique = group.name -%}
{%- assign gtfobins = '' | split: '' -%}
{%- for item in group.items -%}
{%- capture fields -%},{{ item[1] }},{{ item[2] }},{{ item[3] }}{%- endcapture -%}
{%- assign gtfobins = gtfobins | push: fields -%}
{%- endfor -%}
{
"techniqueID": {{ technique | jsonify }},
"links": [
{%- assign gtfobins = gtfobins | uniq -%}
{%- for gtfobin in gtfobins -%}
{%- assign fields = gtfobin | split: ',' -%}
{
"label": {{ fields[1] | jsonify }},
"url": {{ fields[3] | append: '#' | append: fields[2] | jsonify }}
}
{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
]
}
{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
]
}