Skip to content

Commit

Permalink
Add MITRE ATT&CK® Navigator JSON and link
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-and committed Sep 14, 2024
1 parent 89cf696 commit 0360022
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ If you are looking for Windows binaries you should visit [LOLBAS][].
[Contributors][contributors]
|
[JSON API]({{ '/api.json' | relative_url }})
|
[MITRE ATT&CK® Navigator](https://mitre-attack.github.io/attack-navigator/#layerURL={{ '/mitre.json' | absolute_url }})
{:.centered}

[contributors]: https://github.com/GTFOBins/GTFOBins.github.io/graphs/contributors
Expand Down
68 changes: 68 additions & 0 deletions mitre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 -%}
]
}

0 comments on commit 0360022

Please sign in to comment.