MITRE ATT&CK : DeTTECT
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
- DeTT&CT Install & Config
- DeTT&CT Data sources
- DeTT&CT Visibility
- DeTT&CT Detection
- 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.txtTo start the DeTT&CT editor :
python3 dettect.py eNext, use a web browser to access <Host IP address>:8080
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 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
Then “Add data source” at this stage on the right we can choose our data sources
For example, lets choose :
- Command execution, Process Creation, File Modification, OS API Execution, File Creation.
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)
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 -gUse 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 -lNext, we upload the “.json” file on MITRE Navigator by clicking on “OPen Existing Layer”
Thus, we can see the techniques covered by choosing the 05 data sources used above.
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 --yamlIf we want to include all ATT&CK techniques that apply :
python3 dettect.py ds -fd data-sources-new.yaml --yaml --yaml-all-techniquesThe 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.
We can see on the right that the score is 0 for the file generated by the — yam-all-techniques option.
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 -lThen, we upload it on MITRE Navigator
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
Then, we select one of the techniques :
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 -lAs 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 detectionWe can also generate a layer that compares the visibility and detection
Using the detection mode
python3 dettect.py d -ft techniques-administration-endpoints.yaml -oOr with the visibility mode, both commands return the same layer.
python3 dettect.py v -ft techniques-administration-endpoints.yaml -oIf you appreciate, please leave a comment, follow me to get notified whenever I write new articles, you can also follow me on Twitter :)










