# T1195 - Supply Chain Compromise

## Description from ATT&CK

> Adversaries may manipulate products or product delivery mechanisms prior to receipt by a final consumer for the purpose of data or system compromise.
> 
> Supply chain compromise can take place at any stage of the supply chain including:
> 
> * Manipulation of development tools
> * Manipulation of a development environment
> * Manipulation of source code repositories (public or private)
> * Manipulation of source code in open-source dependencies
> * Manipulation of software update/distribution mechanisms
> * Compromised/infected system images (removable media infected at the factory)(Citation: IBM Storwize)(Citation: Schneider Electric USB Malware)
> * Replacement of legitimate software with modified versions
> * Sales of modified/counterfeit products to legitimate distributors
> * Shipment interdiction
> 
> While supply chain compromise can impact any component of hardware or software, adversaries looking to gain execution have often focused on malicious additions to legitimate software in software distribution or update channels.(Citation: Avast CCleaner3 2018)(Citation: Microsoft Dofoil 2018)(Citation: Command Five SK 2011) Adversaries may limit targeting to a desired victim set or distribute malicious software to a broad set of consumers but only follow up with specific victims.(Citation: Symantec Elderwood Sept 2012)(Citation: Avast CCleaner3 2018)(Citation: Command Five SK 2011) Popular open-source projects that are used as dependencies in many applications may also be targeted as a means to add malicious code to users of the dependency.(Citation: Trendmicro NPM Compromise)
> 
> In some cases, adversaries may conduct “second-order” supply chain compromises by leveraging the access gained from an initial supply chain compromise to further compromise a software component.(Citation: Krebs 3cx overview 2023) This may allow the threat actor to spread to even more victims.

[Source](https://attack.mitre.org/techniques/T1195)

## Atomic Tests

- [Atomic Test #1: Octopus Scanner Malware Open Source Supply Chain](#atomic-test-1-octopus-scanner-malware-open-source-supply-chain)

### Atomic Test #1: Octopus Scanner Malware Open Source Supply Chain

This test simulates an adversary Octopus drop the RAT dropper ExplorerSync.db
[octopus-scanner-malware-open-source-supply-chain](https://securitylab.github.com/research/octopus-scanner-malware-open-source-supply-chain/)
[the-supreme-backdoor-factory](https://www.dfir.it/blog/2019/02/26/the-supreme-backdoor-factory/)

**Supported Platforms:** Windows

**auto_generated_guid:** `82a9f001-94c5-495e-9ed5-f530dbded5e2`

#### Inputs

| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| rat_payload | RAT dropper ExplorerSync.db | path | $env:TEMP&#92;ExplorerSync.db|

#### Attack Commands: Run with `command_prompt`!

```cmd
copy %temp%\ExplorerSync.db %temp%\..\Microsoft\ExplorerSync.db
schtasks /create /tn ExplorerSync /tr "javaw -jar %temp%\..\Microsoft\ExplorerSync.db" /sc MINUTE /f
```

#### Cleanup Commands

```cmd
schtasks /delete /tn ExplorerSync /F 2>null
del %temp%\..\Microsoft\ExplorerSync.db 2>null
del %temp%\ExplorerSync.db 2>null
```

#### Dependencies: Run with `powershell`!

##### Description: ExplorerSync.db must exist on disk at specified location (#{rat_payload})

###### Check Prereq Commands

```powershell
if (Test-Path #{rat_payload}) {exit 0} else {exit 1}
```

###### Get Prereq Commands

```powershell
Out-File -FilePath "#{rat_payload}"
```