Files

100 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

2018-05-10 13:26:34 -06:00
# <%= technique['identifier'] %> - <%= technique['name'] -%>
2018-05-10 14:10:42 -06:00
2020-09-29 09:53:01 -04:00
## [Description from ATT&CK](https://attack.mitre.org/techniques/<%= technique['identifier'].gsub(/\./, '/') %>)
2025-02-13 17:02:44 -05:00
<blockquote>
<%= technique['description'].gsub("%\\<", "%<") %>
</blockquote>
2018-05-10 13:26:34 -06:00
2018-05-10 14:11:34 -06:00
## Atomic Tests
2018-05-10 13:26:34 -06:00
<% atomic_yaml['atomic_tests'].each_with_index do |test, test_number| -%>
2018-05-10 13:32:31 -06:00
<% title = "Atomic Test ##{test_number+1} - #{test['name']}" %>
2018-05-10 13:45:18 -06:00
- [<%= title %>](#<%= title.downcase.gsub(/ /, '-').gsub(/[`~!@#$%^&*()+=<>?,.\/:;"'|{}\[\]\\–—]/, '') %>)
2018-05-10 13:52:48 -06:00
<% end %>
2018-05-10 13:32:31 -06:00
<% atomic_yaml['atomic_tests'].each_with_index do |test, test_number| -%>
2018-05-10 13:53:31 -06:00
<br/>
2018-05-10 13:54:12 -06:00
2018-05-10 13:32:31 -06:00
## Atomic Test #<%= test_number+1 %> - <%= test['name'] %>
<%= test['description'].strip -%>
2018-05-10 13:26:34 -06:00
**Supported Platforms:** <%= test['supported_platforms'].collect do |p|
case p
when 'macos'
'macOS'
else
p.capitalize
end
end.join(', ') %>
2018-05-10 13:26:34 -06:00
**auto_generated_guid:** <%= test['auto_generated_guid'] %>
2020-03-16 08:50:43 -06:00
<%def cleanup(input)
input.to_s.strip.gsub(/\\/,"&#92;")
end%>
2018-05-10 13:26:34 -06:00
<% if test['input_arguments'].to_a.count > 0 %>
2020-01-21 12:11:45 -06:00
#### Inputs:
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
2018-05-10 13:26:34 -06:00
<% test['input_arguments'].each do |arg_name, arg_options| -%>
2020-03-16 08:50:43 -06:00
| <%= cleanup(arg_name) %> | <%= cleanup(arg_options['description']) %> | <%= cleanup(arg_options['type']) %> | <%= cleanup(arg_options['default']) %>|
2018-05-10 13:26:34 -06:00
<% end -%>
<% end -%>
<%- if test['executor']['name'] == 'manual' -%>
#### Run it with these steps! <%- if test['executor']['elevation_required'] -%> Elevation Required (e.g. root or admin) <%- end -%>
2018-05-10 13:26:34 -06:00
<%= test['executor']['steps'] %>
<%- else -%>
2020-01-21 12:11:45 -06:00
#### Attack Commands: Run with `<%= test['executor']['name'] %>`! <%- if test['executor']['elevation_required'] -%> Elevation Required (e.g. root or admin) <%- end -%>
<%def get_language(executor)
language = executor
if executor == "command_prompt"
language = "cmd"
elsif executor == "manual"
language = ""
end
language
end%>
```<%= get_language(test['executor']['name']) %>
2020-01-21 12:11:45 -06:00
<%= test['executor']['command'].to_s.strip %>
```
<%- end -%>
<%- if test['executor']['cleanup_command'] != nil -%>
#### Cleanup Commands:
```<%= get_language(test['executor']['name']) %>
<%= test['executor']['cleanup_command'].to_s.strip %>
```
<%- end -%>
2020-01-21 12:11:45 -06:00
<% if test['dependencies'].to_a.count > 0 %>
<% dependency_executor = test['executor']['name'] %>
#### Dependencies: Run with `<%- if test['dependency_executor_name'] != nil%><% dependency_executor = test['dependency_executor_name'] %><%= test['dependency_executor_name'] %><%- else -%><%= test['executor']['name'] %><%- end -%>`!
2020-01-21 12:11:45 -06:00
<% test['dependencies'].each do | dep | -%>
2020-08-04 18:38:06 -06:00
##### Description: <%= dep['description'].strip %>
2020-01-21 12:11:45 -06:00
##### Check Prereq Commands:
```<%= get_language(dependency_executor) %>
<%= dep['prereq_command'].strip %>
2020-01-21 12:11:45 -06:00
```
##### Get Prereq Commands:
```<%= get_language(dependency_executor) %>
2020-08-04 18:38:06 -06:00
<%= dep['get_prereq_command'].strip %>
2020-01-21 12:11:45 -06:00
```
<% end -%>
<% end -%>
2018-05-10 13:53:31 -06:00
<br/>
<%- end -%>