Sitemap

MITRE ATT&CK : DeTTECT

8 min readJan 30, 2023

--

Press enter or click to view image in full size

DeTT&CT for Detect Tactics, Techniques & Combat threats, is a tool used to help Blue Team using the MITRE ATT&CK framework to score and compare the quality of collected log sources, visibility coverage, detection coverage and Threat Actors behavior.

In other words, DeTT&CT answers the question : When it comes to detection, which log sources are most important ? Thus, using this framework, Blue Team can quickly detect gaps in detection coverage or visibility and prioritize the ingestion of new log sources.

DeTT&CT provides a framework that can map the available entity information in ATT&CK and helps manage Blue Teams’ data, visibility and detection coverage.

It consists of :

  • A python tool (DeTT&CT CLI)
  • YAML administration files.
  • DeTT&CT editor (to create and modify YAML administration files)
  • Notation tables for detection, data sources and visibility.

DeTT&CT CLI is a python script (dettect.py) that works with 06 different modes :

  • editor : Launching the DeTT&CT editor web interface.
  • datasources (ds) : Mapping and quality of data sources.
  • visibility (v) : Visibility coverage mapping based on techniques and data sources.
  • detection (d): Mapping of detection coverage based on techniques.
  • group (g): Mapping of Threat Actor groups.
  • generic (ge): Includes statistics on ATT&CK log sources and updates on techniques, groups and software.

Outline of the article

  1. DeTT&CT Install & Config
  2. DeTT&CT Data sources
  3. DeTT&CT Visibility
  4. DeTT&CT Detection
  5. Gap Analysis

1. DeTT&CT Install & Config

On linux machine

git clone https://github.com/rabobank-cdc/DeTTECT.git
cd DeTTECT
pip install -r requirements.txt
Press enter or click to view image in full size

To start the DeTT&CT editor :

python3 dettect.py e
Press enter or click to view image in full size

Next, use a web browser to access <Host IP address>:8080

Press enter or click to view image in full size

We can also use DeTT&CT to get which data source covers most of the techniques in MITRE/ATT&CK, to do so, we launch the python script with the following options.

python dettect.py generic -ds 
Press enter or click to view image in full size

As we can see, the data source “Command Execution” covers 262 techniques based on MITRE/ATT&CK.

2. DeTT&CT Data sources

Lets start by using this feature

Press enter or click to view image in full size

Then “Add data source” at this stage on the right we can choose our data sources

Press enter or click to view image in full size

For example, lets choose :

  • Command execution, Process Creation, File Modification, OS API Execution, File Creation.
Press enter or click to view image in full size
Press enter or click to view image in full size

Once the data sources added, we can save the file, by clicking on “Save YAML file”. (You can put the file in the same place as the “dettect.py” for the further experiments)

Press enter or click to view image in full size

Use case 1:

Date tracking can help us monitor the improvement of our data sources. To generate a graph based on the generated “data-sources.yaml” file, we can execute “dettect.py” script with the following options :

python dettect.py ds -fd data-sources-endpoints.yaml -g
Press enter or click to view image in full size
Press enter or click to view image in full size

Use case 2:

We can also use the generated file with MITRE/ATT&CK Navigator

First, we convert the .yaml to .json file

python3 dettect.py ds -fd ../data-sources-new.yaml -l
Press enter or click to view image in full size
Press enter or click to view image in full size

Next, we upload the “.json” file on MITRE Navigator by clicking on “OPen Existing Layer”

Press enter or click to view image in full size

Thus, we can see the techniques covered by choosing the 05 data sources used above.

Press enter or click to view image in full size

The colors as shown in the legend represent the percentage of log sources for each technique.

We notice that the “Web Portal Capture” technique is 100% covered since it requires the log source : “File Modification” which is available.

Get Redouane OTMANI’s stories in your inbox

Join Medium for free to get updates from this writer.

Lets take another example, for the technique “Domain Account”, we notice that it requires the following data sources : Command Execution, Process Creation, User Account Creation. This last was not included above, so the “Domain Account” technique is only covered at 66%.

To summarize, if we want to improve the coverage of a particular technique, we have MITRE ATTACK to see which data source(s) should we integrate for our detection.

In addition, you can used this data source layer with a MITRE ATT&CK threat analysis layer and pinpoint gaps in your detection based on this analysis.

3. DeTT&CT Visibility

In this section, we will use DeTT&CT to see our level of visibility.

Lets start by generating a YAML technique administration file based on the data source administration file “data-sources-new.yaml” generated in the previous section.

By default, the “ — — yaml” argument includes only those techniques for which the visibility score is greater than 0.

python3 dettect.py ds -fd data-sources-new.yaml --yaml
Press enter or click to view image in full size

If we want to include all ATT&CK techniques that apply :

python3 dettect.py ds -fd data-sources-new.yaml --yaml --yaml-all-techniques
Press enter or click to view image in full size

The two resulting files will give us an approximate visibility scores. To see the difference we can upload’em in DeTT&CT Editor at the “TECHNIQUES” level.

Press enter or click to view image in full size
Press enter or click to view image in full size

We can see on the right that the score is 0 for the file generated by the — yam-all-techniques option.

Press enter or click to view image in full size

Further, for this tutorial, I’ll keep using the file generated where I have included only the techniques for which the visibility score is higher that 0 “techniques-administration-example.yaml”

To view the visibility scores on MITRE ATT&CK Navigator we convert the file to json.

python3 dettect.py v -ft techniques-administration-example.yaml -l
Press enter or click to view image in full size

Then, we upload it on MITRE Navigator

Press enter or click to view image in full size
Press enter or click to view image in full size

We can see thus, the visibility score of 1 out of 4 of the techniques in relation to the data sources.

4. DeTT&CT Detection

Once we have listed our data sources, with a good understanding of visibility, we can move on to detection.

Using the YAML techniques administration file generated in the previous section, we can administer our detection level with the following :

  • The system(s) to which the detection applies (Windows terminals, Windows servers, Linux server)
  • A detection score, which is the date when the detection was implemented or improved.

We upload the ile “techniques-administration-example.yaml” in the “TECHNIQUES” of DeTT&CT

Press enter or click to view image in full size
Press enter or click to view image in full size

Then, we select one of the techniques :

Press enter or click to view image in full size
Press enter or click to view image in full size

We save the file

Next, to visualize the file on MITRE ATT&CK (the -l option is for layer)

python3 dettect.py d -ft techniques-administration-example.yaml -l
Press enter or click to view image in full size
Press enter or click to view image in full size

As we can see, we had assigned a score to the “OS Credential Dumping” technique as a result, only the later will appear in our layer.

5. Gap Analysis

With DeTT&CT we can compare our detection layer with a threat analysis layer, or any another layer generated specifically for an exercise by Red Teams to identify possible gaps in our detection.

Executing the “dettect.py” script with the following options would highlight the differences:

python3 dettect.py g -g <Threat Actor Group Layer>.yaml -o <Our Layer>.yaml -t detection.

Example :

python3 dettect.py g -g sample-data/groups.yaml -o ../techniques-administration-example.yaml -t detection
Press enter or click to view image in full size
Press enter or click to view image in full size

We can also generate a layer that compares the visibility and detection

Using the detection mode

python3 dettect.py d -ft techniques-administration-endpoints.yaml -o

Or with the visibility mode, both commands return the same layer.

python3 dettect.py v -ft  techniques-administration-endpoints.yaml -o
Press enter or click to view image in full size
Press enter or click to view image in full size

If you appreciate, please leave a comment, follow me to get notified whenever I write new articles, you can also follow me on Twitter :)

--

--