File size: 10,789 Bytes
5f52c9d |
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# DikeDataset ποΈ
## Table of Content π
- [DikeDataset ποΈ](#dikedataset-οΈ)
- [Table of Content π](#table-of-content-)
- [Description ποΈ](#description-οΈ)
- [Labels Exploration π](#labels-exploration-)
- [Methodology π·](#methodology-)
- [Downloading Step](#downloading-step)
- [Renaming Step](#renaming-step)
- [Scanning Step](#scanning-step)
- [Labeling Step](#labeling-step)
- [Sources Β©οΈ](#sources-οΈ)
- [Folders Structure π](#folders-structure-)
- [Citations π](#citations-)
## Description ποΈ
**DikeDataset** is a **labeled dataset** containing **benign and malicious PE and OLE files**.
Considering the number, the types, and the meanings of the labels, DikeDataset can be used for training artificial intelligence algorithms to predict, for a PE or OLE file, the **malice** and the **membership to a malware family**. The artificial intelligence approaches can vary from machine learning (with algorithms such as regressors and soft multi-label classifiers) to deep learning, depending on the requirements.
It is worth mentioning that the numeric labels, with values between `0` and `1`, can be transformed into discrete ones to respect the constraints of standard classification. For example, if a superior malice limit for benign files is set to `0.4`, a file having the malice of `0.593` is considered malicious.
## Labels Exploration π
<details>
<summary>Samples Distribution</summary>
<img src="others/images/distribution.png" alt="Plot with the distribution of samples" width=600>
</details>
<details>
<summary>Labels Identification</summary>
| Name | Type |
| ---------- | ------- |
| type | int64 |
| hash | object |
| malice | float64 |
| generic | float64 |
| trojan | float64 |
| ransomware | float64 |
| worm | float64 |
| backdoor | float64 |
| spyware | float64 |
| rootkit | float64 |
| encrypter | float64 |
| downloader | float64 |
</details>
<details>
<summary>Mean, Standard Deviation, Minimum and Maximum</summary>
| | malice | generic | trojan | ransomware | worm | backdoor | spyware | rootkit | encrypter | downloader |
| ---- | --------- | --------- | --------- | ---------- | --------- | --------- | ---------- | ---------- | --------- | ---------- |
| mean | 0.876484 | 0.412354 | 0.44581 | 0.00503229 | 0.0086457 | 0.0117696 | 0.00030322 | 0.00614807 | 0.0719921 | 0.037945 |
| std | 0.0779914 | 0.0779332 | 0.0891624 | 0.0192288 | 0.0189522 | 0.0333144 | 0.00227205 | 0.0263416 | 0.0622346 | 0.0699552 |
| min | 0.235294 | 0.140351 | 0.05 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| max | 0.981132 | 0.916667 | 0.76087 | 0.307692 | 0.59 | 0.290323 | 0.0212766 | 0.307692 | 0.3125 | 0.307692 |
</details>
<details>
<summary>Histograms</summary>
<img src="others/images/histograms.png" alt="Plot containing a histogram for each numeric label" width=800>
</details>
## Methodology π·
> **Observation**: A Bash [script](others/scripts/get_files.sh) can be used to replicate the downloading and the renaming steps. On the other hand, the last two steps consist of using functionalities that are available only in the `dike`, namely in [this](https://github.com/iosifache/dike/blob/main/codebase/scripts/continuous_vt_scan.py) Python script.
### Downloading Step
1. For PE files, a dataset (see the [Sources](#sources-οΈ) section) created for a paper was downloaded. As the files were packed inside multiple folders (one for each malware family considered in the study), they were moved into two new folders, malice oriented.
2. For malicious OLE files, 12 daily (one from each 15th of the 12 previous months) archives were downloaded from MalwareBazaar (see the [Sources](#sources-οΈ) section). After unarchiving, the files were filtered by certain extensions (`.doc`, `.docx` `.docm` `.xls` `.xlsx` `.xlsm` `.ppt` `.pptx` `.pptm`).
3. For benign OLE files, 100 files were manually downloaded from the results of random DuckDuckGo searches.
### Renaming Step
1. All resulting files were renamed by their SHA256 hash.
2. The OLE files, having the Office-specific extensions mentioned in the last paragraph, were replaced with `.ole`.
### Scanning Step
1. The hashes of all malicious files were dumped into a file.
2. The file containing hashes was uploaded into a bucket in Google Cloud Storage.
3. A Google Cloud Function was created, containing a Python script (*see the observation above*) and triggered by a Google Cloud Scheduler four times in a minute (to respect the API quota). It consumed the hashes by scanning them with the VirusTotal API and dumping specific parts of the results (antivirus engines votes and tags) into a [file](others/vt_data.csv).
### Labeling Step
1. The file containing the VirusTotal data, which resulted from the scanning step, was moved locally, where `dike` was already set.
2. To compute the malice, the weighted formula below was used, where the `MALIGN_BENIGN_RATIO` constant was set to `2`. This means that one antivirus engine considering that the file was malicious has the same weight (on a scale) as two engines considering it is benign.
```
malign_weight = MALIGN_BENIGN_RATIO * malign_votes
benign_weight = benign_votes
malice = malign_weight / (malign_weight + benign_weight)
```
3. To compute the membership on each malware family, a transformer was developed (*see the observation above*) to "*vote*" for each available family. For example, if an antivirus engine tag was `Trj`, then one vote for the trojan family was offered. All tags were consumed in this way and the votes for all families were normalized.
4. For the benign files, the process was straight-forward as the malice and the memberships were set to `0`.
## Sources Β©οΈ
1. [Malware Detection PE-Based Analysis Using Deep Learning Algorithm Dataset](https://figshare.com/articles/dataset/Malware_Detection_PE-Based_Analysis_Using_Deep_Learning_Algorithm_Dataset/6635642), containing malicious and benign PE files and having CC BY 4.0 license
2. [MalwareBazaar](https://bazaar.abuse.ch), containing (among others) malicious OLE files and having CC0 license
3. [DuckDuckGo](https://duckduckgo.com/), that was used for searching benign documents with patterns such as `filetype:doc`
## Folders Structure π
```
DikeDataset root folder
βββ files folder with all samples
β βββ benign folder for benign samples
β β βββ ...
β βββ malware folder for malicious samples
β βββ ...
βββ labels folder with all labels
β βββ benign.csv labels folder for benign samples
β βββ malware.csv labels folder for malicious samples
βββ others folder with miscellaneous files
β βββ images folder with generated images
β β βββ distribution.png image with a plot with the distribution of samples
β β βββ histograms.png image containing the histograms for each numeric label
β βββ scripts folder with used scripts
β | βββ explore.py Python 3 script for labels exploration
β | βββ get_files.sh Shell script for downloading a large part of the samples
β | βββ requirements.txt Python 3 dependencies for the explore.py script
β βββ tables folder with generated tables
β β βββ labels.md table in Markdown format containing the identification
β β β of labels
β β βββ univariate_analysis.md table in Markdown format containing the results of a
β β univariate analysis
β βββ vt_data.csv raw VirusTotal scan results
βββ README.md this file
```
## Citations π
DikeDataset was proudly used in:
- **Academic studies** with BibTeX references in [`others/citations.bib`](others/citations.bib)
- "*A Corpus of Encoded Malware Byte Information as Images for Efficient Classification*"
- "*Adversarial Robustness of Learning-based Static Malware Classifiers*"
- "*An ensemble deep learning classifier stacked with fuzzy ARTMAP for malware detection*"
- "*AutoEncoder κΈ°λ° μλλ
ν μ¬μ νμ΅ λ° μ μ΄νμ΅μ ν΅ν μ
μ±μ½λ νμ§ λ°©λ²λ‘ *"
- "*Comparison of Feature Extraction and Classification Techniques of PE Malware*"
- "*Deep Learning based Residual Attention Network for Malware Detection in CyberSecurity*"
- "*Detecting Malware Activities with MalpMiner: A Dynamic Analysis Approach*"
- "*Effective Call Graph Fingerprinting for the Analysis and Classification of Windows Malware*"
- "*Evaluation and survey of state of the art malware detection and classification techniques: Analysis and recommendation*"
- "*Intelligent Endpoint-based Ransomware Detection Framework*"
- "*Knowledge Graph creation on Windows malwares and completion using knowledge graph embedding*"
- "*Machine Learning for malware characterization and identification*"
- "*Malware Detection by Control-Flow Graph Level Representation Learning With Graph Isomorphism Network*"
- "*Malware Detection in URL Using Machine Learning Approach*"
- "*SoK: Use of Cryptography in Malware Obfuscation*"
- "*TΓ©cnicas de aprendizaje mΓ‘quina para anΓ‘lisis de malware*"
- "*Toward a methodology for malware analysis and characterization for Machine Learning application*"
- "*Toward identifying APT malware through API system calls*"
- "*Uso de algoritmos de machine learning para la detecciΓ³n de archivos malware*"
- **Projects**
- [`dike`](https://github.com/iosifache/dike), a platform that uses artificial intelligence techniques in the process of malware analysis
- [Various open source projects](https://github.com/search?q=dikedataset&type=code).
> **Notice**: If you're using DikeDataset in an academic study or project, please open an issue or submit a PR if you want to be cited in the above list and the citations file.
|